Skip to content

deps: update to django 5.2 #2741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

deps: update to django 5.2 #2741

wants to merge 6 commits into from

Conversation

JacobCoffee
Copy link
Member

@JacobCoffee JacobCoffee commented Jun 13, 2025

Description

  • Update to Django 5.2

Closes

@JacobCoffee

This comment was marked as resolved.

@JacobCoffee
Copy link
Member Author

@JacobCoffee JacobCoffee added dependencies Pull requests that update a dependency file do-not-merge labels Jun 13, 2025
@JacobCoffee
Copy link
Member Author

length_is depr since 4.2, out in 5: https://docs.djangoproject.com/en/dev/releases/5.1/#features-removed-in-5-1

@JacobCoffee
Copy link
Member Author

Tests passing locally 🎉

…1)🤷✓] via 🐋 orbstack via 🤖 v22.5.1 via  pyenv via 💎 v2.7.8 took 2m27s 
➜ make test
# Build web container for this project
docker compose build --force-rm web
Compose can now delegate builds to bake for better performance.
 To do so, set COMPOSE_BAKE=true.
[+] Building 24.0s (19/19) FINISHED                         docker:orbstack
 => [web internal] load build definition from Dockerfile               0.0s
 => => transferring dockerfile: 1.67kB                                 0.0s
 => [web internal] load metadata for docker.io/library/python:3.12.6-  0.6s
 => [web internal] load .dockerignore                                  0.0s
 => => transferring context: 2B                                        0.0s
 => [web stage-0  1/13] FROM docker.io/library/python:3.12.6-bookworm  0.0s
 => [web internal] load build context                                  1.0s
 => => transferring context: 5.74MB                                    0.9s
 => CACHED [web stage-0  2/13] RUN set -eux;     rm -f /etc/apt/apt.c  0.0s
 => CACHED [web stage-0  3/13] RUN --mount=type=cache,target=/var/cac  0.0s
 => CACHED [web stage-0  4/13] RUN case $(uname -m) in          "x86_  0.0s
 => CACHED [web stage-0  5/13] RUN mkdir /code                         0.0s
 => CACHED [web stage-0  6/13] WORKDIR /code                           0.0s
 => CACHED [web stage-0  7/13] COPY dev-requirements.txt /code/        0.0s
 => [web stage-0  8/13] COPY base-requirements.txt /code/              0.3s
 => [web stage-0  9/13] COPY prod-requirements.txt /code/              0.2s
 => [web stage-0 10/13] COPY requirements.txt /code/                   0.1s
 => [web stage-0 11/13] RUN pip --no-cache-dir --disable-pip-version-  3.2s
 => [web stage-0 12/13] RUN --mount=type=cache,target=/root/.cache/p  12.8s 
 => [web stage-0 13/13] COPY . /code/                                  4.1s 
 => [web] exporting to image                                           1.5s 
 => => exporting layers                                                1.5s 
 => => writing image sha256:9e7f18d79b7d2bb55db6323cab4f79580a2179aa1  0.0s 
 => => naming to docker.io/library/pythondotorg:docker-compose         0.0s 
 => [web] resolving provenance for metadata file                       0.0s 
[+] Building 1/1
 ✔ web  Built                                                          0.0s 
