Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "feat!: upgrade to Django 4.2 LTS" #363

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,20 @@ jobs:
max-parallel: 4
matrix:
python-version: ['py38']
django-version: ['django42']
db-version: ['mysql80']
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'

steps:
- uses: actions/checkout@v2
- name: Start container
run: |
docker-compose -f .travis/docker-compose-travis.yml up -d
- name: Install system packages
- name: Install Dependencies
run: |
docker exec -e TOXENV=${{ matrix.python-version }}-${{ matrix.django-version }} --env DB_HOST=${{ matrix.db-version }} -u root edx_notes_api \
/bin/bash -c "apt-get update && apt-get install python3-dev default-libmysqlclient-dev build-essential pkg-config"
Expand Down
11 changes: 11 additions & 0 deletions .travis/docker-compose-travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
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 @@ -39,6 +49,7 @@ services:
- ..:/edx/app/edx_notes_api/edx_notes_api
command: tail -f /dev/null
depends_on:
- "mysql57"
- "mysql80"
- "es"
environment:
Expand Down
20 changes: 4 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,9 @@ 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 $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
# 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-271 for more details.
sed -i.'' 's/Django<4.0//g' requirements/common_constraints.txt
upgrade: piptools ## 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 --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
Expand All @@ -90,4 +76,6 @@ upgrade: piptools $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt fi
pip-compile --upgrade -o requirements/test.txt requirements/test.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
sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp
mv requirements/test.tmp requirements/test.txt

17 changes: 9 additions & 8 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#
asgiref==3.7.2
# via django
backports-zoneinfo==0.2.1
# via django
certifi==2023.7.22
# via
# elasticsearch
Expand All @@ -20,11 +18,11 @@ chardet==3.0.4
# via requests
click==8.1.7
# via edx-django-utils
cryptography==41.0.5
cryptography==41.0.4
# via pyjwt
django==4.2.6
django==3.2.22
# via
# -c requirements/constraints.txt
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.in
# django-cors-headers
# django-crum
Expand All @@ -36,8 +34,10 @@ django==4.2.6
# edx-django-release-util
# edx-django-utils
# edx-drf-extensions
django-cors-headers==4.3.0
# via -r requirements/base.in
django-cors-headers==3.14.0
# via
# -c requirements/constraints.txt
# -r requirements/base.in
django-crum==0.7.9
# via edx-django-utils
django-elasticsearch-dsl==7.4
Expand Down Expand Up @@ -76,7 +76,7 @@ edx-opaque-keys==2.5.1
# via edx-drf-extensions
elasticsearch==7.13.4
# via
# -c requirements/common_constraints.txt
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/base.in
# django-elasticsearch-dsl-drf
Expand Down Expand Up @@ -131,6 +131,7 @@ python-dateutil==2.4.0
# elasticsearch-dsl
pytz==2023.3.post1
# via
# django
# djangorestframework
# drf-yasg
pyyaml==6.0.1
Expand Down
32 changes: 0 additions & 32 deletions requirements/common_constraints.txt

This file was deleted.

11 changes: 4 additions & 7 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,11 +8,8 @@
# pin when possible. Writing an issue against the offending project and
# linking to it here is good.

-c common_constraints.txt

# Keeping Django to latest Django 4.2 LTS
# This constraint can be removed once the global constraint has been updated
Django<4.3
# This file contains all common constraints for edx-repos
-c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt

astroid==1.6.6
requests==2.25.0
Expand All @@ -24,4 +21,4 @@ python-dateutil==2.4.0
newrelic==4.8.0.110
more-itertools==5.0.0
pylint==1.5.0

django-cors-headers==3.14.0
2 changes: 1 addition & 1 deletion requirements/django.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
django==4.2.6
django==3.2.22
2 changes: 1 addition & 1 deletion requirements/pip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ wheel==0.41.2
# via -r requirements/pip.in

# The following packages are considered to be unsafe in a requirements file:
pip==23.3.1
pip==23.3
# via -r requirements/pip.in
setuptools==68.2.2
# via -r requirements/pip.in
25 changes: 12 additions & 13 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ astroid==1.6.6
# -c requirements/constraints.txt
# -r requirements/test.in
# pylint
backports-zoneinfo==0.2.1
# via
# -r requirements/base.txt
# django
certifi==2023.7.22
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -45,7 +41,7 @@ coverage[toml]==7.3.2
# via
# -r requirements/test.in
# pytest-cov
cryptography==41.0.5
cryptography==41.0.4
# via
# -r requirements/base.txt
# pyjwt
Expand All @@ -56,7 +52,7 @@ diff-cover==7.7.0
distlib==0.3.7
# via virtualenv
# via
# -c requirements/constraints.txt
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.txt
# django-cors-headers
# django-crum
Expand All @@ -68,8 +64,10 @@ distlib==0.3.7
# edx-django-release-util
# edx-django-utils
# edx-drf-extensions
django-cors-headers==4.3.0
# via -r requirements/base.txt
django-cors-headers==3.14.0
# via
# -c requirements/constraints.txt
# -r requirements/base.txt
django-crum==0.7.9
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -117,7 +115,7 @@ edx-opaque-keys==2.5.1
# edx-drf-extensions
elasticsearch==7.13.4
# via
# -c requirements/common_constraints.txt
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/base.txt
# django-elasticsearch-dsl-drf
Expand All @@ -132,7 +130,7 @@ exceptiongroup==1.1.3
# via pytest
factory-boy==3.3.0
# via -r requirements/test.in
faker==19.12.0
faker==19.11.0
# via factory-boy
filelock==3.12.4
# via
Expand Down Expand Up @@ -224,7 +222,7 @@ pynacl==1.5.0
# via
# -r requirements/base.txt
# edx-django-utils
pytest==7.4.3
pytest==7.4.2
# via
# -r requirements/test.in
# pytest-cov
Expand All @@ -244,6 +242,7 @@ 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 @@ -292,7 +291,7 @@ tomli==2.0.1
# tox
tox==3.28.0
# via
# -c requirements/common_constraints.txt
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/test.in
typing-extensions==4.8.0
# via
Expand All @@ -309,7 +308,7 @@ urllib3==1.26.18
# -r requirements/base.txt
# elasticsearch
# requests
virtualenv==20.24.6
virtualenv==20.24.5
# via tox
wrapt==1.15.0
# via astroid
4 changes: 2 additions & 2 deletions requirements/travis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ tomli==2.0.1
# via tox
tox==3.28.0
# via
# -c requirements/common_constraints.txt
# -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.2
# via -r requirements/travis.in
virtualenv==20.24.6
virtualenv==20.24.5
# via tox
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[tox]
envlist = py38-django{42}
envlist = py38-django{32, 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
Loading