diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a2f025..0698e54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,11 +13,8 @@ jobs: strategy: matrix: os: [ubuntu-20.04] - python-version: ['3.8'] - toxenv: [quality, django32, django42] - exclude: - - python-version: '3.8' - toxenv: quality + python-version: ['3.8', '3.11', '3.12'] + toxenv: [quality, django42] steps: - name: checkout repo @@ -40,7 +37,8 @@ jobs: - name: Run Coverage if: matrix.python-version == '3.8' && matrix.toxenv=='django42' - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: flags: unittests fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/Makefile b/Makefile index 0103a70..e9c0cea 100644 --- a/Makefile +++ b/Makefile @@ -23,11 +23,11 @@ upgrade: ## update the requirements/*.txt files with the latest packages satisfy 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/doc.txt requirements/doc.in - pip-compile --upgrade -o requirements/test.txt requirements/test.in - pip-compile --upgrade -o requirements/tox.txt requirements/tox.in - pip-compile --upgrade -o requirements/ci.txt requirements/ci.in + pip-compile --upgrade --allow-unsafe -o requirements/base.txt requirements/base.in + pip-compile --upgrade --allow-unsafe -o requirements/doc.txt requirements/doc.in + pip-compile --upgrade --allow-unsafe -o requirements/test.txt requirements/test.in + pip-compile --upgrade --allow-unsafe -o requirements/tox.txt requirements/tox.in + pip-compile --upgrade --allow-unsafe -o requirements/ci.txt requirements/ci.in # Let tox control the Django version version for tests grep -e "^django==" requirements/test.txt > requirements/django.txt grep -e "^asgiref==" requirements/test.txt >> requirements/django.txt diff --git a/django_sites_extensions/__init__.py b/django_sites_extensions/__init__.py index a8e34b3..3b65f4a 100644 --- a/django_sites_extensions/__init__.py +++ b/django_sites_extensions/__init__.py @@ -1,2 +1,2 @@ """ django_sites_extensions main module """ -__version__ = '4.0.2' +__version__ = '4.1.0' diff --git a/django_sites_extensions/apps.py b/django_sites_extensions/apps.py index bfd895a..b483f22 100644 --- a/django_sites_extensions/apps.py +++ b/django_sites_extensions/apps.py @@ -11,7 +11,6 @@ class DjangoSitesExtensionsConfig(AppConfig): # noinspection PyUnresolvedReferences def ready(self): """ Set up for django_sites_extensions app """ - # pylint: disable=unused-variable # pylint: disable=unused-import # pylint: disable=import-outside-toplevel from django_sites_extensions import models diff --git a/django_sites_extensions/tests/test_middleware.py b/django_sites_extensions/tests/test_middleware.py index 9f1b3ab..3bad070 100644 --- a/django_sites_extensions/tests/test_middleware.py +++ b/django_sites_extensions/tests/test_middleware.py @@ -17,7 +17,7 @@ class RedirectMiddlewareTestCase(TestCase): def setUp(self): super().setUp() self.middleware = RedirectMiddleware(get_response=lambda request: None) - self.site = Site.objects.get(id=1) # pylint: disable=no-member + self.site = Site.objects.get(id=1) self.redirect = Redirect.objects.create(site_id=1, old_path='/foo', new_path='http://example.com/bar') def _make_request(self, path): diff --git a/django_sites_extensions/tests/urls.py b/django_sites_extensions/tests/urls.py index 74a48c2..f6b2772 100644 --- a/django_sites_extensions/tests/urls.py +++ b/django_sites_extensions/tests/urls.py @@ -1,8 +1,8 @@ """ ROOT_URLCONF for tests """ -from django_sites_extensions.tests import views from django.urls import path +from django_sites_extensions.tests import views urlpatterns = [ path('home', views.test, name='home'), diff --git a/django_sites_extensions/tests/views.py b/django_sites_extensions/tests/views.py index f28bdf5..2ac0601 100644 --- a/django_sites_extensions/tests/views.py +++ b/django_sites_extensions/tests/views.py @@ -2,11 +2,11 @@ from django.http import HttpResponse -def test(request): # pylint: disable=unused-argument +def test(request): """ Placeholder test view """ return HttpResponse("ok") -def login(request): # pylint: disable=unused-argument +def login(request): """ Placeholder test view """ return HttpResponse("login require") diff --git a/requirements/base.in b/requirements/base.in index 2e53fd4..fa3bb95 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -2,3 +2,5 @@ -c constraints.txt Django +setuptools +wheel diff --git a/requirements/base.txt b/requirements/base.txt index 2d32a4b..2ed1fdd 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,16 +1,26 @@ # -# This file is autogenerated by pip-compile with python 3.8 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: # # make upgrade # -asgiref==3.5.0 +asgiref==3.8.1 # via django -django==3.2.12 +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt + # django +django==4.2.11 # via # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/base.in -pytz==2021.3 - # via django -sqlparse==0.4.2 +sqlparse==0.4.4 # via django +typing-extensions==4.11.0 + # via asgiref +wheel==0.43.0 + # via -r requirements/base.in + +# The following packages are considered to be unsafe in a requirements file: +setuptools==69.2.0 + # via -r requirements/base.in diff --git a/requirements/ci.txt b/requirements/ci.txt index 18d8ca4..a076b8b 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -1,62 +1,56 @@ # -# This file is autogenerated by pip-compile with python 3.8 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: # # make upgrade # -certifi==2021.10.8 - # via requests -charset-normalizer==2.0.12 - # via requests -coverage==6.3.1 - # via codecov -distlib==0.3.4 +cachetools==5.3.3 # via # -r requirements/tox.txt - # virtualenv -filelock==3.5.0 + # tox +chardet==5.2.0 # via # -r requirements/tox.txt # tox - # virtualenv -idna==3.3 - # via requests -packaging==21.3 +colorama==0.4.6 # via # -r requirements/tox.txt # tox -platformdirs==2.5.0 +distlib==0.3.8 + # via + # -r requirements/tox.txt + # virtualenv +filelock==3.13.3 # via # -r requirements/tox.txt + # tox # virtualenv -pluggy==1.0.0 +packaging==24.0 # via # -r requirements/tox.txt + # pyproject-api # tox -py==1.11.0 +platformdirs==4.2.0 # via # -r requirements/tox.txt # tox -pyparsing==3.0.7 + # virtualenv +pluggy==1.4.0 # via # -r requirements/tox.txt - # packaging -requests==2.27.1 - # via codecov -six==1.16.0 + # tox +pyproject-api==1.6.1 # via # -r requirements/tox.txt # tox - # virtualenv -toml==0.10.2 +tomli==2.0.1 # via # -r requirements/tox.txt + # pyproject-api # tox -tox==3.24.5 +tox==4.14.2 # via -r requirements/tox.txt -urllib3==1.26.8 - # via requests -virtualenv==20.13.1 +virtualenv==20.25.1 # via # -r requirements/tox.txt # tox diff --git a/requirements/constraints.txt b/requirements/constraints.txt index f9ea41a..4ea57c8 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -10,3 +10,7 @@ # This file contains all common constraints for edx-repos -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt + + +# 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/django.txt b/requirements/django.txt index 5b8c8ab..df0dab3 100644 --- a/requirements/django.txt +++ b/requirements/django.txt @@ -1,2 +1,2 @@ -django==3.2.12 -asgiref==3.5.0 +django==4.2.11 +asgiref==3.8.1 diff --git a/requirements/doc.txt b/requirements/doc.txt index e1d36c1..6a228e0 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -1,72 +1,85 @@ # -# This file is autogenerated by pip-compile with python 3.8 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: # # make upgrade # -alabaster==0.7.12 +alabaster==0.7.13 # via sphinx -asgiref==3.5.0 +asgiref==3.8.1 # via django -babel==2.9.1 +babel==2.14.0 # via sphinx -certifi==2021.10.8 +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt + # django +certifi==2024.2.2 # via requests -charset-normalizer==2.0.12 +charset-normalizer==3.3.2 # via requests -django==3.2.12 +django==4.2.11 # via # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/base.in -docutils==0.17.1 +docutils==0.20.1 # via # sphinx # sphinx-rtd-theme -idna==3.3 +idna==3.6 # via requests -imagesize==1.3.0 +imagesize==1.4.1 # via sphinx -importlib-metadata==4.11.1 - # via sphinx -jinja2==3.0.3 +importlib-metadata==6.11.0 + # via + # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt + # sphinx +jinja2==3.1.3 # via sphinx -markupsafe==2.0.1 +markupsafe==2.1.5 # via jinja2 -packaging==21.3 +packaging==24.0 # via sphinx -pygments==2.11.2 +pygments==2.17.2 # via sphinx -pyparsing==3.0.7 - # via packaging -pytz==2021.3 - # via - # babel - # django -requests==2.27.1 +pytz==2024.1 + # via babel +requests==2.31.0 # via sphinx snowballstemmer==2.2.0 # via sphinx -sphinx==4.4.0 +sphinx==7.1.2 # via # -r requirements/doc.in # sphinx-rtd-theme -sphinx-rtd-theme==1.0.0 + # sphinxcontrib-jquery +sphinx-rtd-theme==2.0.0 # via -r requirements/doc.in -sphinxcontrib-applehelp==1.0.2 +sphinxcontrib-applehelp==1.0.4 # via sphinx sphinxcontrib-devhelp==1.0.2 # via sphinx -sphinxcontrib-htmlhelp==2.0.0 +sphinxcontrib-htmlhelp==2.0.1 # via sphinx +sphinxcontrib-jquery==4.1 + # via sphinx-rtd-theme sphinxcontrib-jsmath==1.0.1 # via sphinx sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -sqlparse==0.4.2 +sqlparse==0.4.4 # via django -urllib3==1.26.8 +typing-extensions==4.11.0 + # via asgiref +urllib3==2.2.1 # via requests -zipp==3.7.0 +wheel==0.43.0 + # via -r requirements/base.in +zipp==3.18.1 # via importlib-metadata + +# The following packages are considered to be unsafe in a requirements file: +setuptools==69.2.0 + # via -r requirements/base.in diff --git a/requirements/pip.txt b/requirements/pip.txt index a1ebd56..cf44902 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,16 +1,14 @@ # -# This file is autogenerated by pip-compile with python 3.8 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: # # make upgrade # -wheel==0.37.1 +wheel==0.43.0 # via -r requirements/pip.in # The following packages are considered to be unsafe in a requirements file: -pip==22.0.3 +pip==24.0 + # via -r requirements/pip.in +setuptools==69.2.0 # via -r requirements/pip.in -setuptools==59.8.0 - # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt - # -r requirements/pip.in diff --git a/requirements/pip_tools.txt b/requirements/pip_tools.txt index 6d571f6..e64299a 100644 --- a/requirements/pip_tools.txt +++ b/requirements/pip_tools.txt @@ -1,19 +1,34 @@ # -# This file is autogenerated by pip-compile with python 3.8 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: # # make upgrade # -click==8.0.3 +build==1.2.1 # via pip-tools -pep517==0.12.0 +click==8.1.7 # via pip-tools -pip-tools==6.5.1 +importlib-metadata==6.11.0 + # via + # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt + # build +packaging==24.0 + # via build +pip-tools==7.4.1 # via -r requirements/pip_tools.in +pyproject-hooks==1.0.0 + # via + # build + # pip-tools tomli==2.0.1 - # via pep517 -wheel==0.37.1 + # via + # build + # pip-tools + # pyproject-hooks +wheel==0.43.0 # via pip-tools +zipp==3.18.1 + # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/test.txt b/requirements/test.txt index 9276236..edb3e67 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,86 +1,109 @@ # -# This file is autogenerated by pip-compile with python 3.8 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: # # make upgrade # -astroid==2.9.3 + # via + # -r requirements/base.txt + # django +astroid==3.1.0 # via # pylint # pylint-celery -attrs==21.4.0 - # via pytest -bleach==4.1.0 - # via readme-renderer -certifi==2021.10.8 +backports-tarfile==1.0.0 + # via jaraco-context +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt + # -r requirements/base.txt + # django +certifi==2024.2.2 # via requests -charset-normalizer==2.0.12 +charset-normalizer==3.3.2 # via requests -click==8.0.3 +click==8.1.7 # via # click-log # code-annotations # edx-lint -click-log==0.3.2 +click-log==0.4.0 # via edx-lint -code-annotations==1.3.0 +code-annotations==1.8.0 # via edx-lint -colorama==0.4.4 - # via twine -coverage[toml]==6.3.1 +coverage[toml]==7.4.4 # via # -r requirements/test.in # pytest-cov +dill==0.3.8 + # via pylint # via # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/base.txt -django-dynamic-fixture==3.1.2 +django-dynamic-fixture==4.0.1 # via -r requirements/test.in -docutils==0.18.1 +docutils==0.20.1 # via readme-renderer -edx-lint==5.2.1 +edx-lint==5.3.6 # via -r requirements/test.in -idna==3.3 +exceptiongroup==1.2.0 + # via pytest +idna==3.6 # via requests -importlib-metadata==4.11.1 +importlib-metadata==6.11.0 # via + # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # keyring # twine -iniconfig==1.1.1 +importlib-resources==6.4.0 + # via keyring +iniconfig==2.0.0 # via pytest -isort==5.10.1 +isort==5.13.2 # via pylint -jinja2==3.0.3 +jaraco-classes==3.4.0 + # via keyring +jaraco-context==5.3.0 + # via keyring +jaraco-functools==4.0.0 + # via keyring +jinja2==3.1.3 # via code-annotations -keyring==23.5.0 +keyring==25.1.0 # via twine -lazy-object-proxy==1.7.1 - # via astroid -markupsafe==2.0.1 +markdown-it-py==3.0.0 + # via rich +markupsafe==2.1.5 # via jinja2 -mccabe==0.6.1 +mccabe==0.7.0 # via pylint -mock==4.0.3 +mdurl==0.1.2 + # via markdown-it-py +mock==5.1.0 # via -r requirements/test.in -packaging==21.3 +more-itertools==10.2.0 # via - # bleach - # pytest -pbr==5.8.1 + # jaraco-classes + # jaraco-functools +nh3==0.2.17 + # via readme-renderer +packaging==24.0 + # via pytest +pbr==6.0.0 # via stevedore pep8==1.7.1 # via -r requirements/test.in -pkginfo==1.8.2 +pkginfo==1.10.0 # via twine -platformdirs==2.5.0 +platformdirs==4.2.0 # via pylint -pluggy==1.0.0 - # via pytest -py==1.11.0 +pluggy==1.4.0 # via pytest -pygments==2.11.2 - # via readme-renderer -pylint==2.12.2 +pygments==2.17.2 + # via + # readme-renderer + # rich +pylint==3.1.0 # via # edx-lint # pylint-celery @@ -88,77 +111,73 @@ pylint==2.12.2 # pylint-plugin-utils pylint-celery==0.3 # via edx-lint -pylint-django==2.5.0 +pylint-django==2.5.5 # via edx-lint -pylint-plugin-utils==0.7 +pylint-plugin-utils==0.8.2 # via # pylint-celery # pylint-django -pyparsing==3.0.7 - # via packaging -pytest==7.0.1 +pytest==8.1.1 # via # pytest-cov # pytest-django -pytest-cov==3.0.0 +pytest-cov==5.0.0 # via -r requirements/test.in -pytest-django==4.5.2 +pytest-django==4.8.0 # via -r requirements/test.in -python-slugify==5.0.2 +python-slugify==8.0.4 # via code-annotations -pytz==2021.3 - # via - # -r requirements/base.txt - # django -pyyaml==6.0 +pyyaml==6.0.1 # via code-annotations -readme-renderer==32.0 +readme-renderer==43.0 # via twine -requests==2.27.1 +requests==2.31.0 # via # requests-toolbelt # twine -requests-toolbelt==0.9.1 +requests-toolbelt==1.0.0 # via twine rfc3986==2.0.0 # via twine +rich==13.7.1 + # via twine six==1.16.0 - # via - # bleach - # django-dynamic-fixture - # edx-lint -sqlparse==0.4.2 + # via edx-lint +sqlparse==0.4.4 # via # -r requirements/base.txt # django -stevedore==3.5.0 +stevedore==5.2.0 # via code-annotations text-unidecode==1.3 # via python-slugify -toml==0.10.2 - # via pylint tomli==2.0.1 # via # coverage + # pylint # pytest -tqdm==4.62.3 - # via twine -twine==3.8.0 +tomlkit==0.12.4 + # via pylint +twine==5.0.0 # via -r requirements/test.in -typing-extensions==4.1.1 +typing-extensions==4.11.0 # via + # -r requirements/base.txt + # asgiref # astroid # pylint -urllib3==1.26.8 + # rich +urllib3==2.2.1 # via # requests # twine -webencodings==0.5.1 - # via bleach -wrapt==1.13.3 - # via astroid -zipp==3.7.0 - # via importlib-metadata +wheel==0.43.0 + # via -r requirements/base.txt +zipp==3.18.1 + # via + # importlib-metadata + # importlib-resources # The following packages are considered to be unsafe in a requirements file: -# setuptools +setuptools==69.2.0 + # via -r requirements/base.txt diff --git a/requirements/tox.txt b/requirements/tox.txt index 16929e4..cc5293d 100644 --- a/requirements/tox.txt +++ b/requirements/tox.txt @@ -1,32 +1,38 @@ # -# This file is autogenerated by pip-compile with python 3.8 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: # # make upgrade # -distlib==0.3.4 +cachetools==5.3.3 + # via tox +chardet==5.2.0 + # via tox +colorama==0.4.6 + # via tox +distlib==0.3.8 # via virtualenv -filelock==3.5.0 +filelock==3.13.3 # via # tox # virtualenv -packaging==21.3 - # via tox -platformdirs==2.5.0 - # via virtualenv -pluggy==1.0.0 - # via tox -py==1.11.0 - # via tox -pyparsing==3.0.7 - # via packaging -six==1.16.0 +packaging==24.0 + # via + # pyproject-api + # tox +platformdirs==4.2.0 # via # tox # virtualenv -toml==0.10.2 +pluggy==1.4.0 # via tox -tox==3.24.5 +pyproject-api==1.6.1 + # via tox +tomli==2.0.1 + # via + # pyproject-api + # tox +tox==4.14.2 # via -r requirements/tox.in -virtualenv==20.13.1 +virtualenv==20.25.1 # via tox diff --git a/setup.py b/setup.py index 330854d..367b21a 100644 --- a/setup.py +++ b/setup.py @@ -133,11 +133,12 @@ def get_version(*file_paths): 'License :: OSI Approved :: GNU Affero General Public License v3', 'Programming Language :: Python', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Topic :: Internet', 'Intended Audience :: Developers', 'Environment :: Web Environment', 'Framework :: Django', - 'Framework :: Django :: 3.2', 'Framework :: Django :: 4.2', ], keywords='Django sites edx', diff --git a/tox.ini b/tox.ini index f93229e..48d3c89 100644 --- a/tox.ini +++ b/tox.ini @@ -1,19 +1,18 @@ [tox] -envlist = python{3.8}-django{32, 42},quality,docs +envlist = python{38,311,312}-django{42},quality,docs [testenv] -setenv = +setenv = PYTHONPATH = {toxinidir} DJANGO_SETTINGS_MODULE = test_settings -deps = - django32: -r requirements/django.txt +deps = django42: -r requirements/django42.txt -r requirements/test.txt -commands = - pytest --cov=django_sites_extensions +commands = + pytest --cov=django_sites_extensions --cov-report=xml [testenv:quality] -commands = +commands = pep8 --config=.pep8 django_sites_extensions pylint --rcfile pylintrc django_sites_extensions python setup.py bdist_wheel