diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4253ca8..c01d7f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,13 +14,13 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04] - python-version: ['3.8'] - toxenv: [quality, django32, django42] + os: [ubuntu-latest] + python-version: ['3.11'] + toxenv: [quality, django42, check_keywords] steps: - uses: actions/checkout@v4 - name: setup python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -36,8 +36,9 @@ jobs: run: tox - name: Run Coverage - if: matrix.python-version == '3.8' && matrix.toxenv=='django42' - uses: codecov/codecov-action@v3 + if: matrix.python-version == '3.11' && matrix.toxenv=='django42' + uses: codecov/codecov-action@v4 with: + token: ${{ secrets.CODECOV_TOKEN }} flags: unittests fail_ci_if_error: true diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index 1c49c42..d35a087 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -8,15 +8,15 @@ on: jobs: push: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: setup python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.11 - name: Install pip run: pip install -r requirements/pip.txt @@ -25,7 +25,7 @@ jobs: run: python setup.py sdist bdist_wheel - name: Publish to PyPi - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.PYPI_UPLOAD_TOKEN }} diff --git a/.gitignore b/.gitignore index 240dcf3..c88d872 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,4 @@ tests/__init__.py # Development task artifacts default.db +venv diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2bacd55..40eef6e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,12 @@ Change Log .. There should always be an "Unreleased" section for changes pending release. +[2.4.0] - 2024-03-29 +==================== + +* Added support for Python 3.11 +* Dropped support for Django 3.2, Django 4.0 and Django 4.1 + [2.3.0] - 2023-08-02 ==================== diff --git a/Makefile b/Makefile index a8bdad4..54e1b6a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: clean coverage help quality requirements test test-all upgrade validate selfcheck +.PHONY: clean coverage help quality requirements test test-all upgrade validate selfcheck check_keywords .DEFAULT_GOAL := help @@ -75,3 +75,6 @@ validate: quality test ## run tests and quality checks selfcheck: ## check that the Makefile is well-formed @echo "The Makefile is well-formed." + +check_keywords: ## Scan the Django models in all installed apps in this project for restricted field names + python manage.py check_reserved_keywords --override_file db_keyword_overrides.yml diff --git a/README.rst b/README.rst index a4710a2..ec99622 100644 --- a/README.rst +++ b/README.rst @@ -128,7 +128,7 @@ can find it at `ISSUE_TEMPLATE.md =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 +# See https://github.com/openedx/edx-platform/issues/35126 for more info 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 -# tox>4.0.0 isn't yet compatible with many tox plugins, causing CI failures in almost all repos. -# Details can be found in this discussion: https://github.com/tox-dev/tox/discussions/1810 -tox<4.0.0 +# Cause: https://github.com/openedx/event-tracking/pull/290 +# event-tracking 2.4.1 upgrades to pymongo 4.4.0 which is not supported on edx-platform. +# We will pin event-tracking to do not break existing installations +# This can be unpinned once https://github.com/openedx/edx-platform/issues/34586 +# has been resolved and edx-platform is running with pymongo>=4.4.0 +event-tracking<2.4.1 + +# Cause: https://github.com/openedx/edx-lint/issues/458 +# This can be unpinned once https://github.com/openedx/edx-lint/issues/459 has been resolved. +pip<24.3 diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 194646a..8938893 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -10,3 +10,6 @@ # This file contains all common constraints for edx-repos -c common_constraints.txt + +# For python greater than or equal to 3.9 backports.zoneinfo causing failures +backports.zoneinfo; python_version<'3.9' diff --git a/requirements/dev.in b/requirements/dev.in index f8c1386..3a43379 100644 --- a/requirements/dev.in +++ b/requirements/dev.in @@ -6,6 +6,5 @@ diff-cover # Changeset diff test coverage edx-lint # For updating pylintrc edx-i18n-tools # For i18n_tool dummy tox # virtualenv management for tests -tox-battery # Makes tox aware of requirements file changes twine # Utility for PyPI package uploads wheel # For generation of wheels for PyPI diff --git a/requirements/dev.txt b/requirements/dev.txt index 3e545b8..c85e5d9 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,26 +1,30 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # make upgrade # -asgiref==3.7.2 +asgiref==3.8.1 # via django -astroid==2.15.6 +astroid==3.3.5 # via # pylint # pylint-celery -bleach==6.0.0 - # via readme-renderer -build==1.0.0 +backports-tarfile==1.2.0 + # via jaraco-context +build==1.2.2.post1 # via -r requirements/quality.in -certifi==2023.7.22 +cachetools==5.5.0 + # via tox +certifi==2024.8.30 # via requests -cffi==1.15.1 +cffi==1.17.1 # via cryptography chardet==5.2.0 - # via diff-cover -charset-normalizer==3.2.0 + # via + # diff-cover + # tox +charset-normalizer==3.4.0 # via requests click==8.1.7 # via @@ -29,104 +33,115 @@ click==8.1.7 # edx-lint click-log==0.4.0 # via edx-lint -code-annotations==1.5.0 +code-annotations==1.8.0 # via edx-lint -cryptography==41.0.3 +colorama==0.4.6 + # via tox +cryptography==43.0.3 # via secretstorage -diff-cover==7.7.0 +diff-cover==9.2.0 # via -r requirements/dev.in -dill==0.3.7 +dill==0.3.9 # via pylint -distlib==0.3.7 +distlib==0.3.9 # via virtualenv -django==3.2.21 +django==4.2.16 # via # -c requirements/common_constraints.txt # -r requirements/base.in # edx-i18n-tools -docutils==0.20.1 +docutils==0.21.2 # via readme-renderer -edx-i18n-tools==1.1.0 +edx-i18n-tools==1.6.3 # via -r requirements/dev.in -edx-lint==5.3.4 +edx-lint==5.4.1 # via # -r requirements/dev.in # -r requirements/quality.in -filelock==3.12.3 +filelock==3.16.1 # via # tox # virtualenv -idna==3.4 +idna==3.10 # via requests -importlib-metadata==6.8.0 +importlib-metadata==8.5.0 # via - # build # keyring # twine -importlib-resources==6.0.1 - # via keyring -isort==5.12.0 +isort==5.13.2 # via # -r requirements/quality.in # pylint -jaraco-classes==3.3.0 +jaraco-classes==3.4.0 + # via keyring +jaraco-context==6.0.1 + # via keyring +jaraco-functools==4.1.0 # via keyring jeepney==0.8.0 # via # keyring # secretstorage -jinja2==3.1.2 +jinja2==3.1.4 # via # code-annotations # diff-cover -keyring==24.2.0 +keyring==25.5.0 # via twine -lazy-object-proxy==1.9.0 - # via astroid +lxml[html-clean,html_clean]==5.3.0 + # via + # edx-i18n-tools + # lxml-html-clean +lxml-html-clean==0.3.1 + # via lxml markdown-it-py==3.0.0 # via rich -markupsafe==2.1.3 +markupsafe==3.0.2 # via jinja2 mccabe==0.7.0 # via pylint mdurl==0.1.2 # via markdown-it-py -more-itertools==10.1.0 - # via jaraco-classes -packaging==23.1 +more-itertools==10.5.0 + # via + # jaraco-classes + # jaraco-functools +nh3==0.2.18 + # via readme-renderer +packaging==24.1 # via # build + # pyproject-api # tox -path==16.7.1 +path==16.16.0 # via edx-i18n-tools -pbr==5.11.1 +pbr==6.1.0 # via stevedore -pkginfo==1.9.6 +pkginfo==1.10.0 # via twine -platformdirs==3.10.0 +platformdirs==4.3.6 # via # pylint + # tox # virtualenv -pluggy==1.3.0 +pluggy==1.5.0 # via # diff-cover # tox polib==1.2.0 # via edx-i18n-tools -py==1.11.0 - # via tox -pycodestyle==2.11.0 +pycodestyle==2.12.1 # via -r requirements/quality.in -pycparser==2.21 +pycparser==2.22 # via cffi -pydocstyle==1.1.1 +pydocstyle==6.3.0 # via -r requirements/quality.in -pygments==2.16.1 +pygments==2.18.0 # via # diff-cover # readme-renderer # rich -pylint==2.17.5 +pylint==3.3.1 # via # edx-lint # pylint-celery @@ -134,25 +149,25 @@ pylint==2.17.5 # pylint-plugin-utils pylint-celery==0.3 # via edx-lint -pylint-django==2.5.3 +pylint-django==2.6.1 # via edx-lint pylint-plugin-utils==0.8.2 # via # pylint-celery # pylint-django -pyproject-hooks==1.0.0 +pyproject-api==1.8.0 + # via tox +pyproject-hooks==1.2.0 # via build -python-slugify==8.0.1 +python-slugify==8.0.4 # via code-annotations -pytz==2023.3.post1 - # via django -pyyaml==6.0.1 +pyyaml==6.0.2 # via # code-annotations # edx-i18n-tools -readme-renderer==41.0 +readme-renderer==44.0 # via twine -requests==2.31.0 +requests==2.32.3 # via # requests-toolbelt # twine @@ -160,60 +175,35 @@ requests-toolbelt==1.0.0 # via twine rfc3986==2.0.0 # via twine -rich==13.5.2 +rich==13.9.3 # via twine secretstorage==3.3.3 # via keyring six==1.16.0 - # via - # bleach - # edx-lint - # tox -sqlparse==0.4.4 + # via edx-lint +snowballstemmer==2.2.0 + # via pydocstyle +sqlparse==0.5.1 # via django -stevedore==5.1.0 +stevedore==5.3.0 # via code-annotations text-unidecode==1.3 # via python-slugify -tomli==2.0.1 - # via - # build - # pylint - # pyproject-hooks - # tox -tomlkit==0.12.1 +tomlkit==0.13.2 # via pylint -tox==3.28.0 - # via - # -c requirements/common_constraints.txt - # -r requirements/dev.in - # tox-battery -tox-battery==0.6.2 +tox==4.23.2 # via -r requirements/dev.in -twine==4.0.2 +twine==5.1.1 # via # -r requirements/dev.in # -r requirements/quality.in -typing-extensions==4.7.1 - # via - # asgiref - # astroid - # filelock - # pylint - # rich -urllib3==2.0.4 +urllib3==2.2.3 # via # requests # twine -virtualenv==20.24.4 +virtualenv==20.27.1 # via tox -webencodings==0.5.1 - # via bleach -wheel==0.41.2 +wheel==0.44.0 # via -r requirements/dev.in -wrapt==1.15.0 - # via astroid -zipp==3.16.2 - # via - # importlib-metadata - # importlib-resources +zipp==3.20.2 + # via importlib-metadata diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 135c9d9..db6c463 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -1,30 +1,23 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # make upgrade # -build==1.0.0 +build==1.2.2.post1 # via pip-tools click==8.1.7 # via pip-tools -importlib-metadata==6.8.0 +packaging==24.1 # via build -packaging==23.1 - # via build -pip-tools==7.3.0 +pip-tools==7.4.1 # via -r requirements/pip-tools.in -pyproject-hooks==1.0.0 - # via build -tomli==2.0.1 +pyproject-hooks==1.2.0 # via # build # pip-tools - # pyproject-hooks -wheel==0.41.2 +wheel==0.44.0 # via pip-tools -zipp==3.16.2 - # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/pip.txt b/requirements/pip.txt index 13c7e84..4996fad 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,14 +1,16 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # make upgrade # -wheel==0.41.2 +wheel==0.44.0 # via -r requirements/pip.in # The following packages are considered to be unsafe in a requirements file: -pip==23.2.1 - # via -r requirements/pip.in -setuptools==68.1.2 +pip==24.2 + # via + # -c requirements/common_constraints.txt + # -r requirements/pip.in +setuptools==75.3.0 # via -r requirements/pip.in diff --git a/requirements/quality.in b/requirements/quality.in index 92a763b..dad3578 100644 --- a/requirements/quality.in +++ b/requirements/quality.in @@ -5,6 +5,6 @@ edx-lint # edX pylint rules and plugins isort # to standardize order of imports pycodestyle # PEP 8 compliance validation -pydocstyle<2.0 # PEP 257 compliance validation: 2.0 doesn't know Google style, and tries to correct my grammar... :( +pydocstyle # PEP 257 compliance validation: 2.0 doesn't know Google style, and tries to correct my grammar... :( build # Build needs to be created for README validation twine # Needed to validate README.rst for usage on PyPI diff --git a/requirements/quality.txt b/requirements/quality.txt index ac3f999..33ce75c 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -1,22 +1,22 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # make upgrade # -astroid==2.15.6 +astroid==3.3.5 # via # pylint # pylint-celery -bleach==6.0.0 - # via readme-renderer -build==1.0.0 +backports-tarfile==1.2.0 + # via jaraco-context +build==1.2.2.post1 # via -r requirements/quality.in -certifi==2023.7.22 +certifi==2024.8.30 # via requests -cffi==1.15.1 +cffi==1.17.1 # via cryptography -charset-normalizer==3.2.0 +charset-normalizer==3.4.0 # via requests click==8.1.7 # via @@ -25,70 +25,73 @@ click==8.1.7 # edx-lint click-log==0.4.0 # via edx-lint -code-annotations==1.5.0 +code-annotations==1.8.0 # via edx-lint -cryptography==41.0.3 +cryptography==43.0.3 # via secretstorage -dill==0.3.7 +dill==0.3.9 # via pylint -docutils==0.20.1 +docutils==0.21.2 # via readme-renderer -edx-lint==5.3.4 +edx-lint==5.4.1 # via -r requirements/quality.in -idna==3.4 +idna==3.10 # via requests -importlib-metadata==6.8.0 +importlib-metadata==8.5.0 # via - # build # keyring # twine -importlib-resources==6.0.1 - # via keyring -isort==5.12.0 +isort==5.13.2 # via # -r requirements/quality.in # pylint -jaraco-classes==3.3.0 +jaraco-classes==3.4.0 + # via keyring +jaraco-context==6.0.1 + # via keyring +jaraco-functools==4.1.0 # via keyring jeepney==0.8.0 # via # keyring # secretstorage -jinja2==3.1.2 +jinja2==3.1.4 # via code-annotations -keyring==24.2.0 +keyring==25.5.0 # via twine -lazy-object-proxy==1.9.0 - # via astroid markdown-it-py==3.0.0 # via rich -markupsafe==2.1.3 +markupsafe==3.0.2 # via jinja2 mccabe==0.7.0 # via pylint mdurl==0.1.2 # via markdown-it-py -more-itertools==10.1.0 - # via jaraco-classes -packaging==23.1 +more-itertools==10.5.0 + # via + # jaraco-classes + # jaraco-functools +nh3==0.2.18 + # via readme-renderer +packaging==24.1 # via build -pbr==5.11.1 +pbr==6.1.0 # via stevedore -pkginfo==1.9.6 +pkginfo==1.10.0 # via twine -platformdirs==3.10.0 +platformdirs==4.3.6 # via pylint -pycodestyle==2.11.0 +pycodestyle==2.12.1 # via -r requirements/quality.in -pycparser==2.21 +pycparser==2.22 # via cffi -pydocstyle==1.1.1 +pydocstyle==6.3.0 # via -r requirements/quality.in -pygments==2.16.1 +pygments==2.18.0 # via # readme-renderer # rich -pylint==2.17.5 +pylint==3.3.1 # via # edx-lint # pylint-celery @@ -96,21 +99,21 @@ pylint==2.17.5 # pylint-plugin-utils pylint-celery==0.3 # via edx-lint -pylint-django==2.5.3 +pylint-django==2.6.1 # via edx-lint pylint-plugin-utils==0.8.2 # via # pylint-celery # pylint-django -pyproject-hooks==1.0.0 +pyproject-hooks==1.2.0 # via build -python-slugify==8.0.1 +python-slugify==8.0.4 # via code-annotations -pyyaml==6.0.1 +pyyaml==6.0.2 # via code-annotations -readme-renderer==41.0 +readme-renderer==44.0 # via twine -requests==2.31.0 +requests==2.32.3 # via # requests-toolbelt # twine @@ -118,41 +121,25 @@ requests-toolbelt==1.0.0 # via twine rfc3986==2.0.0 # via twine -rich==13.5.2 +rich==13.9.3 # via twine secretstorage==3.3.3 # via keyring six==1.16.0 - # via - # bleach - # edx-lint -stevedore==5.1.0 + # via edx-lint +snowballstemmer==2.2.0 + # via pydocstyle +stevedore==5.3.0 # via code-annotations text-unidecode==1.3 # via python-slugify -tomli==2.0.1 - # via - # build - # pylint - # pyproject-hooks -tomlkit==0.12.1 +tomlkit==0.13.2 # via pylint -twine==4.0.2 +twine==5.1.1 # via -r requirements/quality.in -typing-extensions==4.7.1 - # via - # astroid - # pylint - # rich -urllib3==2.0.4 +urllib3==2.2.3 # via # requests # twine -webencodings==0.5.1 - # via bleach -wrapt==1.15.0 - # via astroid -zipp==3.16.2 - # via - # importlib-metadata - # importlib-resources +zipp==3.20.2 + # via importlib-metadata diff --git a/requirements/test.in b/requirements/test.in index c8f0519..178806f 100644 --- a/requirements/test.in +++ b/requirements/test.in @@ -5,3 +5,4 @@ pytest-catchlog # Show log output for test failures pytest-cov # pytest extension for code coverage statistics pytest-django # pytest extension for better Django support +edx-django-release-util # Contains the reserved keyword check diff --git a/requirements/test.txt b/requirements/test.txt index 9d805ba..10bc9c2 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,44 +1,41 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # make upgrade # -asgiref==3.7.2 +asgiref==3.8.1 # via django -coverage[toml]==7.3.0 +coverage[toml]==7.6.4 # via pytest-cov # via # -c requirements/common_constraints.txt # -r requirements/base.in -exceptiongroup==1.1.3 - # via pytest + # edx-django-release-util +edx-django-release-util==1.4.0 + # via -r requirements/test.in iniconfig==2.0.0 # via pytest -packaging==23.1 +packaging==24.1 # via pytest -pluggy==1.3.0 +pluggy==1.5.0 # via pytest py==1.11.0 # via pytest-catchlog -pytest==7.4.1 +pytest==8.3.3 # via # pytest-catchlog # pytest-cov # pytest-django pytest-catchlog==1.2.2 # via -r requirements/test.in -pytest-cov==4.1.0 +pytest-cov==6.0.0 # via -r requirements/test.in -pytest-django==4.5.2 +pytest-django==4.9.0 # via -r requirements/test.in -pytz==2023.3.post1 +pyyaml==6.0.2 + # via edx-django-release-util +six==1.16.0 + # via edx-django-release-util +sqlparse==0.5.1 # via django -sqlparse==0.4.4 - # via django -tomli==2.0.1 - # via - # coverage - # pytest -typing-extensions==4.7.1 - # via asgiref diff --git a/setup.py b/setup.py index c8405b2..43b30cc 100644 --- a/setup.py +++ b/setup.py @@ -148,12 +148,12 @@ def is_requirement(line): classifiers=[ 'Development Status :: 5 - Production/Stable', 'Framework :: Django', - 'Framework :: Django :: 3.2', - 'Framework :: Django :: 4.0', + 'Framework :: Django :: 4.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', 'Natural Language :: English', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.11', ], ) diff --git a/test_settings.py b/test_settings.py index 871743a..ea432eb 100644 --- a/test_settings.py +++ b/test_settings.py @@ -30,6 +30,7 @@ def root(*args): 'django.contrib.auth', 'django.contrib.contenttypes', 'help_tokens', + 'release_util', ) LOCALE_PATHS = [ diff --git a/tox.ini b/tox.ini index e175c25..3ff5707 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38-django{32,42}, quality +envlist = py{38, 311}-django{42}, quality, check_keywords [pycodestyle] exclude = .git,.tox,migrations @@ -16,7 +16,6 @@ norecursedirs = .* requirements [testenv] deps = - django32: Django>=3.2,<4.0 django42: Django>=4.2,<4.3 -r{toxinidir}/requirements/test.txt commands = @@ -26,7 +25,7 @@ commands = setenv = DJANGO_SETTINGS_MODULE = test_settings PYTHONPATH = . -whitelist_externals = +allowlist_externals = make rm touch @@ -43,3 +42,11 @@ commands = twine check dist/* isort --check-only tests help_tokens manage.py setup.py test_settings.py make selfcheck + +[testenv:check_keywords] +allowlist_externals = + make +deps = + -r{toxinidir}/requirements/test.txt +commands = + make check_keywords