Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/dependabot.yml

This file was deleted.

16 changes: 8 additions & 8 deletions .github/workflows/docker-test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,29 @@ jobs:

strategy:
matrix:
req_file:
- prod.txt
- tests.txt
dependency_groups:
- prod
- tests

# steps taken (and trimmed) from docker-publish.yml
steps:
- name: Checkout repository
uses: actions/checkout@v4

- if: matrix.req_file != 'tests.txt'
name: Test docker image build (${{ matrix.req_file }})
- if: matrix.dependency_groups != 'tests'
name: Test docker image build (${{ matrix.dependency_groups }})
uses: docker/build-push-action@v6
with:
context: .
push: false
build-args: |
REQ_FILE=requirements/${{ matrix.req_file }}
DEPENDENCY_GROUPS=${{ matrix.dependency_groups }}

- if: matrix.req_file == 'tests.txt'
- if: matrix.dependency_groups == 'tests'
name: Set up Docker Compose
uses: docker/setup-compose-action@v1

- if: matrix.req_file == 'tests.txt'
- if: matrix.dependency_groups == 'tests'
name: Run the tests via Docker
run: |
docker compose build
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y gettext
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements/tests.txt
python -m uv sync --group tests
- name: Set up databases
run: |
PGPASSWORD="postgres" createuser -U postgres -d djangoproject --superuser -h localhost
Expand Down
16 changes: 13 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ repos:
- id: end-of-file-fixer
exclude: '(^djangoproject\/static\/js\/lib\/.*$)'
exclude_types: [json, sql]
- id: file-contents-sorter
files: ^(requirements/\w*.txt)$
args: ["--ignore-case"]
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
Expand Down Expand Up @@ -64,3 +61,16 @@ repos:
rev: 0.2.2
hooks:
- id: checkmake

- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.11.0
hooks:
- id: pyproject-fmt
args:
[
"--indent",
"4",
"--keep-full-version",
"--max-supported-python",
"3.12",
]
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ RUN apt-get update \
postgresql-client-17 \
&& apt-get distclean

ARG REQ_FILE=requirements/prod.txt
ARG DEPENDENCY_GROUPS=prod
ARG BUILD_DEPENDENCIES="g++ gcc libc6-dev libpq-dev zlib1g-dev"

# install python dependencies
COPY ./requirements ./requirements
RUN apt-get update \
&& apt-get install --assume-yes --no-install-recommends ${BUILD_DEPENDENCIES} \
&& python3 -m pip install --no-cache-dir -r ${REQ_FILE} \
&& uv sync --groups ${DEPENDENCY_GROUPS} \
&& apt-get purge --assume-yes --auto-remove ${BUILD_DEPENDENCIES} \
&& apt-get distclean

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ compile-scss-debug:
python -m pysassc $(SCSS)/output.scss $(STATIC)/css/output.css --sourcemap

install:
python -m pip install --requirement requirements/dev.txt
uv sync --group dev

migrations-check:
python -m manage makemigrations --check --dry-run
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Install and run locally from a virtual environment

#. Install dependencies::

python3 -m pip install -r requirements/dev.txt
uv sync --group dev

Alternatively, use the make task::

Expand Down Expand Up @@ -153,7 +153,7 @@ or for a HTML-based report::
tests manually using the ``test`` task of the ``Makefile``. Don't forget to
install the test requirements with the following command first though::

python -m pip install -r requirements/tests.txt
uv sync --group tests

Then run::

Expand Down
12 changes: 6 additions & 6 deletions accounts/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,25 +111,25 @@ def test_stat_tickets_triaged(self):
author="user1",
newvalue="Accepted",
ticket=Ticket.objects.create(),
**initial_ticket_values
**initial_ticket_values,
)
TicketChange.objects.create(
author="user1",
newvalue="Someday/Maybe",
ticket=Ticket.objects.create(),
**initial_ticket_values
**initial_ticket_values,
)
TicketChange.objects.create(
author="user1",
newvalue="Ready for checkin",
ticket=Ticket.objects.create(),
**initial_ticket_values
**initial_ticket_values,
)
TicketChange.objects.create(
author="user2",
newvalue="Accepted",
ticket=Ticket.objects.create(),
**initial_ticket_values
**initial_ticket_values,
)

