Skip to content

Commit

Permalink
feat: upgrade from Python 3.8 to Python 3.11 (#189)
Browse files Browse the repository at this point in the history
This commits upgrades this repository to use Python 3.11 instead of Python 3.8.

This was motivated by Python 3.8's end-of-life in October of 2024.
  • Loading branch information
awais786 authored Sep 9, 2024
1 parent d0b4a9a commit 45422d1
Show file tree
Hide file tree
Showing 18 changed files with 135 additions and 265 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ["3.8"]
python-version: ["3.11"]
node-version: ["10"]
toxenv: [django42, quality, pii_check, rst_validation]

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ Change Log
Unreleased
~~~~~~~~~~

[2.4.0] - 2024-04-23
~~~~~~~~~~~~~~~~~~~~
* Added python3.11 support.


[2.3.6] - 2023-07-28
~~~~~~~~~~~~~~~~~~~~
* Upgrade django-simple-history. Added new migration. Fixed packages upgrade issues.
Expand Down
10 changes: 1 addition & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ $(COMMON_CONSTRAINTS_TXT):

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: $(COMMON_CONSTRAINTS_TXT)
sed 's/django-simple-history==3.0.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp
mv requirements/common_constraints.tmp requirements/common_constraints.txt
pip install -qr requirements/pip-tools.txt
# Make sure to compile files after any other files they include!
# need to do this to remove django-simple-history from common constraint.
Expand All @@ -53,16 +51,10 @@ upgrade: $(COMMON_CONSTRAINTS_TXT)
$(PIP_COMPILE) -o requirements/quality.txt requirements/quality.in
$(PIP_COMPILE) -o requirements/ci.txt requirements/ci.in
$(PIP_COMPILE) -o requirements/dev.txt requirements/dev.in
$(PIP_COMPILE) -o requirements/celery53.txt requirements/celery53.in
$(PIP_COMPILE) -o requirements/celery54.txt requirements/celery54.in
# Let tox control the Django version for tests
sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp
mv requirements/test.tmp requirements/test.txt
sed -i.tmp '/^amqp==/d' requirements/test.txt
sed -i.tmp '/^anyjson==/d' requirements/test.txt
sed -i.tmp '/^billiard==/d' requirements/test.txt
sed -i.tmp '/^celery==/d' requirements/test.txt
sed -i.tmp '/^kombu==/d' requirements/test.txt
sed -i.tmp '/^vine==/d' requirements/test.txt
rm requirements/*.txt.tmp

quality-python: ## Run python linters
Expand Down
2 changes: 1 addition & 1 deletion edx_name_affirmation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Django app housing name affirmation logic.
"""

__version__ = '2.3.7'
__version__ = '2.4.0'
44 changes: 16 additions & 28 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make upgrade
Expand All @@ -8,21 +8,15 @@ amqp==5.2.0
# via kombu
asgiref==3.8.1
# via django
backports-zoneinfo[tzdata]==0.2.1
# via
# celery
# django
# djangorestframework
# kombu
billiard==4.2.0
# via celery
celery==5.4.0
# via
# -c requirements/constraints.txt
# edx-celeryutils
certifi==2024.7.4
certifi==2024.8.30
# via requests
cffi==1.17.0
cffi==1.17.1
# via
# cryptography
# pynacl
Expand All @@ -44,15 +38,16 @@ click-repl==0.3.0
# via celery
code-annotations==1.8.0
# via edx-toggles
cryptography==43.0.0
cryptography==43.0.1
# via pyjwt
django==4.2.15
django==4.2.16
# via
# -c requirements/common_constraints.txt
# -r requirements/base.in
# django-config-models
# django-crum
# django-model-utils
# django-simple-history
# django-waffle
# djangorestframework
# drf-jwt
Expand All @@ -69,14 +64,12 @@ django-crum==0.7.9
# via
# edx-django-utils
# edx-toggles
django-model-utils==4.5.1
django-model-utils==5.0.0
# via
# -r requirements/base.in
# edx-celeryutils
django-simple-history==3.1.1
# via
# -c requirements/constraints.txt
# -r requirements/base.in
django-simple-history==3.7.0
# via -r requirements/base.in
django-waffle==4.1.0
# via
# edx-django-utils
Expand Down Expand Up @@ -106,13 +99,13 @@ edx-django-utils==5.15.0
# django-config-models
# edx-drf-extensions
# edx-toggles
edx-drf-extensions==10.3.0
edx-drf-extensions==10.4.0
# via -r requirements/base.in
edx-opaque-keys==2.10.0
edx-opaque-keys==2.11.0
# via edx-drf-extensions
edx-toggles==5.2.0
# via -r requirements/base.in
idna==3.7
idna==3.8
# via requests
inflection==0.5.1
# via drf-yasg
Expand All @@ -128,7 +121,7 @@ newrelic==9.13.0
# via edx-django-utils
packaging==24.1
# via drf-yasg
pbr==6.0.0
pbr==6.1.0
# via stevedore
prompt-toolkit==3.0.47
# via click-repl
Expand Down Expand Up @@ -162,22 +155,17 @@ six==1.16.0
# via python-dateutil
sqlparse==0.5.1
# via django
stevedore==5.2.0
stevedore==5.3.0
# via
# code-annotations
# edx-django-utils
# edx-opaque-keys
text-unidecode==1.3
# via python-slugify
typing-extensions==4.12.2
# via
# asgiref
# edx-opaque-keys
# kombu
# via edx-opaque-keys
tzdata==2024.1
# via
# backports-zoneinfo
# celery
# via celery
uritemplate==4.1.1
# via drf-yasg
urllib3==2.2.2
Expand Down
1 change: 0 additions & 1 deletion requirements/celery53.in

This file was deleted.

1 change: 1 addition & 0 deletions requirements/celery54.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
celery>=5.2.2,<5.5.0
14 changes: 3 additions & 11 deletions requirements/celery53.txt → requirements/celery54.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make upgrade
#
amqp==5.2.0
# via kombu
backports-zoneinfo[tzdata]==0.2.1
# via
# celery
# kombu
billiard==4.2.0
# via celery
celery==5.4.0
# via -r requirements/celery53.in
# via -r requirements/celery54.in
click==8.1.7
# via
# celery
Expand All @@ -34,12 +30,8 @@ python-dateutil==2.9.0.post0
# via celery
six==1.16.0
# via python-dateutil
typing-extensions==4.12.2
# via kombu
tzdata==2024.1
# via
# backports-zoneinfo
# celery
# via celery
vine==5.1.0
# via
# amqp
Expand Down
6 changes: 1 addition & 5 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make upgrade
Expand Down Expand Up @@ -30,10 +30,6 @@ pluggy==1.5.0
# via tox
pyproject-api==1.7.1
# via tox
tomli==2.0.1
# via
# pyproject-api
# tox
tox==4.18.0
# via -r requirements/ci.in
virtualenv==20.26.3
Expand Down
4 changes: 4 additions & 0 deletions requirements/common_constraints.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@





# A central location for most common version constraints
# (across edx repos) for pip-installation.
#
Expand Down
9 changes: 5 additions & 4 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
# Common constraints for edx repos
-c common_constraints.txt

# pinning celery to latest release
celery<6.0
# As it is not clarified what exact breaking changes will be introduced as per
# the next major release, ensure the installed version is within boundaries.
celery>=5.2.2,<6.0.0

# incremental upgrade plan.
django-simple-history<=3.1.1
# Temporary to Support the python 3.11 Upgrade
backports.zoneinfo;python_version<"3.9" # Newer versions have zoneinfo available in the standard library
Loading

0 comments on commit 45422d1

Please sign in to comment.