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 committed Nov 28, 2023
1 parent 25cc742 commit bb0cd7d
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 93 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,16 +65,27 @@ 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 -o requirements/travis.txt requirements/travis.in
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 -i '/^[dD]jango==/d' requirements/test.txt
25 changes: 10 additions & 15 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#
asgiref==3.6.0
# via django
certifi==2022.12.7
backports-zoneinfo==0.2.1
# via django
certifi==2023.11.17
# via
# elasticsearch
# requests
Expand All @@ -18,17 +20,11 @@ chardet==3.0.4
# via requests
click==8.1.3
# via edx-django-utils
coreapi==2.3.3
# via drf-yasg
coreschema==0.0.4
# via
# coreapi
# drf-yasg
cryptography==40.0.1
cryptography==41.0.4
# via pyjwt
django==3.2.20
django==3.2.22
# 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 @@ -69,7 +65,7 @@ drf-yasg==1.21.5
# via -r requirements/base.in
edx-django-release-util==1.2.0
# via -r requirements/base.in
edx-django-utils==5.3.0
edx-django-utils==5.7.0
# via
# -r requirements/base.in
# edx-drf-extensions
Expand All @@ -79,7 +75,7 @@ edx-opaque-keys==2.3.0
# 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 @@ -106,7 +102,7 @@ markupsafe==2.1.2
# via jinja2
mysqlclient==2.1.1
# via -r requirements/base.in
newrelic==9.1.2
newrelic==9.2.0
# via
# -r requirements/base.in
# edx-django-utils
Expand All @@ -118,7 +114,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.4
# via edx-django-utils
Expand All @@ -145,7 +141,6 @@ python-dateutil==2.4.0
# elasticsearch-dsl
pytz==2023.3
# via
# django
# djangorestframework
# drf-yasg
pyyaml==6.0
Expand Down
6 changes: 5 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 @@ -20,3 +20,7 @@ path.py==9.1
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.20
django==4.2.7
7 changes: 5 additions & 2 deletions requirements/pip-tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ pip-tools==6.12.3
pyproject-hooks==1.0.0
# via build
tomli==2.0.1
# via build
wheel==0.40.0
# via
# build
# pip-tools
# pyproject-hooks
wheel==0.41.3
# via pip-tools

# The following packages are considered to be unsafe in a requirements file:
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.40.0
wheel==0.41.3
# via -r requirements/pip.in

# The following packages are considered to be unsafe in a requirements file:
pip==23.0.1
pip==23.3.1
# via -r requirements/pip.in
setuptools==67.6.1
# via -r requirements/pip.in
51 changes: 25 additions & 26 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ astroid==1.6.6
# -c requirements/constraints.txt
# -r requirements/test.in
# pylint
attrs==22.2.0
# via pytest
certifi==2022.12.7
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 @@ -52,18 +54,18 @@ coverage[toml]==7.2.2
# via
# -r requirements/test.in
# pytest-cov
cryptography==40.0.1
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.5.0
diff-cover==8.0.1
# via -r requirements/test.in
distlib==0.3.6
# 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 @@ -111,7 +113,7 @@ drf-yasg==1.21.5
# via -r requirements/base.txt
edx-django-release-util==1.2.0
# via -r requirements/base.txt
edx-django-utils==5.3.0
edx-django-utils==5.8.0
# via
# -r requirements/base.txt
# edx-drf-extensions
Expand All @@ -123,7 +125,7 @@ edx-opaque-keys==2.3.0
# 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 @@ -138,9 +140,9 @@ exceptiongroup==1.1.1
# via pytest
factory-boy==3.2.1
# via -r requirements/test.in
faker==18.3.1
faker==20.0.3
# via factory-boy
filelock==3.10.7
filelock==3.13.1
# via
# tox
# virtualenv
Expand Down Expand Up @@ -182,7 +184,7 @@ more-itertools==5.0.0
# -r requirements/test.in
mysqlclient==2.1.1
# via -r requirements/base.txt
newrelic==9.1.2
newrelic==9.2.0
# via
# -r requirements/base.txt
# edx-django-utils
Expand All @@ -197,15 +199,17 @@ 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.2.0
# via virtualenv
pluggy==1.0.0
platformdirs==3.11.0
# via
# -c requirements/common_constraints.txt
# virtualenv
pluggy==1.3.0
# via
# diff-cover
# pytest
Expand All @@ -220,11 +224,7 @@ pycparser==2.21
# via
# -r requirements/base.txt
# cffi
pycryptodomex==3.17
# via
# -r requirements/base.txt
# pyjwkest
pygments==2.14.0
pygments==2.17.1
# via diff-cover
pyjwkest==1.4.2
# via
Expand All @@ -247,14 +247,14 @@ pynacl==1.5.0
# via
# -r requirements/base.txt
# edx-django-utils
pytest==7.2.2
pytest==7.4.3
# via
# -r requirements/test.in
# pytest-cov
# pytest-django
pytest-cov==4.0.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 @@ -268,7 +268,6 @@ python-slugify==8.0.1
pytz==2023.3
# via
# -r requirements/base.txt
# django
# djangorestframework
# drf-yasg
pyyaml==6.0
Expand Down Expand Up @@ -340,9 +339,9 @@ urllib3==1.26.15
# -r requirements/base.txt
# elasticsearch
# requests
virtualenv==20.21.0
virtualenv==20.24.6
# via tox
wrapt==1.15.0
wrapt==1.16.0
# via astroid

# The following packages are considered to be unsafe in a requirements file:
Expand Down
31 changes: 6 additions & 25 deletions requirements/travis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,25 @@
#
# make upgrade
#
certifi==2022.12.7
# via requests
chardet==3.0.4
# via requests
coverage==7.2.2
# via codecov
distlib==0.3.6
distlib==0.3.7
# via virtualenv
filelock==3.10.7
filelock==3.12.4
# via
# tox
# virtualenv
idna==2.10
# via requests
packaging==23.0
packaging==23.2
# via tox
platformdirs==3.2.0
platformdirs==3.11.0
# via virtualenv
pluggy==1.0.0
pluggy==1.3.0
# via tox
py==1.11.0
# via tox
requests==2.25.0
# via
# -c requirements/constraints.txt
# codecov
six==1.16.0
# 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
# tox-battery
tox-battery==0.6.1
# via -r requirements/travis.in
urllib3==1.26.15
# via requests
virtualenv==20.21.0
virtualenv==20.24.5
# via tox
Loading

0 comments on commit bb0cd7d

Please sign in to comment.