Skip to content

Commit

Permalink
fix: add support for python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
irtazaakram committed Apr 8, 2024
1 parent 381477b commit 21c6f1f
Show file tree
Hide file tree
Showing 14 changed files with 407 additions and 145 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04]
python-version: ['3.8', '3.12']
python-version: ['3.8', '3.11', '3.12']
toxenv: [quality, django42-drf314, django42-drflatest]

steps:
Expand Down
28 changes: 17 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,28 @@ docs: ## generate Sphinx HTML documentation, including API docs
tox -e docs
$(BROWSER) docs/_build/html/index.html

COMMON_CONSTRAINTS_TXT=requirements/common_constraints.txt
.PHONY: $(COMMON_CONSTRAINTS_TXT)
$(COMMON_CONSTRAINTS_TXT):
wget -O "$(@)" https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt || touch "$(@)"

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
upgrade: $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
pip install -qr requirements/pip-tools.txt
pip-compile --rebuild --upgrade --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in
pip-compile --rebuild --upgrade -o requirements/pip-tools.txt requirements/pip-tools.in
# Make sure to compile files after any other files they include!
pip-compile --upgrade --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in
pip-compile --upgrade -o requirements/pip-tools.txt requirements/pip-tools.in
pip install -qr requirements/pip.txt
pip install -qr requirements/pip-tools.txt
pip-compile --rebuild --upgrade -o requirements/dev.txt requirements/dev.in
pip-compile --rebuild --upgrade -o requirements/doc.txt requirements/doc.in
pip-compile --rebuild --upgrade -o requirements/quality.txt requirements/quality.in
pip-compile --rebuild --upgrade -o requirements/test.txt requirements/test.in
pip-compile --rebuild --upgrade -o requirements/ci.txt requirements/ci.in
pip-compile --upgrade --allow-unsafe -o requirements/base.txt requirements/base.in
pip-compile --upgrade -o requirements/test.txt requirements/test.in
pip-compile --upgrade -o requirements/doc.txt requirements/doc.in
pip-compile --upgrade --allow-unsafe -o requirements/quality.txt requirements/quality.in
pip-compile --upgrade -o requirements/ci.txt requirements/ci.in
pip-compile --upgrade -o requirements/dev.txt requirements/dev.in
# Let tox control the Django version for tests
sed -i.tmp '/^[d|D]jango==/d' requirements/test.txt
sed -i.tmp '/^djangorestframework==/d' requirements/test.txt
rm requirements/test.txt.tmp
sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp
mv requirements/test.tmp requirements/test.txt

quality: ## check coding style with pycodestyle and pylint
tox -e quality
Expand Down
1 change: 1 addition & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ edx-toggles>=1.2.0
pytz
XBlock>=1.2.2
event-tracking
setuptools
208 changes: 208 additions & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# make upgrade
#
amqp==5.2.0
# via kombu
appdirs==1.4.4
# via fs
asgiref==3.8.1
# via django
attrs==23.2.0
# via openedx-events
backports-zoneinfo[tzdata]==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# celery
# django
# djangorestframework
# kombu
billiard==4.2.0
# via celery
celery==5.3.6
# via event-tracking
certifi==2024.2.2
# via requests
cffi==1.16.0
# via
# cryptography
# pynacl
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via
# celery
# click-didyoumean
# click-plugins
# click-repl
# code-annotations
# edx-django-utils
click-didyoumean==0.3.1
# via celery
click-plugins==1.1.1
# via celery
click-repl==0.3.0
# via celery
code-annotations==1.8.0
# via edx-toggles
cryptography==42.0.5
# via pyjwt
django==4.2.11
# via
# -c requirements/common_constraints.txt
# -r requirements/base.in
# django-crum
# django-model-utils
# django-waffle
# djangorestframework
# drf-jwt
# edx-django-utils
# edx-drf-extensions
# edx-toggles
# event-tracking
# openedx-events
django-crum==0.7.9
# via
# edx-django-utils
# edx-toggles
django-model-utils==4.5.0
# via -r requirements/base.in
django-waffle==4.1.0
# via
# edx-django-utils
# edx-drf-extensions
# edx-toggles
djangorestframework==3.15.1
# via
# -r requirements/base.in
# drf-jwt
# edx-drf-extensions
drf-jwt==1.19.2
# via edx-drf-extensions
edx-django-utils==5.12.0
# via
# edx-drf-extensions
# edx-toggles
# event-tracking
# openedx-events
edx-drf-extensions==10.3.0
# via -r requirements/base.in
edx-opaque-keys[django]==2.5.1
# via
# -r requirements/base.in
# edx-drf-extensions
# openedx-events
edx-toggles==5.2.0
# via
# -r requirements/base.in
# event-tracking
event-tracking==2.3.2
# via -r requirements/base.in
fastavro==1.9.4
# via openedx-events
fs==2.4.16
# via xblock
idna==3.6
# via requests
jinja2==3.1.3
# via code-annotations
kombu==5.3.6
# via celery
lxml==5.2.1
# via xblock
mako==1.3.2
# via xblock
markupsafe==2.1.5
# via
# jinja2
# mako
# xblock
newrelic==9.8.0
# via edx-django-utils
openedx-events==9.7.0
# via event-tracking
pbr==6.0.0
# via stevedore
prompt-toolkit==3.0.43
# via click-repl
psutil==5.9.8
# via edx-django-utils
pycparser==2.22
# via cffi
pyjwt[crypto]==2.8.0
# via
# drf-jwt
# edx-drf-extensions
pymongo==3.13.0
# via
# edx-opaque-keys
# event-tracking
pynacl==1.5.0
# via edx-django-utils
python-dateutil==2.9.0.post0
# via
# celery
# xblock
python-slugify==8.0.4
# via code-annotations
pytz==2024.1
# via
# -r requirements/base.in
# event-tracking
# xblock
pyyaml==6.0.1
# via
# code-annotations
# xblock
requests==2.31.0
# via edx-drf-extensions
semantic-version==2.10.0
# via edx-drf-extensions
simplejson==3.19.2
# via xblock
six==1.16.0
# via
# event-tracking
# fs
# python-dateutil
sqlparse==0.4.4
# via django
stevedore==5.2.0
# via
# code-annotations
# edx-django-utils
# edx-opaque-keys
text-unidecode==1.3
# via python-slugify
typing-extensions==4.11.0
# via
# asgiref
# edx-opaque-keys
# kombu
tzdata==2024.1
# via
# backports-zoneinfo
# celery
urllib3==2.2.1
# via requests
vine==5.1.0
# via
# amqp
# celery
# kombu
wcwidth==0.2.13
# via prompt-toolkit
web-fragments==2.2.0
# via xblock
webob==1.8.7
# via xblock
xblock==3.1.0
# via -r requirements/base.in

