From a336f90f3dd6005744f290d34fac8310438bb931 Mon Sep 17 00:00:00 2001 From: Mohammad Ahtasham ul Hassan Date: Thu, 20 Jan 2022 16:03:38 +0500 Subject: [PATCH] chore: Post Django32 Cleanup --- .github/workflows/ci.yml | 4 +-- CHANGELOG.rst | 7 +++++ edx_rbac/__init__.py | 2 +- edx_rbac/admin/forms.py | 2 +- requirements/doc.txt | 9 +++--- setup.py | 4 +-- tox.ini | 64 +++++++++++++++++++--------------------- 7 files changed, 48 insertions(+), 44 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ab1dd7..4a7fa65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: matrix: os: [ubuntu-20.04] python-version: ['3.8'] - toxenv: [django22, django30, django31, django32, quality] + toxenv: [quality, django32, django40] steps: - uses: actions/checkout@v1 - name: setup python @@ -35,7 +35,7 @@ jobs: run: tox - name: Run Coverage - if: matrix.python-version == '3.8' && matrix.toxenv=='django22' + if: matrix.python-version == '3.8' && matrix.toxenv=='django32' uses: codecov/codecov-action@v1 with: flags: unittests diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1492090..ad39a4f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,13 @@ Change Log Unreleased -------------------- +[2.0.0] - 2022-01-19 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* Drop support for Django<3.2 +* Replacing ugettext with gettext to resolve RemovedInDjango40 error. +* Added Django40 Support + [1.5.1] - 2021-11-01 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/edx_rbac/__init__.py b/edx_rbac/__init__.py index f0b7c8b..8ef0b6a 100644 --- a/edx_rbac/__init__.py +++ b/edx_rbac/__init__.py @@ -2,6 +2,6 @@ Library to help managing role based access controls for django apps. """ -__version__ = '1.5.1' +__version__ = '1.6.0' default_app_config = 'edx_rbac.apps.EdxRbacConfig' # pylint: disable=invalid-name diff --git a/edx_rbac/admin/forms.py b/edx_rbac/admin/forms.py index 9b6fcee..52a5427 100644 --- a/edx_rbac/admin/forms.py +++ b/edx_rbac/admin/forms.py @@ -3,7 +3,7 @@ """ from django import forms -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from edx_rbac.fields import UserFromEmailField diff --git a/requirements/doc.txt b/requirements/doc.txt index ebd2d86..adebba1 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -105,6 +105,8 @@ idna==3.3 # requests imagesize==1.3.0 # via sphinx +importlib-metadata==4.10.1 + # via sphinx iniconfig==1.1.1 # via # -r requirements/test.txt @@ -225,7 +227,7 @@ six==1.16.0 # python-dateutil snowballstemmer==2.2.0 # via sphinx -sphinx==4.3.2 +sphinx==4.4.0 # via # -r requirements/doc.in # edx-sphinx-theme @@ -270,6 +272,5 @@ urllib3==1.26.8 # requests webencodings==0.5.1 # via bleach - -# The following packages are considered to be unsafe in a requirements file: -# setuptools +zipp==3.7.0 + # via importlib-metadata diff --git a/setup.py b/setup.py index 1994655..74ea9f6 100644 --- a/setup.py +++ b/setup.py @@ -120,10 +120,8 @@ def is_requirement(line): classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', - 'Framework :: Django :: 2.2', - 'Framework :: Django :: 3.0', - 'Framework :: Django :: 3.1', 'Framework :: Django :: 3.2', + 'Framework :: Django :: 4.0', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', 'Natural Language :: English', diff --git a/tox.ini b/tox.ini index 8d5e35d..a7d5980 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38-django{22,30,31,32},quality +envlist = py38-django{32,40},quality [doc8] max-line-length = 120 @@ -19,55 +19,53 @@ norecursedirs = .* docs requirements venvs [testenv] deps = - django22: Django>=2.2,<2.3 - django30: Django>=3.0,<3.1 - django31: Django>=3.1,<3.2 - django32: Django>=3.2,<3.3 - -r{toxinidir}/requirements/test.txt + django32: Django>=3.2,<4.0 + django40: Django>=4.0,<4.1 + -r{toxinidir}/requirements/test.txt whitelist_externals = - touch - rm + touch + rm commands = - python -Wd -m pytest {posargs} + python -Wd -m pytest {posargs} [testenv:docs] setenv = - DJANGO_SETTINGS_MODULE = test_settings - PYTHONPATH = {toxinidir} + DJANGO_SETTINGS_MODULE = test_settings + PYTHONPATH = {toxinidir} whitelist_externals = - make - rm + make + rm deps = - -r{toxinidir}/requirements/doc.txt + -r{toxinidir}/requirements/doc.txt commands = - doc8 --ignore-path docs/_build README.rst docs - rm -f docs/edx_rbac.rst - rm -f docs/modules.rst - make -C docs clean - make -C docs html - python setup.py check --restructuredtext --strict + doc8 --ignore-path docs/_build README.rst docs + rm -f docs/edx_rbac.rst + rm -f docs/modules.rst + make -C docs clean + make -C docs html + python setup.py check --restructuredtext --strict [testenv:quality] setenv = - DJANGO_SETTINGS_MODULE = test_settings + DJANGO_SETTINGS_MODULE = test_settings whitelist_externals = - make - rm - touch + make + rm + touch deps = - -r{toxinidir}/requirements/quality.txt + -r{toxinidir}/requirements/quality.txt commands = - pylint edx_rbac tests test_utils manage.py setup.py - pycodestyle edx_rbac tests manage.py setup.py - pydocstyle edx_rbac tests manage.py setup.py - isort --check-only --diff tests test_utils edx_rbac manage.py setup.py test_settings.py - make selfcheck + pylint edx_rbac tests test_utils manage.py setup.py + pycodestyle edx_rbac tests manage.py setup.py + pydocstyle edx_rbac tests manage.py setup.py + isort --check-only --diff tests test_utils edx_rbac manage.py setup.py test_settings.py + make selfcheck [testenv:pii_check] setenv = - DJANGO_SETTINGS_MODULE = test_settings + DJANGO_SETTINGS_MODULE = test_settings deps = - -r{toxinidir}/requirements/test.txt + -r{toxinidir}/requirements/test.txt commands = - code_annotations django_find_annotations --config_file .pii_annotations.yml --lint --report --coverage + code_annotations django_find_annotations --config_file .pii_annotations.yml --lint --report --coverage