-
Notifications
You must be signed in to change notification settings - Fork 293
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
Support Django 5.0 #438
Support Django 5.0 #438
Conversation
Currently there are three test failures:
The latter two cases are caused by Django’s changes to handling One option is to instead use a no-argument callable, which will always be called later. I tried adding |
I think we can stop using |
d60d8f1
to
85dd434
Compare
The fix ( django/django#17370 ) was merged and released in Django 5.0b1. I have updated the code to use the new callable I also added a fix for the admin change:
Everything is passing now. |
91efae7
to
b01ed85
Compare
b01ed85
to
58f2584
Compare
@SmileyChris can this please be merged and released? It is blocking upgrade to Django 5.0 (I am testing RC1 now). Thank you. |
You can install my commit from the Git repo with this specification for Pip:
(or with the appropriate syntax for Poetry etc.) That’s what I’ve done for testing my client’s project on Django 5.0 RC1. |
Yes, that's what I'm doing ( |
@@ -36,10 +36,10 @@ deps = | |||
pyuca,legacy: pyuca | |||
legacy: Django==3.2.* | |||
previous: Django==4.0.* | |||
latest: Django==4.1.* | |||
latest: Django~=5.0b1 |
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.
I guess this could be updated. Then @SmileyChris, please push this or give someone the commit bit so the project is not blocked when you are out of time!
I did install from pip using the above command, but I still have the below issue in django 5. Am I missing something ? @adamchainz would you have any idea ? It seems we are quite a few to have this issue.
|
@@ -22,8 +23,12 @@ def choices(self, changelist): | |||
"display": _("All"), | |||
} | |||
for lookup, title in self.lookup_choices(changelist): | |||
if django.VERSION >= (5, 0): | |||
selected = force_str(lookup) in value |
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.
I had to change this line so it works when no country is selected in the CountryFilter list_filter
I'm using, otherwise it'll throw a TypeError exception that argument of type 'NoneType' is not iterable
selected = force_str(lookup) in value | |
selected = value and force_str(lookup) in value |
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.
@adamchainz any objection to this?
Any new on when this is going to be released? Django 5 it out for a while and after I tried to upgrade, my admin pages got broken. Here is a corresponding Django ticket: |
Any chance this could be released? It's blocking our upgrade to Django 5.0. |
It looks like @adamchainz' code works with Python < 3.10 perfectly. However, the code doesn't work with Python 3.12. If I understand correctly, the importlib.metadata API has been changed since Python 3.10. Other projects had the same issue, e.g. ewels/rich-click#140. I've modified Adam's code to make it work with Python 3.10 and above: JulianTenschert@f085ab1. This works well. |
@SmileyChris Whats needed to move forward with this? Thanks |
co-authored-by: Julian Tenschert <[email protected]>
I just squashed @JulianTenschert ’s commit into mine to make merging or installing from git easier. |
Thanks for your efforts, however I think the current situation is not sustainable in the longer term. If anyone has direct contacts with Chris personally or someone else at Lincoln Loop, it would be very nice to push a bit so as to unblock this package and put it in a co-maintainership situation (by Jazzband adoption or any other mean). |
Hey everyone, From my side, this PR takes priority and after I will look into updating the test matrix to test all currently supported django and python combination instead of only the latest. |
I did not combine the Django 4.2 PR into this one, but I did merge in the Python 3.12 fix. Thank you for taking over the project! |
Sorry I've been so absent! I finally got things polished up -- I had to fix transifex not pulling in changes due to their api changes, and some tox updates for 4 but it's done, and I pushed 7.6! |
One small follow-up fix is needed: #460 Without this check even a trivial use of
|
Builds on #424, which should be merged first. Add support for Django 5.0.