diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39c68ddc..fd2212b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.travis/docker-compose-travis.yml b/.travis/docker-compose-travis.yml index 26eb6c5c..2a043599 100644 --- a/.travis/docker-compose-travis.yml +++ b/.travis/docker-compose-travis.yml @@ -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 @@ -49,7 +39,6 @@ services: - ..:/edx/app/edx_notes_api/edx_notes_api command: tail -f /dev/null depends_on: - - "mysql57" - "mysql80" - "es" environment: diff --git a/Makefile b/Makefile index cd8500d9..6e78175b 100644 --- a/Makefile +++ b/Makefile @@ -65,9 +65,19 @@ 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 @@ -75,6 +85,7 @@ upgrade: piptools ## update the requirements/*.txt files with the latest package 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 diff --git a/requirements/base.txt b/requirements/base.txt index 2de01990..0b6d38b3 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -145,7 +141,6 @@ python-dateutil==2.4.0 # elasticsearch-dsl pytz==2023.3 # via - # django # djangorestframework # drf-yasg pyyaml==6.0 diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 33dfb7bb..1b10609f 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -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 @@ -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 diff --git a/requirements/django.txt b/requirements/django.txt index 480c0782..a6bbbf6c 100644 --- a/requirements/django.txt +++ b/requirements/django.txt @@ -1 +1 @@ -django==3.2.20 +django==4.2.7 diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index baf1aa51..581b0f91 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -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: diff --git a/requirements/pip.txt b/requirements/pip.txt index 896a85ce..1265a0d1 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -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 diff --git a/requirements/test.txt b/requirements/test.txt index 89044081..bd02b3d7 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -268,7 +268,6 @@ python-slugify==8.0.1 pytz==2023.3 # via # -r requirements/base.txt - # django # djangorestframework # drf-yasg pyyaml==6.0 @@ -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: diff --git a/requirements/travis.txt b/requirements/travis.txt index 95c46152..9d58a144 100644 --- a/requirements/travis.txt +++ b/requirements/travis.txt @@ -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 diff --git a/tox.ini b/tox.ini index 193a8372..1809ae17 100644 --- a/tox.ini +++ b/tox.ini @@ -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 =