Skip to content

Commit

Permalink
feat!: upgrade to Django 4.2 (#372)
Browse files Browse the repository at this point in the history
* feat!: upgrade to Django 4.2

* fix: use local copy of common_constraints file

* chore: Updating Python Requirements

---------

Co-authored-by: Muhammad Soban Javed <[email protected]>
Co-authored-by: edX requirements bot <[email protected]>
  • Loading branch information
3 people authored Nov 20, 2023
1 parent 1326973 commit b0a4207
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 64 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@ jobs:
max-parallel: 4
matrix:
python-version: ['py38']
django-version: ['django32', 'django42']
db-version: ['mysql57', 'mysql80']
# excluding mysql5.7 with Django 4.2 since Django 4.2 has
# dropped support for MySQL<8
exclude:
- django-version: 'django42'
db-version: 'mysql57'
django-version: ['django42']
db-version: ['mysql80']

steps:
- uses: actions/checkout@v2
Expand Down
11 changes: 0 additions & 11 deletions .travis/docker-compose-travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
version: "2"

services:
mysql57:
image: mysql:5.7
container_name: mysql57
command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci
environment:
MYSQL_ROOT_PASSWORD: ""
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_USER: "notes001"
MYSQL_PASSWORD: "secret"
MYSQL_DATABASE: "edx_notes_api"
mysql80:
image: mysql:8.0
container_name: mysql80
Expand Down Expand Up @@ -49,7 +39,6 @@ services:
- ..:/edx/app/edx_notes_api/edx_notes_api
command: tail -f /dev/null
depends_on:
- "mysql57"
- "mysql80"
- "es"
environment:
Expand Down
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,26 @@ develop: requirements test.requirements
piptools: ## install pinned version of pip-compile and pip-sync
pip install -r 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 $(@)

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: piptools ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
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!
sed -i.'' 's/Django<4.0//g' requirements/common_constraints.txt
pip-compile --upgrade --rebuild --allow-unsafe -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 --upgrade -o requirements/base.txt requirements/base.in
pip-compile --upgrade -o requirements/test.txt requirements/test.in
pip-compile --upgrade -o requirements/travis.txt requirements/travis.in
# Let tox control the Django version for tests
grep -e "^django==" requirements/base.txt > requirements/django.txt
sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp
Expand Down
19 changes: 10 additions & 9 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#
asgiref==3.7.2
# via django
certifi==2023.7.22
backports-zoneinfo==0.2.1
# via django
certifi==2023.11.17
# via
# elasticsearch
# requests
Expand All @@ -18,11 +20,11 @@ chardet==3.0.4
# via requests
click==8.1.7
# via edx-django-utils
cryptography==41.0.4
cryptography==41.0.5
# via pyjwt
django==3.2.22
django==4.2.7
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/base.in
# django-cors-headers
# django-crum
Expand Down Expand Up @@ -66,7 +68,7 @@ drf-yasg==1.21.7
# via -r requirements/base.in
edx-django-release-util==1.3.0
# via -r requirements/base.in
edx-django-utils==5.7.0
edx-django-utils==5.8.0
# via
# -r requirements/base.in
# edx-drf-extensions
Expand All @@ -76,7 +78,7 @@ edx-opaque-keys==2.5.1
# via edx-drf-extensions
elasticsearch==7.13.4
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/base.in
# django-elasticsearch-dsl-drf
Expand All @@ -95,7 +97,7 @@ inflection==0.5.1
# via drf-yasg
mysqlclient==2.2.0
# via -r requirements/base.in
newrelic==9.1.2
newrelic==9.2.0
# via
# -r requirements/base.in
# edx-django-utils
Expand All @@ -108,7 +110,7 @@ path-py==9.1
# via
# -c requirements/constraints.txt
# -r requirements/base.in
pbr==5.11.1
pbr==6.0.0
# via stevedore
psutil==5.9.6
# via edx-django-utils
Expand All @@ -130,7 +132,6 @@ python-dateutil==2.4.0
# elasticsearch-dsl
pytz==2023.3.post1
# via
# django
# djangorestframework
# drf-yasg
pyyaml==6.0.1
Expand Down
5 changes: 4 additions & 1 deletion requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# linking to it here is good.

# This file contains all common constraints for edx-repos
-c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
-c common_constraints.txt

astroid==1.6.6
requests==2.25.0
Expand All @@ -21,3 +21,6 @@ python-dateutil==2.4.0
more-itertools==5.0.0
pylint==1.5.0
django-cors-headers==3.14.0

# Stay on LTS
Django<5.0
2 changes: 1 addition & 1 deletion requirements/django.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
django==3.2.22
django==4.2.7
2 changes: 1 addition & 1 deletion requirements/pip-tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tomli==2.0.1
# build
# pip-tools
# pyproject-hooks
wheel==0.41.2
wheel==0.41.3
# via pip-tools
zipp==3.17.0
# via importlib-metadata
Expand Down
4 changes: 2 additions & 2 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#
# make upgrade
#
wheel==0.41.2
wheel==0.41.3
# via -r requirements/pip.in

# The following packages are considered to be unsafe in a requirements file:
pip==23.3
pip==23.3.1
# via -r requirements/pip.in
setuptools==68.2.2
# via -r requirements/pip.in
39 changes: 21 additions & 18 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ astroid==1.6.6
# -c requirements/constraints.txt
# -r requirements/test.in
# pylint
certifi==2023.7.22
backports-zoneinfo==0.2.1
# via
# -r requirements/base.txt
# django
certifi==2023.11.17
# via
# -r requirements/base.txt
# elasticsearch
Expand Down Expand Up @@ -41,18 +45,18 @@ coverage[toml]==7.3.2
# via
# -r requirements/test.in
# pytest-cov
cryptography==41.0.4
cryptography==41.0.5
# via
# -r requirements/base.txt
# pyjwt
ddt==1.6.0
ddt==1.7.0
# via -r requirements/test.in
diff-cover==7.7.0
diff-cover==8.0.1
# via -r requirements/test.in
distlib==0.3.7
# via virtualenv
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/base.txt
# django-cors-headers
# django-crum
Expand Down Expand Up @@ -103,7 +107,7 @@ drf-yasg==1.21.7
# via -r requirements/base.txt
edx-django-release-util==1.3.0
# via -r requirements/base.txt
edx-django-utils==5.7.0
edx-django-utils==5.8.0
# via
# -r requirements/base.txt
# edx-drf-extensions
Expand All @@ -115,7 +119,7 @@ edx-opaque-keys==2.5.1
# edx-drf-extensions
elasticsearch==7.13.4
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/base.txt
# django-elasticsearch-dsl-drf
Expand All @@ -130,9 +134,9 @@ exceptiongroup==1.1.3
# via pytest
factory-boy==3.3.0
# via -r requirements/test.in
faker==19.11.0
faker==20.0.3
# via factory-boy
filelock==3.12.4
filelock==3.13.1
# via
# tox
# virtualenv
Expand Down Expand Up @@ -162,7 +166,7 @@ more-itertools==5.0.0
# -r requirements/test.in
mysqlclient==2.2.0
# via -r requirements/base.txt
newrelic==9.1.2
newrelic==9.2.0
# via
# -r requirements/base.txt
# edx-django-utils
Expand All @@ -178,15 +182,15 @@ path-py==9.1
# via
# -c requirements/constraints.txt
# -r requirements/base.txt
pbr==5.11.1
pbr==6.0.0
# via
# -r requirements/base.txt
# stevedore
pep8==1.7.1
# via -r requirements/test.in
platformdirs==3.11.0
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/common_constraints.txt
# virtualenv
pluggy==1.3.0
# via
Expand All @@ -203,7 +207,7 @@ pycparser==2.21
# via
# -r requirements/base.txt
# cffi
pygments==2.16.1
pygments==2.17.1
# via diff-cover
pyjwt[crypto]==2.8.0
# via
Expand All @@ -223,14 +227,14 @@ pynacl==1.5.0
# via
# -r requirements/base.txt
# edx-django-utils
pytest==7.4.2
pytest==7.4.3
# via
# -r requirements/test.in
# pytest-cov
# pytest-django
pytest-cov==4.1.0
# via -r requirements/test.in
pytest-django==4.5.2
pytest-django==4.7.0
# via -r requirements/test.in
python-dateutil==2.4.0
# via
Expand All @@ -243,7 +247,6 @@ python-slugify==8.0.1
pytz==2023.3.post1
# via
# -r requirements/base.txt
# django
# djangorestframework
# drf-yasg
pyyaml==6.0.1
Expand Down Expand Up @@ -307,7 +310,7 @@ urllib3==1.26.18
# -r requirements/base.txt
# elasticsearch
# requests
virtualenv==20.24.5
virtualenv==20.24.6
# via tox
wrapt==1.15.0
wrapt==1.16.0
# via astroid
31 changes: 20 additions & 11 deletions requirements/travis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,36 @@
#
# make upgrade
#
cachetools==5.3.2
# via tox
chardet==5.2.0
# via tox
colorama==0.4.6
# via tox
distlib==0.3.7
# via virtualenv
filelock==3.12.4
filelock==3.13.1
# via
# tox
# virtualenv
packaging==23.2
# via tox
# via
# pyproject-api
# tox
platformdirs==3.11.0
# via virtualenv
# via
# -c requirements/common_constraints.txt
# tox
# virtualenv
pluggy==1.3.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 https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/travis.in
virtualenv==20.24.5
# pyproject-api
# tox
tox==4.11.3
# via -r requirements/travis.in
virtualenv==20.24.6
# via tox
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[tox]
envlist = py38-django{32, 42}
envlist = py38-django{42}
skipsdist = true

[testenv]
deps =
django32: Django>=3.2,<4.0
django42: Django>=4.2,<4.3
-r {toxinidir}/requirements/test.txt
passenv =
Expand Down

0 comments on commit b0a4207

Please sign in to comment.