# Mark the state so we don't rebuild this needlessly.
mkdir -p .state && touch .state/docker-build-web
# Load all fixtures
docker compose run --rm web ./manage.py loaddata fixtures/*.json
[+] Creating 2/2
 ✔ Container pythondotorg-redis-1     Running                          0.0s 
 ✔ Container pythondotorg-postgres-1  Running                          0.0s 
/usr/local/lib/python3.12/site-packages/haystack/__init__.py:4: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  from pkg_resources import DistributionNotFound, get_distribution, parse_version
System check identified some issues:

WARNINGS:
SponsorshipBenefit: (ordered_model.W003) OrderedModelBase subclass has a ModelManager that does not inherit from OrderedModelManager. This is not ideal but will work.
SponsorshipPackage: (ordered_model.W003) OrderedModelBase subclass has a ModelManager that does not inherit from OrderedModelManager. This is not ideal but will work.
Installed 3144 object(s) from 6 fixture(s)
# Mark the state so we don't rebuild this needlessly.
mkdir -p .state && touch .state/db-initialized
docker compose run --rm web ./manage.py test
[+] Creating 2/2
 ✔ Container pythondotorg-postgres-1  Running                          0.0s 
 ✔ Container pythondotorg-redis-1     Running                          0.0s 
/usr/local/lib/python3.12/site-packages/haystack/__init__.py:4: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  from pkg_resources import DistributionNotFound, get_distribution, parse_version
Found 623 test(s).
Creating test database for alias 'default'...
Got an error creating the test database: database "test_pythondotorg" already exists

Type 'yes' if you would like to try deleting the test database 'test_pythondotorg', or 'no' to cancel: yes
Destroying old test database for alias 'default'...
System check identified some issues:

WARNINGS:
SponsorshipBenefit: (ordered_model.W003) OrderedModelBase subclass has a ModelManager that does not inherit from OrderedModelManager. This is not ideal but will work.
SponsorshipPackage: (ordered_model.W003) OrderedModelBase subclass has a ModelManager that does not inherit from OrderedModelManager. This is not ideal but will work.

System check identified 2 issues (0 silenced).
...................................................................................................................................................................................................................................................................................Fullfilling full_conference_passes_code_2025 for Foo: 1848846014
Fullfilling pycon_expo_hall_only_passes_code_2025 for Foo: 1471792621
Fullfilling pycon_additional_full_conference_passes_code_2025 for Foo: 1176205334
Fullfilling pycon_additional_expo_hall_only_passes_2025 for Foo: 1461117240
Done!
.............................................................................................................................................................................../usr/local/lib/python3.12/site-packages/admin_interface/templatetags/admin_interface_tags.py:29: UserWarning: Language chooser requires 'django.middleware.locale.LocaleMiddleware' in your MIDDLEWARE to work.
  warnings.warn(
............................................................/usr/local/lib/python3.12/site-packages/admin_interface/templatetags/admin_interface_tags.py:29: UserWarning: Language chooser requires 'django.middleware.locale.LocaleMiddleware' in your MIDDLEWARE to work.
  warnings.warn(
../usr/local/lib/python3.12/site-packages/admin_interface/templatetags/admin_interface_tags.py:29: UserWarning: Language chooser requires 'django.middleware.locale.LocaleMiddleware' in your MIDDLEWARE to work.
  warnings.warn(
...............................................................................................................
----------------------------------------------------------------------
Ran 623 tests in 91.728s

OK
Destroying test database for alias 'default'..

@JacobCoffee
Copy link
Member Author

Investigate separately these non-failing warnings

......................../usr/local/lib/python3.12/site-packages/admin_interface/templatetags/admin_interface_tags.py:29: UserWarning: Language chooser requires 'django.middleware.locale.LocaleMiddleware' in your MIDDLEWARE to work.
  warnings.warn(
............................................................/usr/local/lib/python3.12/site-packages/admin_interface/templatetags/admin_interface_tags.py:29: UserWarning: Language chooser requires 'django.middleware.locale.LocaleMiddleware' in your MIDDLEWARE to work.
  warnings.warn(
../usr/local/lib/python3.12/site-packages/admin_interface/templatetags/admin_interface_tags.py:29: UserWarning: Language chooser requires 'django.middleware.locale.LocaleMiddleware' in your MIDDLEWARE to work.
  warnings.warn

@JacobCoffee
Copy link
Member Author

Investigate separately these non-failing warnings

WARNINGS:
SponsorshipBenefit: (ordered_model.W003) OrderedModelBase subclass has a ModelManager that does not inherit from OrderedModelManager. This is not ideal but will work.
SponsorshipPackage: (ordered_model.W003) OrderedModelBase subclass has a ModelManager that does not inherit from OrderedModelManager. This is not ideal but will work.

@JacobCoffee
Copy link
Member Author

all that remains is https://github.com/python/pythondotorg/actions/runs/15639586106/job/44063439645?pr=2741 mentioned above me thinks

@JacobCoffee
Copy link
Member Author

Methodology was to run
git ls-files -z -- '*.py' | xargs -0r uvx run django-upgrade --target-vers ion 5.2 which didnt change much, didn't catch the length_is deprecation for example, then run make test and fix deps one by one as they failed 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file do-not-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Django 5.2
1 participant