mitodl / ocw-studio

Open Source Courseware authoring tool
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

Django 4.2.11 / Python 3.12.2 upgrade #2141

Closed gumaerc closed 2 months ago

gumaerc commented 2 months ago

What are the relevant tickets?

Closes https://github.com/mitodl/ocw-studio/issues/2140

Description (What does it do?)

This PR upgrades Django to 4.2.11, along with some other dependencies that need to be upgraded to support it. Python was also upgraded to the latest supported version, 3.12.2.

How can this be tested?

Before getting started, you should rebuild your containers with docker-compose build --no-cache to be certain that you are working with containers built with the new versions of everything. Beyond that, the entire site should be smoke tested. This is a basic list I came up with, but anything else should be added here as necessary:

gumaerc commented 2 months ago

I dealt with all the deprecation warnings that could be solved and posted issues in libraries we use that have unfixed deprecations:

https://github.com/jaraco/cssutils/issues/49 https://github.com/makinacorpus/django-safedelete/issues/240

ibrahimjaved12 commented 2 months ago

There's one thing I wanted to mention. I was trying this tool django-upgrade on this branch and it ended up changing/reformatting 13 files when I gave it target of django 4.2: git ls-files -z -- '*.py' | xargs -0 django-upgrade --target-version 4.2

I analyzed those changes individually, and they were:

None of these earlier code chunks are depreciated or breaking, so it was safe to merge the PR. However, each of these is according to modern Django practices and yes we may want to reformat the code accordingly sometime soon or later.