response = self.client.get(self.user1_url)
Expand All @@ -145,13 +145,13 @@ def test_stat_tickets_triaged_unaccepted_not_counted(self):
oldvalue="Unreviewed",
newvalue="Accepted",
ticket=Ticket.objects.create(),
**common_ticket_values
**common_ticket_values,
)
TicketChange.objects.create(
oldvalue="Accepted",
newvalue="Unreviewed",
ticket=Ticket.objects.create(),
**common_ticket_values
**common_ticket_values,
)

response = self.client.get(self.user1_url)
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
context: ./
dockerfile: Dockerfile
args:
- REQ_FILE=requirements/tests.txt
- DEPENDENCY_GROUPS=tests
- BUILD_DEPENDENCIES=g++ gcc
entrypoint: ./docker-entrypoint.dev.sh
command: python manage.py runserver 0.0.0.0:8000
Expand Down
66 changes: 66 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[project]
name = "djangoproject-com"
version = "0.0.1"
description = "Source code to djangoproject.com"
requires-python = ">=3.12"
classifiers = [
"Framework :: Django",
"Framework :: Django :: 5.2",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"babel==2.17.0",
"django==5.2.7",
"django-admin-dracula==0.0.3",
"django-contact-form==5.2.0",
"django-countries==7.6.1",
"django-hosts==7.0.0",
"django-money==3.5.4",
"django-push @ git+https://github.com/brutasse/django-push.git@22fda99641cfbd2f3075a723d92652a8e38220a5",
"django-read-only==1.21.0",
"django-recaptcha==4.1.0",
"django-registration-redux==2.13",
"docutils==0.21.2",
"feedparser==6.0.12",
"jinja2==3.1.6",
"libsass==0.23.0",
"markdown==3.9",
"pillow==11.3.0",
"pygments==2.19.2",
"pykismet3==0.1.1",
"requests==2.32.5",
"sorl-thumbnail==12.11.0",
"sphinx==8.1.3",
"stripe==13.1.1",
"time-machine==2.19.0",
]

[dependency-groups]
dev = [
"black==25.9.0", # Used by Django's find_formatters and run_formatters
"django-debug-toolbar==6.1.0",
"pre-commit==4.3.0",
"psycopg[binary]==3.2.10",
"watchdog==6.0.0",
]

prod = [
"gunicorn==23.0.0",
"psycopg[c]==3.2.10",
"redis==6.4.0",
"sentry-sdk==2.43.0",
]

# TODO: Consider merging with dev group
tests = [
"coverage==7.11.0",
"requests-mock==1.12.1",
"tblib==3.2.1",
{ include-group = "dev" },
]

[tool.uv]
package = false
6 changes: 3 additions & 3 deletions releases/migrations/0005_release_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ def populate_artifacts(apps, schema_editor):
# releases/{major}.{minor}/Django-{version}.tar.gz
tarball=Case(
*(When(version=k, then=Value(v)) for k, v in VERSION_TO_TARBALL.items()),
default=default_artifact(".tar.gz")
default=default_artifact(".tar.gz"),
),
# releases/{major}.{minor}/Django-{version}-py3-none-any.whl
wheel=Case(
*(When(version=k, then=Value(v)) for k, v in VERSION_TO_WHEEL.items()),
default=default_artifact("-py3-none-any.whl")
default=default_artifact("-py3-none-any.whl"),
),
# pgp/Django-{version}.checksum.txt
checksum=Case(
*(When(version=k, then=Value(v)) for k, v in VERSION_TO_CHECKSUM.items()),
default=Concat(Value("pgp/Django-"), F("version"), Value(".checksum.txt"))
default=Concat(Value("pgp/Django-"), F("version"), Value(".checksum.txt")),
),
)

Expand Down
24 changes: 0 additions & 24 deletions requirements/common.txt

This file was deleted.

6 changes: 0 additions & 6 deletions requirements/dev.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements/prod.txt

This file was deleted.

4 changes: 0 additions & 4 deletions requirements/tests.txt

This file was deleted.

Loading
Loading