Skip to content

Upgrade to Django 5.2 & Python 3.12#249

Merged
kencochrane merged 3 commits into
jazzband:masterfrom
itsh3sam:master
Feb 1, 2026
Merged

Upgrade to Django 5.2 & Python 3.12#249
kencochrane merged 3 commits into
jazzband:masterfrom
itsh3sam:master

Conversation

@itsh3sam

@itsh3sam itsh3sam commented Jan 4, 2026

Copy link
Copy Markdown
Contributor

Upgrade to Django 5.2 & Python 3.12

The project has been updated to run on Django 5.0–5.2 and Python 3.12.

Key Changes

  • Dependencies: Replaced django-redis-cache with django-redis to resolve the ImportError: six issue in newer Django versions.
  • Compatibility fixes: Added setuptools to test dependencies to address distutils errors on Python 3.12.
  • Code modernization: Updated deprecated imports (gettext_lazy, force_str) in README.rst and removed support for end-of-life Python 3.7.
  • Testing: Expanded the tox.ini matrix and confirmed all tests pass across Django 5.x and Python 3.12.

Copilot AI review requested due to automatic review settings January 4, 2026 23:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request upgrades the django-defender project to support Django 5.0-5.2 and Python 3.12, while removing support for end-of-life Python 3.7 and streamlining the test matrix to focus on LTS and current Django versions.

Key Changes:

  • Replaced django-redis-cache with django-redis to resolve compatibility issues with newer Django versions
  • Updated test matrix to include Django 5.0, 5.1, 5.2 and Python 3.12
  • Modernized documentation examples to use current Django imports (gettext_lazy instead of ugettext_lazy, force_str instead of force_text)

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tox.ini Updated test matrix to remove Python 3.7, add Python 3.12, remove Django 4.0/4.1 testing, and add Django 5.0/5.1/5.2 test environments; moved lint/docs environments to Python 3.12
setup.py Added Django 4.2, 5.0, 5.1, 5.2 and Python 3.11, 3.12 to classifiers; removed Python 3.7; updated minimum Python requirement to 3.8; replaced django-redis-cache with django-redis in test dependencies; added minimum redis version requirement
requirements.txt Replaced django-redis-cache with django-redis to match setup.py changes
defender/ci_settings.py Migrated cache backend from redis_cache.RedisCache to django_redis.cache.RedisCache with updated configuration format including explicit LOCATION URL and CLIENT_CLASS
README.rst Updated supported version documentation to list specific Django versions (3.2, 4.2, 5.0, 5.1, 5.2) and Python versions (3.8-3.12); modernized example code to use gettext_lazy instead of deprecated ugettext_lazy and force_str instead of deprecated force_text

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread setup.py
@itsh3sam itsh3sam mentioned this pull request Jan 4, 2026

@kencochrane kencochrane left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, thank you. Assuming the tests pass, I'll merge

@kencochrane

Copy link
Copy Markdown
Collaborator

There are some conflicts and the tests are failing. Once they are fixed I’ll take another look

@itsh3sam

itsh3sam commented Feb 1, 2026

Copy link
Copy Markdown
Contributor Author

That should be fixed now.

@codecov

codecov Bot commented Feb 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.92%. Comparing base (cc35032) to head (16e34a9).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #249      +/-   ##
==========================================
+ Coverage   92.58%   92.92%   +0.33%     
==========================================
  Files          13       13              
  Lines         418      438      +20     
==========================================
+ Hits          387      407      +20     
  Misses         31       31              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kencochrane kencochrane left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@kencochrane
kencochrane merged commit daa6235 into jazzband:master Feb 1, 2026
18 checks passed
@bj00rn

bj00rn commented Apr 1, 2026

Copy link
Copy Markdown

@kencochrane can we get a release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants