-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Upgrade to Django 5.x #12104
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
Upgrade to Django 5.x #12104
Conversation
Initial steps to upgrade our codebase to Django 5.x
…mitos/upgrade-django-5.2
It seems we are blocked on |
…mitos/upgrade-django-5.2
Django, django-celery-beat, django-storages, django-safemigrate.
039c85b
to
4273e83
Compare
All the tests are passing and the QA that I did locally worked fine. I'm not sure why the CI checks is failing since I ran pre-commit locally and there is no modifications at all 🤷🏼 |
# TODO: something changed in Django 5.2 that I need to comment this index together here. | ||
# We need to research a little more. | ||
# | ||
# ValueError: Found wrong number (0) of constraints for builds_build(date, id) | ||
# | ||
# migrations.AlterIndexTogether( | ||
# name="build", | ||
# index_together={("date", "id"), ("version", "state", "type")}, | ||
# ), |
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'm not sure if we need to do something else with this, but I don't think so since these are old migrations.
# TODO: something changed in Django 5.2 that I need to comment this index together here. | ||
# We need to research a little more. | ||
# | ||
# ValueError: Found wrong number (0) of constraints for builds_build(date, id) | ||
# | ||
# ("date", "id"), |
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.
Same here. I had to delete this chunk of code to be able to run the tests. I don't think this will have any impact, tho.
I reverted that file to what it was before to avoid this issue for now. |
This is weird. Removing the migration file makes the migrations to work. However, checks complains about renaming an unnamed index.
|
I think I was able to make it work... Let see if all the tests pass now. |
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 good, but we should definitely test more on .com, there we have a couple of deps that are not actively maintained, and may not be compatible with django 5.2..
I opened https://github.com/readthedocs/readthedocs-corporate/pull/1979 with the changes required. I'm going merge this one so we can start test it locally. Remember to rebuild the Docker images. |
Upgrade our code base to Django 5.2
django-safemigrate
had to be upgraded: you will find a lot of changes likeSafe.before_deploy
->Safe.before_deploy()
(all of them are in this particular commit: 4273e83)django.core.files.storage.get_storage_class
because it was deleted from Django 5.2assertFormError
tests were updated to match the new signaturedjango-celery-beat
anddjango-storages
were upgradedCloses #12079
Closes #11505