Upgrade to Django 5.2 & Python 3.12#249
Conversation
There was a problem hiding this comment.
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-cachewithdjango-redisto 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_lazyinstead ofugettext_lazy,force_strinstead offorce_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.
kencochrane
left a comment
There was a problem hiding this comment.
This looks good, thank you. Assuming the tests pass, I'll merge
|
There are some conflicts and the tests are failing. Once they are fixed I’ll take another look |
|
That should be fixed now. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
|
@kencochrane can we get a release? |
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
django-redis-cachewithdjango-redisto resolve theImportError: sixissue in newer Django versions.setuptoolsto test dependencies to addressdistutilserrors on Python 3.12.gettext_lazy,force_str) in README.rst and removed support for end-of-life Python 3.7.tox.inimatrix and confirmed all tests pass across Django 5.x and Python 3.12.