From 54cecd6c3453db053d0d47331674b5e81cf7a54f Mon Sep 17 00:00:00 2001 From: Salman Nawaz Date: Wed, 21 Jun 2023 13:53:21 +0500 Subject: [PATCH 1/2] fix: update for django 4.2, update changelog. --- .github/workflows/ci.yml | 4 ++-- CHANGELOG.rst | 4 ++++ edx_when/__init__.py | 2 -- edx_when/urls.py | 4 ++-- setup.py | 1 + tests/test_api.py | 8 ++++++++ tox.ini | 29 +++++++++++++++-------------- 7 files changed, 32 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 349f49e..cf1f995 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: [quality, docs, pii_check, django32, django40] + toxenv: [quality, docs, pii_check, django32, django40, django42] steps: - uses: actions/checkout@v2 @@ -36,7 +36,7 @@ jobs: run: tox - name: Run Coverage - if: matrix.python-version == '3.8' && matrix.toxenv=='django32' + if: matrix.python-version == '3.8' && matrix.toxenv=='django42' uses: codecov/codecov-action@v1 with: flags: unittests diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 540e397..d8a322b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -17,6 +17,10 @@ Unreleased * Switch from ``edx-sphinx-theme`` to ``sphinx-book-theme`` since the former is deprecated +[2.4.0] - 2023-06-21 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +* Support added for Django 4.2 + [2.3.0] - 2022-02-15 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Added Django40 support diff --git a/edx_when/__init__.py b/edx_when/__init__.py index 6872a06..e82de10 100644 --- a/edx_when/__init__.py +++ b/edx_when/__init__.py @@ -3,5 +3,3 @@ """ __version__ = '2.3.0' - -default_app_config = 'edx_when.apps.EdxWhenConfig' # pylint: disable=invalid-name diff --git a/edx_when/urls.py b/edx_when/urls.py index 3bfd6fa..5917cbe 100644 --- a/edx_when/urls.py +++ b/edx_when/urls.py @@ -3,14 +3,14 @@ """ from django.conf import settings -from django.conf.urls import url +from django.urls import re_path from . import views app_name = 'edx_when' urlpatterns = [ - url( + re_path( r'edx_when/course/{}'.format(settings.COURSE_ID_PATTERN), views.CourseDates.as_view(), name='course_dates' diff --git a/setup.py b/setup.py index d5c7b5a..5cc223a 100644 --- a/setup.py +++ b/setup.py @@ -125,6 +125,7 @@ def is_requirement(line): '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', diff --git a/tests/test_api.py b/tests/test_api.py index a6f6ef3..779985d 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -9,6 +9,7 @@ import ddt from django.contrib import auth from django.test import TestCase +from django.urls import reverse from edx_django_utils.cache.utils import TieredCache from opaque_keys.edx.locator import CourseLocator @@ -577,6 +578,13 @@ def test_set_date_for_block_query_counts(self): with self.assertNumQueries(1): api.set_date_for_block(*args) + def test_api_view(self): + """ + This test just for meeting code-coverage. + """ + response = self.client.get(reverse('course_dates')) + self.assertEqual(response.status_code, 403) + class ApiWaffleTests(TestCase): """ diff --git a/tox.ini b/tox.ini index 759e587..d273a25 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38-django{32,40}, pii_check, quality, docs +envlist = py38-django{32,40,42}, pii_check, quality, docs [doc8] max-line-length = 120 @@ -18,24 +18,25 @@ addopts = --cov edx_when --cov-report term-missing --cov-report xml norecursedirs = .* docs requirements [testenv] -deps = +deps = django32: Django>=3.2,<4.0 django40: Django>=4.0,<4.1 + django42: Django>=4.2,<4.3 -r{toxinidir}/requirements/test.txt -commands = +commands = python -Wd -m pytest {posargs} [testenv:docs] -setenv = +setenv = DJANGO_SETTINGS_MODULE = test_settings PYTHONPATH = {toxinidir} -whitelist_externals = +whitelist_externals = make rm twine -deps = +deps = -r{toxinidir}/requirements/doc.txt -commands = +commands = doc8 --ignore-path docs/_build README.rst docs rm -f docs/edx_when.rst rm -f docs/modules.rst @@ -45,16 +46,16 @@ commands = twine check dist/* [testenv:quality] -setenv = +setenv = DJANGO_SETTINGS_MODULE = test_settings PYTHONPATH = {toxinidir} -whitelist_externals = +whitelist_externals = make rm touch -deps = +deps = -r{toxinidir}/requirements/quality.txt -commands = +commands = touch tests/__init__.py pylint edx_when tests test_utils manage.py setup.py rm tests/__init__.py @@ -64,11 +65,11 @@ commands = make selfcheck [testenv:pii_check] -setenv = +setenv = DJANGO_SETTINGS_MODULE = test_settings -deps = +deps = -r{toxinidir}/requirements/test.txt django32: Django>=3.2,<4.0 -commands = +commands = code_annotations django_find_annotations --config_file .pii_annotations.yml --lint --report --coverage From 4f2cf2f1525af9a7760ab1fe04a8c87d566759fc Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Fri, 23 Jun 2023 17:23:00 +0500 Subject: [PATCH 2/2] chore: bump the version. --- edx_when/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edx_when/__init__.py b/edx_when/__init__.py index e82de10..1e688a5 100644 --- a/edx_when/__init__.py +++ b/edx_when/__init__.py @@ -2,4 +2,4 @@ Central source of course block dates for the LMS. """ -__version__ = '2.3.0' +__version__ = '2.4.0'