-
-
Notifications
You must be signed in to change notification settings - Fork 486
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
Drop support for Python 3.8, added support for Django 5.1 #1421
Conversation
@ddabble alright, I'm done for the day. I think I created the PRs in reverse order, but 🤷 . We'll get there. |
d0caf87
to
ca9ff34
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1421 +/- ##
==========================================
+ Coverage 96.81% 96.96% +0.14%
==========================================
Files 24 24
Lines 1446 1448 +2
Branches 236 236
==========================================
+ Hits 1400 1404 +4
+ Misses 25 24 -1
+ Partials 21 20 -1 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
#1388 i think this issue need to be resolved |
@anyidea would you be interested in doing the follow-up PR to handle that deprecation? |
ca9ff34
to
4af5154
Compare
@tim-schilling If this PR is not ready to merge, Is it okay if we split it into multiple parts? pre-commit updates, 3.8 drop and 5.1 support can be handled separately, which I believe would lead to faster merges. |
@ulgens I think in either case, the PR needs to be reviewed which is the blocker. |
I agree that splitting PRs like this in general lowers the bar of reviewing them, with regards to the time required to do so properly 👍 Though I think the size of this PR is absolutely manageable, so it's ok :) |
@tim-schilling Would you mind if I rebased the commits? Both to add a few things that I think should be added (I'll request your review in any case 🙂), and to reorganize the commits to have one for dropping Python 3.8 and one for adding Django 5.1. |
Sounds good to me! |
Its EOL was recently passed - see https://devguide.python.org/versions/#unsupported-versions Made the new minimum Python version 3.9. --------- Co-authored-by: Anders <[email protected]>
Also handled the deprecation of `get_cache_name()` - see https://docs.djangoproject.com/en/5.1/releases/5.1/#features-deprecated-in-5-1
4af5154
to
e0d6723
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main changes that I added:
- Updated the version table in
index.rst
- Removed some unused typing imports
- Merged the
dj{50,51}
anddjmain
envlist entries intox.ini
Great work! 😊
cache_name = ( | ||
# DEV: Remove this when support for Django 5.0 has been dropped | ||
self.field.remote_field.get_cache_name() | ||
if django.VERSION < (5, 1) | ||
else self.field.remote_field.cache_name | ||
) | ||
try: | ||
return self.instance._prefetched_objects_cache[ | ||
self.field.remote_field.get_cache_name() | ||
] | ||
return self.instance._prefetched_objects_cache[cache_name] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the cache_name
property was added in Django 5.1, so I corrected the version numbers 🙂
Also, the tests didn't fail because of the except (AttributeError, KeyError):
below, so I moved the cache_name
variable out of the try
block, to make the except
only catch errors with the _prefetched_objects_cache[cache_name]
line (self.field.remote_field
should always have a cache_name
/get_cache_name()
value, to my understanding).
# DEV: uncomment this when the `pyproject-fmt` pre-commit hook stops removing it | ||
#"Programming Language :: Python :: 3.13", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks :)
@tim-schilling When you think the PR is ready, let's do a merge commit, since the commits have been cleaned up 🙂 |
Description
Related Issue
Resolves #1388.
Motivation and Context
Python 3.8 has reached EoL
Types of changes
Is dropping a python version a breaking change?
Checklist:
pre-commit run
command to format and lint.AUTHORS.rst
CHANGES.rst