Skip to content

Commit

Permalink
feat: Adding python 3.11, 3.12 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
edx-requirements-bot authored and feanil committed Apr 5, 2024
1 parent fd382a1 commit 6030a7b
Show file tree
Hide file tree
Showing 14 changed files with 218 additions and 124 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [quality, django32, django42]
python-version:
- '3.8'
- '3.11'
- '3.12'
toxenv: [quality, django42]
steps:
- uses: actions/checkout@v4
- name: setup python
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Unreleased
----------
* Nothing

[5.7.0]
--------
feat: Adding python 3.11 and 3.12 support. Dropped django32 support.

[5.6.0]
--------
chore: Update Requirements
Expand Down
43 changes: 29 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,38 @@ requirements: ## install development environment requirements
test:
tox

# Define PIP_COMPILE_OPTS=-v to get more information during make upgrade.
PIP_COMPILE = pip-compile --upgrade $(PIP_COMPILE_OPTS)
piptools:
pip install -q -r requirements/pip-tools.txt

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
pip install -qr requirements/pip-tools.txt
define COMMON_CONSTRAINTS_TEMP_COMMENT
# This is a temporary solution to override the real common_constraints.txt\n# In edx-lint, until the pyjwt constraint in edx-lint has been removed.\n# See BOM-2721 for more details.\n# Below is the copied and edited version of common_constraints\n
endef

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 "$(@)"
echo "$(COMMON_CONSTRAINTS_TEMP_COMMENT)" | cat - $(@) > temp && mv temp $(@)

export CUSTOM_COMPILE_COMMAND = make upgrade
upgrade: piptools $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
# Make sure to compile files after any other files they include!
$(PIP_COMPILE) --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in
$(PIP_COMPILE) -o requirements/pip-tools.txt requirements/pip-tools.in
sed '/^importlib-metadata</d' requirements/common_constraints.txt > requirements/common_constraints.tmp
mv requirements/common_constraints.tmp requirements/common_constraints.txt
pip-compile --upgrade --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in
pip-compile --upgrade --allow-unsafe --verbose --rebuild -o requirements/pip-tools.txt requirements/pip-tools.in
pip install -qr requirements/pip.txt
pip install -qr requirements/pip-tools.txt
$(PIP_COMPILE) -o requirements/base.txt requirements/base.in
$(PIP_COMPILE) -o requirements/test.txt requirements/test.in
$(PIP_COMPILE) -o requirements/ci.txt requirements/ci.in
$(PIP_COMPILE) -o requirements/dev.txt requirements/dev.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 's/Django<4.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp
mv requirements/common_constraints.tmp requirements/common_constraints.txt
pip-compile --upgrade --allow-unsafe --verbose --rebuild -o requirements/base.txt requirements/base.in
pip-compile --upgrade --allow-unsafe --verbose --rebuild -o requirements/dev.txt requirements/dev.in
pip-compile --upgrade --allow-unsafe --verbose --rebuild -o requirements/test.txt requirements/test.in
pip-compile --upgrade --allow-unsafe --verbose --rebuild -o requirements/pip-tools.txt requirements/pip-tools.in
pip-compile --upgrade --allow-unsafe --verbose --rebuild -o requirements/ci.txt requirements/ci.in
# Let tox control the Django and DRF versions for tests
sed -i.tmp '/^django==/d' requirements/test.txt
sed -i.tmp '/^djangorestframework==/d' requirements/test.txt
rm requirements/test.txt.tmp

validate: test quality
2 changes: 1 addition & 1 deletion edx_rest_api_client/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '5.6.1'
__version__ = '5.7.0'
23 changes: 14 additions & 9 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
#
# make upgrade
#
asgiref==3.7.2
asgiref==3.8.1
# via django
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# django
certifi==2024.2.2
# via requests
cffi==1.16.0
Expand All @@ -14,40 +18,41 @@ charset-normalizer==3.3.2
# via requests
click==8.1.7
# via edx-django-utils
django==3.2.24
django==4.2.11
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/common_constraints.txt
# django-crum
# django-waffle
# edx-django-utils
django-crum==0.7.9
# via edx-django-utils
django-waffle==4.1.0
# via edx-django-utils
edx-django-utils==5.10.1
edx-django-utils==5.12.0
# via -r requirements/base.in
idna==3.6
# via requests
newrelic==9.7.0
newrelic==9.8.0
# via edx-django-utils
pbr==6.0.0
# via stevedore
psutil==5.9.8
# via edx-django-utils
pycparser==2.21
pycparser==2.22
# via cffi
pyjwt==2.8.0
# via -r requirements/base.in
pynacl==1.5.0
# via edx-django-utils
pytz==2024.1
# via django
requests==2.31.0
# via
# -c requirements/constraints.txt
# -r requirements/base.in
# slumber
slumber==0.7.1
# via -r requirements/base.in
# via
# -c requirements/constraints.txt
# -r requirements/base.in
sqlparse==0.4.4
# via django
stevedore==5.2.0
Expand Down
5 changes: 3 additions & 2 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ colorama==0.4.6
# via tox
distlib==0.3.8
# via virtualenv
filelock==3.13.1
filelock==3.13.3
# via
# tox
# virtualenv
packaging==23.2
# via
# -c requirements/constraints.txt
# pyproject-api
# tox
platformdirs==4.2.0
Expand All @@ -32,7 +33,7 @@ tomli==2.0.1
# via
# pyproject-api
# tox
tox==4.13.0
tox==4.14.2
# via -r requirements/ci.in
virtualenv==20.25.1
# via tox
36 changes: 36 additions & 0 deletions requirements/common_constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This is a temporary solution to override the real common_constraints.txt
# In edx-lint, until the pyjwt constraint in edx-lint has been removed.
# See BOM-2721 for more details.
# Below is the copied and edited version of common_constraints

# 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
12 changes: 10 additions & 2 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,13 @@
# linking to it here is good.

# Common constraints for edx repos
-c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt

-c common_constraints.txt

backports.zoneinfo;python_version<"3.9"

# Temporary pins to avoid conflicts
packaging==23.2
requests==2.31.0
slumber==0.7.1
twine==5.0.0
zipp==3.17.0
Loading

0 comments on commit 6030a7b

Please sign in to comment.