# The following packages are considered to be unsafe in a requirements file:
setuptools==69.2.0
# via
# -r requirements/base.in
# fs
26 changes: 17 additions & 9 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
#
# make upgrade
#
cachetools==5.3.3
# via tox
chardet==5.2.0
# via tox
colorama==0.4.6
# via tox
distlib==0.3.8
# via virtualenv
filelock==3.13.3
Expand All @@ -13,20 +19,22 @@ filelock==3.13.3
mock==5.1.0
# via -r requirements/ci.in
packaging==24.0
# via tox
# via
# pyproject-api
# tox
platformdirs==4.2.0
# via virtualenv
# via
# tox
# virtualenv
pluggy==1.4.0
# via tox
py==1.11.0
# via tox
six==1.16.0
pyproject-api==1.6.1
# via tox
tomli==2.0.1
# via tox
tox==3.28.0
# via
# -c requirements/constraints.txt
# -r requirements/ci.in
# pyproject-api
# tox
tox==4.14.2
# via -r requirements/ci.in
virtualenv==20.25.1
# via tox
32 changes: 32 additions & 0 deletions requirements/common_constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# A central location for most common version constraints
# (across edx repos) for pip-installation.
#
# Similar to other constraint files this file doesn't install any packages.
# It specifies version constraints that will be applied if a package is needed.
# When pinning something here, please provide an explanation of why it is a good
# idea to pin this package across all edx repos, Ideally, link to other information
# that will help people in the future to remove the pin when possible.
# Writing an issue against the offending project and linking to it here is good.
#
# Note: Changes to this file will automatically be used by other repos, referencing
# this file from Github directly. It does not require packaging in edx-lint.


# using LTS django version
Django<5.0

# elasticsearch>=7.14.0 includes breaking changes in it which caused issues in discovery upgrade process.
# elastic search changelog: https://www.elastic.co/guide/en/enterprise-search/master/release-notes-7.14.0.html
elasticsearch<7.14.0

# django-simple-history>3.0.0 adds indexing and causes a lot of migrations to be affected
django-simple-history==3.0.0

# opentelemetry requires version 6.x at the moment:
# https://github.com/open-telemetry/opentelemetry-python/issues/3570
# Normally this could be added as a constraint in edx-django-utils, where we're
# adding the opentelemetry dependency. However, when we compile pip-tools.txt,
# that uses version 7.x, and then there's no undoing that when compiling base.txt.
# So we need to pin it globally, for now.
# Ticket for unpinning: https://github.com/openedx/edx-lint/issues/407
importlib-metadata<7
9 changes: 4 additions & 5 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Version constraints for pip installation.
# Version constraints for pip-installation.
#
# This file doesn't install any packages. It specifies version constraints
# that will be applied if a package is needed.
Expand All @@ -8,8 +8,7 @@
# pin when possible. Writing an issue against the offending project and
# linking to it here is good.

Django < 3.3
-c common_constraints.txt

# tox >= 4.0.0 is a complete rewrite of the tox package. It is not a
# simple upgrade. I've pinned the version to allow us to time to prioritize this upgrade.
tox < 4.0.0
# 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 21c6f1f

Please sign in to comment.