diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba735ab..3de521c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,9 +13,9 @@ 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', '3.12'] + toxenv: [quality, django42, check_keywords] steps: - uses: actions/checkout@v3 @@ -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/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 6e6ddb5..e20f73f 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -8,7 +8,7 @@ on: jobs: push: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout @@ -16,7 +16,7 @@ jobs: - name: setup python uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.11 - name: Install pip run: pip install -r requirements/pip.txt @@ -28,7 +28,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 ce808d2..e65cc9f 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,4 @@ target/ # JetBrains/PyCharm .idea/ +venv diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b408741..ff0c678 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,11 +14,23 @@ Unreleased * +Added +~~~~~~~ + +[4.4.0] - 2024-09-10 +-------------------- + +* Dropped support for python3.8 + +[4.3.0] - 2024-04-01 +-------------------- + +* Added support for python3.11 and 3.12 +* Dropped django 3.2 support. + [4.2.0] - 2023-08-03 -------------------- -Added -~~~~~~~ * Added support for Django 4.2 [4.1.0] - 2022-01-28 diff --git a/Makefile b/Makefile index 3a0bb9f..ea0c5e0 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: clean quality requirements test upgrade +.PHONY: clean quality requirements test upgrade check_keywords clean: coverage erase @@ -45,3 +45,6 @@ upgrade: $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with # Let tox control the Django version for tests sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp mv requirements/test.tmp requirements/test.txt + +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 53e57e9..f4e8164 100644 --- a/README.rst +++ b/README.rst @@ -139,7 +139,7 @@ Please read `How To Contribute =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/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 aaea43d..c8e7566 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -9,3 +9,11 @@ # linking to it here is good. -c common_constraints.txt + +# 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 + + +# Temporary to Support the python 3.11 Upgrade +backports.zoneinfo;python_version<"3.9" # Newer versions have zoneinfo available in the standard library diff --git a/requirements/dev.txt b/requirements/dev.txt index 0460e3e..0111a64 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,5 +1,5 @@ # -# 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 @@ -8,28 +8,28 @@ argparse==1.4.0 # via # -r requirements/test.txt # unittest2 -asgiref==3.7.2 +asgiref==3.8.1 # via # -r requirements/test.txt # django -astroid==2.15.6 +astroid==3.3.5 # via # -r requirements/test.txt # pylint # pylint-celery -build==0.10.0 +build==1.2.2.post1 # via # -r requirements/pip-tools.txt # pip-tools -certifi==2023.7.22 +certifi==2024.8.30 # via # -r requirements/test.txt # requests -cffi==1.15.1 +cffi==1.17.1 # via # -r requirements/test.txt # cryptography -charset-normalizer==3.2.0 +charset-normalizer==3.4.0 # via # -r requirements/test.txt # requests @@ -45,45 +45,44 @@ click-log==0.4.0 # via # -r requirements/test.txt # edx-lint -code-annotations==1.5.0 +code-annotations==2.0.0 # via # -r requirements/test.txt # edx-lint -coverage[toml]==7.3.0 +coverage[toml]==7.6.8 # via # -r requirements/test.txt # pytest-cov -cryptography==41.0.3 +cryptography==44.0.0 # via # -r requirements/test.txt # pyjwt # social-auth-core -defusedxml==0.7.1 +defusedxml==0.8.0rc2 # via # -r requirements/test.txt # python3-openid # social-auth-core -dill==0.3.7 +dill==0.3.9 # via # -r requirements/test.txt # pylint -distlib==0.3.7 +distlib==0.3.9 # via # -r requirements/ci.txt # -r requirements/test.txt # virtualenv -django==3.2.20 +django==4.2.17 # via # -c requirements/common_constraints.txt # -r requirements/test.txt + # edx-django-release-util # social-auth-app-django -edx-lint==5.3.4 +edx-django-release-util==1.4.0 # via -r requirements/test.txt -exceptiongroup==1.1.3 - # via - # -r requirements/test.txt - # pytest -filelock==3.12.3 +edx-lint==5.4.1 + # via -r requirements/test.txt +filelock==3.16.1 # via # -r requirements/ci.txt # -r requirements/test.txt @@ -91,7 +90,7 @@ filelock==3.12.3 # virtualenv httpretty==1.1.4 # via -r requirements/test.txt -idna==3.4 +idna==3.10 # via # -r requirements/test.txt # requests @@ -99,23 +98,19 @@ iniconfig==2.0.0 # via # -r requirements/test.txt # pytest -isort==5.12.0 +isort==5.13.2 # via # -r requirements/test.txt # pylint -jinja2==3.1.2 +jinja2==3.1.4 # via # -r requirements/test.txt # code-annotations -lazy-object-proxy==1.9.0 - # via - # -r requirements/test.txt - # astroid linecache2==1.0.0 # via # -r requirements/test.txt # traceback2 -markupsafe==2.1.3 +markupsafe==3.0.2 # via # -r requirements/test.txt # jinja2 @@ -128,7 +123,7 @@ oauthlib==3.2.2 # -r requirements/test.txt # requests-oauthlib # social-auth-core -packaging==23.1 +packaging==24.2 # via # -r requirements/ci.txt # -r requirements/pip-tools.txt @@ -136,19 +131,19 @@ packaging==23.1 # build # pytest # tox -pbr==5.11.1 +pbr==6.1.0 # via # -r requirements/test.txt # stevedore -pip-tools==7.3.0 +pip-tools==7.4.1 # via -r requirements/pip-tools.txt -platformdirs==3.10.0 +platformdirs==4.3.6 # via # -r requirements/ci.txt # -r requirements/test.txt # pylint # virtualenv -pluggy==1.3.0 +pluggy==1.5.0 # via # -r requirements/ci.txt # -r requirements/test.txt @@ -159,19 +154,19 @@ py==1.11.0 # -r requirements/ci.txt # -r requirements/test.txt # tox -pycodestyle==2.11.0 +pycodestyle==2.12.1 # via -r requirements/test.txt -pycparser==2.21 +pycparser==2.22 # via # -r requirements/test.txt # cffi -pycryptodomex==3.18.0 +pycryptodomex==3.21.0 # via -r requirements/test.txt -pyjwt[crypto]==2.8.0 +pyjwt[crypto]==2.10.1 # via # -r requirements/test.txt # social-auth-core -pylint==2.17.5 +pylint==3.3.2 # via # -r requirements/test.txt # edx-lint @@ -182,7 +177,7 @@ pylint-celery==0.3 # via # -r requirements/test.txt # edx-lint -pylint-django==2.5.3 +pylint-django==2.6.1 # via # -r requirements/test.txt # edx-lint @@ -191,20 +186,21 @@ pylint-plugin-utils==0.8.2 # -r requirements/test.txt # pylint-celery # pylint-django -pyproject-hooks==1.0.0 +pyproject-hooks==1.2.0 # via # -r requirements/pip-tools.txt # build -pytest==7.4.0 + # pip-tools +pytest==8.3.4 # via # -r requirements/test.txt # pytest-cov # pytest-django -pytest-cov==4.1.0 +pytest-cov==6.0.0 # via -r requirements/test.txt -pytest-django==4.5.2 +pytest-django==4.9.0 # via -r requirements/test.txt -python-slugify==8.0.1 +python-slugify==8.0.4 # via # -r requirements/test.txt # code-annotations @@ -212,41 +208,39 @@ python3-openid==3.2.0 # via # -r requirements/test.txt # social-auth-core -pytz==2023.3 - # via - # -r requirements/test.txt - # django -pyyaml==6.0.1 +pyyaml==6.0.2 # via # -r requirements/test.txt # code-annotations -requests==2.31.0 + # edx-django-release-util +requests==2.32.3 # via # -r requirements/test.txt # requests-oauthlib # social-auth-core -requests-oauthlib==1.3.1 +requests-oauthlib==2.0.0 # via # -r requirements/test.txt # social-auth-core -six==1.16.0 +six==1.17.0 # via # -r requirements/ci.txt # -r requirements/test.txt + # edx-django-release-util # edx-lint # tox # unittest2 -social-auth-app-django==5.2.0 +social-auth-app-django==5.4.2 # via -r requirements/test.txt -social-auth-core==4.4.2 +social-auth-core==4.5.4 # via # -r requirements/test.txt # social-auth-app-django -sqlparse==0.4.4 +sqlparse==0.5.2 # via # -r requirements/test.txt # django -stevedore==5.1.0 +stevedore==5.4.0 # via # -r requirements/test.txt # code-annotations @@ -254,61 +248,34 @@ text-unidecode==1.3 # via # -r requirements/test.txt # python-slugify -tomli==2.0.1 - # via - # -r requirements/ci.txt - # -r requirements/pip-tools.txt - # -r requirements/test.txt - # build - # coverage - # pip-tools - # pylint - # pyproject-hooks - # pytest - # tox -tomlkit==0.12.1 +tomlkit==0.13.2 # via # -r requirements/test.txt # pylint tox==3.28.0 # via - # -c requirements/common_constraints.txt + # -c requirements/constraints.txt # -r requirements/ci.txt # -r requirements/test.txt - # tox-battery -tox-battery==0.6.2 - # via -r requirements/ci.txt traceback2==1.4.0 # via # -r requirements/test.txt # unittest2 -typing-extensions==4.7.1 - # via - # -r requirements/ci.txt - # -r requirements/test.txt - # asgiref - # astroid - # filelock - # pylint unittest2==1.1.0 # via -r requirements/test.txt -urllib3==2.0.4 +urllib3==2.2.3 # via # -r requirements/test.txt # requests -virtualenv==20.24.4 +virtualenv==20.28.0 # via # -r requirements/ci.txt # -r requirements/test.txt # tox -wheel==0.41.2 +wheel==0.45.1 # via # -r requirements/pip-tools.txt # pip-tools -wrapt==1.15.0 - # via - # -r requirements/test.txt - # astroid # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 007ed38..8308278 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -1,25 +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 # -build==0.10.0 +build==1.2.2.post1 # via pip-tools click==8.1.7 # via pip-tools -packaging==23.1 +packaging==24.2 # 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.45.1 # 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 13c7e84..2091a19 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.45.1 # 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 /home/runner/work/auth-backends/auth-backends/requirements/common_constraints.txt + # -r requirements/pip.in +setuptools==75.6.0 # via -r requirements/pip.in diff --git a/requirements/test.in b/requirements/test.in index d0b823b..210ca42 100644 --- a/requirements/test.in +++ b/requirements/test.in @@ -12,3 +12,4 @@ pytest-cov pytest-django tox unittest2 +edx-django-release-util # Contains the reserved keyword check diff --git a/requirements/test.txt b/requirements/test.txt index 4e7e0b8..978c3a0 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,28 +1,28 @@ # -# 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 # argparse==1.4.0 # via unittest2 -asgiref==3.7.2 +asgiref==3.8.1 # via # -r requirements/base.txt # django -astroid==2.15.6 +astroid==3.3.5 # via # pylint # pylint-celery -certifi==2023.7.22 +certifi==2024.8.30 # via # -r requirements/base.txt # requests -cffi==1.15.1 +cffi==1.17.1 # via # -r requirements/base.txt # cryptography -charset-normalizer==3.2.0 +charset-normalizer==3.4.0 # via # -r requirements/base.txt # requests @@ -33,55 +33,54 @@ click==8.1.7 # edx-lint click-log==0.4.0 # via edx-lint -code-annotations==1.5.0 +code-annotations==2.0.0 # via edx-lint -coverage[toml]==7.3.0 +coverage[toml]==7.6.8 # via # -r requirements/test.in # pytest-cov -cryptography==41.0.3 +cryptography==44.0.0 # via # -r requirements/base.txt # pyjwt # social-auth-core -defusedxml==0.7.1 +defusedxml==0.8.0rc2 # via # -r requirements/base.txt # python3-openid # social-auth-core -dill==0.3.7 +dill==0.3.9 # via pylint -distlib==0.3.7 +distlib==0.3.9 # via virtualenv # via # -c requirements/common_constraints.txt # -r requirements/base.txt + # edx-django-release-util # social-auth-app-django -edx-lint==5.3.4 +edx-django-release-util==1.4.0 # via -r requirements/test.in -exceptiongroup==1.1.3 - # via pytest -filelock==3.12.3 +edx-lint==5.4.1 + # via -r requirements/test.in +filelock==3.16.1 # via # tox # virtualenv httpretty==1.1.4 # via -r requirements/test.in -idna==3.4 +idna==3.10 # via # -r requirements/base.txt # requests iniconfig==2.0.0 # via pytest -isort==5.12.0 +isort==5.13.2 # via pylint -jinja2==3.1.2 +jinja2==3.1.4 # via code-annotations -lazy-object-proxy==1.9.0 - # via astroid linecache2==1.0.0 # via traceback2 -markupsafe==2.1.3 +markupsafe==3.0.2 # via jinja2 mccabe==0.7.0 # via pylint @@ -90,35 +89,35 @@ oauthlib==3.2.2 # -r requirements/base.txt # requests-oauthlib # social-auth-core -packaging==23.1 +packaging==24.2 # via # pytest # tox -pbr==5.11.1 +pbr==6.1.0 # via stevedore -platformdirs==3.10.0 +platformdirs==4.3.6 # via # pylint # virtualenv -pluggy==1.3.0 +pluggy==1.5.0 # via # pytest # tox py==1.11.0 # via tox -pycodestyle==2.11.0 +pycodestyle==2.12.1 # via -r requirements/test.in -pycparser==2.21 +pycparser==2.22 # via # -r requirements/base.txt # cffi -pycryptodomex==3.18.0 +pycryptodomex==3.21.0 # via -r requirements/test.in -pyjwt[crypto]==2.8.0 +pyjwt[crypto]==2.10.1 # via # -r requirements/base.txt # social-auth-core -pylint==2.17.5 +pylint==3.3.2 # via # edx-lint # pylint-celery @@ -126,89 +125,73 @@ 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 -pytest==7.4.0 +pytest==8.3.4 # via # pytest-cov # pytest-django -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 -python-slugify==8.0.1 +python-slugify==8.0.4 # via code-annotations python3-openid==3.2.0 # via # -r requirements/base.txt # social-auth-core -pytz==2023.3 +pyyaml==6.0.2 # via - # -r requirements/base.txt - # django -pyyaml==6.0.1 - # via code-annotations -requests==2.31.0 + # code-annotations + # edx-django-release-util +requests==2.32.3 # via # -r requirements/base.txt # requests-oauthlib # social-auth-core -requests-oauthlib==1.3.1 +requests-oauthlib==2.0.0 # via # -r requirements/base.txt # social-auth-core -six==1.16.0 +six==1.17.0 # via # -r requirements/base.txt + # edx-django-release-util # edx-lint # tox # unittest2 -social-auth-app-django==5.2.0 +social-auth-app-django==5.4.2 # via -r requirements/base.txt -social-auth-core==4.4.2 +social-auth-core==4.5.4 # via # -r requirements/base.txt # social-auth-app-django -sqlparse==0.4.4 +sqlparse==0.5.2 # via # -r requirements/base.txt # django -stevedore==5.1.0 +stevedore==5.4.0 # via code-annotations text-unidecode==1.3 # via python-slugify -tomli==2.0.1 - # via - # coverage - # pylint - # pytest - # tox -tomlkit==0.12.1 +tomlkit==0.13.2 # via pylint tox==3.28.0 # via - # -c requirements/common_constraints.txt + # -c requirements/constraints.txt # -r requirements/test.in traceback2==1.4.0 # via unittest2 -typing-extensions==4.7.1 - # via - # -r requirements/base.txt - # asgiref - # astroid - # filelock - # pylint unittest2==1.1.0 # via -r requirements/test.in -urllib3==2.0.4 +urllib3==2.2.3 # via # -r requirements/base.txt # requests -virtualenv==20.24.4 +virtualenv==20.28.0 # via tox -wrapt==1.15.0 - # via astroid diff --git a/setup.py b/setup.py index b6c77b0..1433abd 100644 --- a/setup.py +++ b/setup.py @@ -130,10 +130,10 @@ def get_version(*file_paths): 'License :: OSI Approved :: GNU Affero General Public License v3', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Framework :: Django', - 'Framework :: Django :: 3.2', - 'Framework :: Django :: 4.0', + 'Framework :: Django :: 4.2', 'Topic :: Internet', ], keywords='authentication edx', diff --git a/test_settings.py b/test_settings.py index b633550..06de219 100644 --- a/test_settings.py +++ b/test_settings.py @@ -13,6 +13,7 @@ 'django.contrib.sessions', 'social_django', 'auth_backends', + 'release_util', ) DATABASES = { diff --git a/tox.ini b/tox.ini index 579ca60..943fd83 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,11 @@ [tox] -envlist = py38-django{32,42},quality +envlist = py{38,311,312}-django{42},quality [pycodestyle] max-line-length = 120 [testenv] deps = - django32: Django>=3.2,<4.0 django42: Django>=4.2,<4.3 -r{toxinidir}/requirements/test.txt commands = @@ -17,3 +16,10 @@ commands = pycodestyle --config=.pep8 auth_backends pylint --rcfile=pylintrc auth_backends +[testenv:check_keywords] +whitelist_externals = + make +deps = + -r{toxinidir}/requirements/test.txt +commands = + make check_keywords