Repository navigation
chore: Drop legacy Django 2 / Python 2 compatibility shims - #204
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## fix/python311-support #204 +/- ##
========================================================
Coverage ? 97.45%
========================================================
Files ? 9
Lines ? 432
Branches ? 67
========================================================
Hits ? 421
Misses ? 6
Partials ? 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
10 of 21 tasks
jezdez
previously approved these changes
Nov 5, 2026
andruten
dismissed
jezdez’s stale review
November 5, 2026 16:47
The merge-base changed after approval.
- Remove django.utils.six fallback imports (views, transformer, tests) - Use http.cookies.SimpleCookie directly and drop py2 COOKIE_PREFIX - Remove Python version checks in tests (require Python 3.11+)
- Extend tox and GitHub Actions matrix to Python 3.11, 3.12 and 3.13 - Test Django 4.2 and 5.2 (drop 4.1, which is EOL) - Require Django 4.2 or newer in pyproject.toml - Exclude py313-dj42 (unsupported combination) - Replace assertDictContainsSubset, removed in Python 3.12's unittest
No behavior change; removes the class-name coupling that can silently skip classes in the MRO if a class is renamed/derived.
jezdez
force-pushed
the
chore/drop-legacy-shims
branch
from
November 5, 2026 16:47
1ed55e8 to
2a42b51
Compare
jezdez
approved these changes
Nov 5, 2026
codingjoe
reviewed
Nov 6, 2026
codingjoe
left a comment
Member
There was a problem hiding this comment.
Quick side note, Django 4.2 is also EoL and even 5.2 is only good until December.
|
|
||
| deps = | ||
| dj41: Django>=4.1.3,<4.2 | ||
| dj42: Django>=4.2,<5.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This branch now requires Python >= 3.11 and Django >= 4.2 , so all compatibility fallbacks for older versions have been removed, and the CI matrix now covers modern Python and Django versions.
Dead code cleanup
revproxy/views.py— Removed thetry/exceptfallback importingurllib.parseviadjango.utils.six.moves.sixwas removed from Django in 3.0, so the fallback was the only branch ever executed. It now imports directly fromurllib.parse.revproxy/transformer.py: Removed thedjango.utils.six.string_typesshim; usestrdirectly (isinstance(value, str)).revproxy/utils.py: Removed the Python 2 fallback importing from theCookiemodule; usehttp.cookies.SimpleCookiedirectly. With the Python 2 branch gone,COOKIE_PREFIXwas always'', so it was dropped and simplified toSimpleCookie(cookie_string).tests/test_views.py: Removed thedjango.utils.six.movesfallback; importParseResultdirectly fromurllib.parse.tests/test_request.py: Removed thesys.version_info >= (3, 0, 0)conditional and its Python 2urlparseimport; importparse_qsunconditionally and drop the now-unusedimport sys.Python 3.12/3.13 compatibility
tests/test_utils.py: ReplacedassertDictContainsSubset(removed fromunittestin Python 3.12) with an equivalent dict-items comparison. Caught by running the suite on Python 3.13.Extended CI matrix
tox.ini: The matrix coverspy3{11,12}-dj{42,52}andpy313-dj52, matching CI. Thegh-actionsentries cover Python 3.11/3.12/3.13 and Django 4.2/5.2. Django 4.1 (EOL) has been dropped..github/workflows/test.yml: The matrix is nowpython-version: ['3.11', '3.12', '3.13']×django-version: ['4.2', '5.2'], withDJANGOset from the matrix. Thepy313-dj42combination is excluded, since Django 4.2 does not officially support Python 3.13. Actions bumped:checkout@v4,setup-python@v5.Metadata
pyproject.toml: Dependency updated toDjango>=4.2; classifiers added for Python 3.12, 3.13 and Django 4.2, 5.2.README.rst: Requirement updated to Django ≥ 4.2.CHANGELOG.rst: Entry updated to reflect the new minimums and the CI matrix.Notes for reviewers
py312-dj42combination was not run locally (no local 3.12 interpreter), but matches code paths tested on 3.11/3.13; CI covers it.revproxy/views.pystill importssys(it's used elsewhere in the file).