Python 3.11/3.12 Major Changes
This list is currently in draft, if you find any change causing issues and that isn’t listed here so kindly add to the list.
Example Pull Request: feat: add python312 support and drop Django 3.2 support by edx-requirements-bot · Pull Request #390 · openedx/edx-django-utils
Potential Steps to perform on a repo:
Run both
python312_tox_modernizerandpython312_gh_actions_modernizerscripts from theedx-repo-toolspackage if not done already.You can also manually remove toxenv related to
django32and adddjango42Add
python312in thepython-versionmatrix value in CI
Run
make upgradewithPython 3.12virtualenv to update dependencies forPython 3.12If needed, include
setuptoolsandwheelintox.iniconfig sections.
List all those major changes that can impact us while upgrading our services and packages.
[Python 3.12]
setuptoolsisn't now pre-installed in Python 3.12 virtual environments, instead it should now be installed throughpipexplicitly.Include
setuptoolsin tox config sections wherever neededYou may need to add
wheelin tox config fordocschecks to work as well ifpython setup.py sdist bdist_wheelcommand fails withPython 3.12.
[Python 3.12]
pact-pythonPython 3.12 update needs
pact-python>2.1.1which will have the support of Python 3.12. The package owner has planned to release new version within the current week which will unblock this PR. For details, see the package author's comment pact-foundation/pact-python#422 (comment).
[Python 3.12]
pyresttestpyresttestdoesn’t havePython 3.12support and it has not been updated in last 8 years.Need to find any fork or alternative of this package to upgrade
api-manager.
[Python 3.12 + Django 4.2]
backports.zoneinfoWe haven’t migrated from
pytztozoneinfoyet so the repos, where Django 4.2 by default importbackports.zoneinfoas a dependency fail tests setup withPython 3.12.To fix this issue, we need to add following pin in
requirements/base.inand runmake upgradeagain.backports.zoneinfo;python_version<"3.9" # Can be removed once we upgrade to use zoneinfo
[Python 3.11 & Python 3.12]
Celery>=5.0Celery>=5.0is needed for the support of bothPython 3.11andPython 3.12.Right now,
edx-platformhas already been updated but some other IDAs needs to be updated first including Registrar and Ecommerce to enablePython 3.12support.