From 74cbf8ec3c39281cdfa8451179d63dd6c80ba161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Felipe=20Casta=C3=B1o?= <78836902+luisfelipec95@users.noreply.github.com> Date: Fri, 9 Feb 2024 10:04:55 -0500 Subject: [PATCH] perf: quince release support (#47) BREAKING CHANGE: add compatibility with Quince release * fix(import): update URLs in favor of re_path for deprecation * perf: update requirements * fix: remove 3.10 version test * perf: update workflows and readme * fix: fix AttributeError to non-string uid * perf: update tests * perf: update codelytv/pr-size-labeler * perf: add django32, django42 file requirements * perf: update Django version constrain * fix: update python test version * perf: update readme and constraints * perf: update constraints * perf: update requirements * perf: update tox --- .github/workflows/bumpversion.yml | 2 +- .github/workflows/labeler.yml | 2 +- .github/workflows/python-publish.yml | 4 +-- .github/workflows/tests.yml | 10 +++--- README.rst | 4 ++- eox_hooks/receivers.py | 2 +- eox_hooks/urls.py | 4 +-- requirements/base.txt | 38 ++++++++++++-------- requirements/constraints.txt | 8 ++--- requirements/django.txt | 1 - requirements/django32.txt | 1 + requirements/django42.txt | 1 + requirements/pip-tools.txt | 8 +++-- requirements/test.txt | 53 ++++++++++++++++------------ requirements/tox.txt | 12 +++---- tox.ini | 5 +-- 16 files changed, 90 insertions(+), 65 deletions(-) delete mode 100644 requirements/django.txt create mode 100644 requirements/django32.txt create mode 100644 requirements/django42.txt diff --git a/.github/workflows/bumpversion.yml b/.github/workflows/bumpversion.yml index db6ab58..6d53e53 100644 --- a/.github/workflows/bumpversion.yml +++ b/.github/workflows/bumpversion.yml @@ -23,7 +23,7 @@ jobs: default_prerelease_bump: false dry_run: true - name: Set up Python 3.8 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.8" - name: Create bumpversion diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index b8025ef..33dda30 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest name: Label the PR size steps: - - uses: CodelyTV/pr-size-labeler@v1 + - uses: CodelyTV/pr-size-labeler@v1.7.0 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} xs_max_size: '10' diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index d518cab..bca001f 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -21,9 +21,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4.1.1 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v4.1.1 with: python-version: '3.10' - name: Install dependencies diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 86390c8..68403ea 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,21 +11,21 @@ jobs: strategy: max-parallel: 2 matrix: - python-version: ["3.8", "3.10", "3.11"] - django: ["32"] + python-version: ["3.8"] + django: ["32", "42"] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v4.1.1 - name: Cache dependency - uses: actions/cache@v3 + uses: actions/cache@v4.0.0 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements/test.txt') }} restore-keys: | ${{ runner.os }}-pip- - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5.0.0 with: python-version: ${{ matrix.python-version }} diff --git a/README.rst b/README.rst index 65b500d..943fcce 100644 --- a/README.rst +++ b/README.rst @@ -27,6 +27,8 @@ Compatibility Notes +-------------------+----------------+ | Palm | >= 5.0 | +-------------------+----------------+ +| Quince | >= 6.0 | ++-------------------+----------------+ The following changes to the plugin settings are necessary. If the release you are looking for is not listed, then the accumulation of changes from previous releases is enough. @@ -86,7 +88,7 @@ not listed, then the accumulation of changes from previous releases is enough. EOX_HOOKS_COURSE_MODES_BACKEND: "eox_hooks.edxapp_wrapper.backends.course_modes_l_v1" EOX_HOOKS_MODELS_BACKEND: "eox_hooks.edxapp_wrapper.backends.models_l_v1" -**Palm** +**Palm and Quince** .. code-block:: yaml diff --git a/eox_hooks/receivers.py b/eox_hooks/receivers.py index 1b0ff76..cbe15ab 100644 --- a/eox_hooks/receivers.py +++ b/eox_hooks/receivers.py @@ -26,7 +26,7 @@ def hooks_handler(sender, signal, **kwargs): trigger_event = None for uid in _get_dispatch_uid(signal.receivers): - if uid.startswith('eox-hooks:'): + if str(uid).startswith('eox-hooks:'): trigger_event = uid.split(':')[1] break diff --git a/eox_hooks/urls.py b/eox_hooks/urls.py index a45e139..6464cc5 100644 --- a/eox_hooks/urls.py +++ b/eox_hooks/urls.py @@ -13,10 +13,10 @@ 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ -from django.conf.urls import url +from django.urls import re_path from eox_hooks import views urlpatterns = [ - url(r'^eox-info$', views.info_view, name='eox-info'), + re_path(r'^eox-info$', views.info_view, name='eox-info'), ] diff --git a/requirements/base.txt b/requirements/base.txt index 92ed9c8..436e583 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.10 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # make upgrade @@ -8,11 +8,16 @@ amqp==5.2.0 # via kombu asgiref==3.7.2 # via django -attrs==23.1.0 +attrs==23.2.0 # via openedx-events +backports-zoneinfo[tzdata]==0.2.1 + # via + # celery + # django + # kombu billiard==4.2.0 # via celery -celery==5.3.5 +celery==5.3.6 # via # -c requirements/constraints.txt # -r requirements/base.in @@ -28,7 +33,7 @@ click-plugins==1.1.1 # via celery click-repl==0.3.0 # via celery -django==3.2.23 +django==4.2.10 # via # -c requirements/constraints.txt # -r requirements/base.in @@ -37,7 +42,7 @@ django==3.2.23 # openedx-events django-crum==0.7.9 # via -r requirements/base.in -djangorestframework==3.12.4 +djangorestframework==3.14.0 # via # -c requirements/constraints.txt # -r requirements/base.in @@ -45,42 +50,45 @@ edx-opaque-keys[django]==2.5.1 # via # -r requirements/base.in # openedx-events -fastavro==1.9.0 +fastavro==1.9.3 # via openedx-events -kombu==5.3.4 +kombu==5.3.5 # via celery -openedx-events==4.1.1 +openedx-events==9.0.0 # via # -c requirements/constraints.txt # -r requirements/base.in pbr==6.0.0 # via stevedore -prompt-toolkit==3.0.41 +prompt-toolkit==3.0.43 # via click-repl pymongo==3.13.0 # via edx-opaque-keys python-dateutil==2.8.2 # via celery -pytz==2022.2.1 +pytz==2022.7.1 # via # -c requirements/constraints.txt - # django + # djangorestframework six==1.16.0 # via python-dateutil sqlparse==0.4.4 # via django stevedore==5.1.0 # via edx-opaque-keys -typing-extensions==4.8.0 +typing-extensions==4.9.0 # via # asgiref # edx-opaque-keys -tzdata==2023.3 - # via celery + # kombu +tzdata==2023.4 + # via + # backports-zoneinfo + # celery vine==5.1.0 # via # amqp # celery # kombu -wcwidth==0.2.10 +wcwidth==0.2.13 # via prompt-toolkit diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 9eb397a..a9fb082 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -11,7 +11,7 @@ # Keep same platform version celery>=5.2.2,<6.0.0 -djangorestframework<3.13.0 -Django<3.3 -openedx-events==4.1.1 -pytz==2022.2.1 +djangorestframework<=3.14.0 +Django<5.0 +openedx-events<=9.0.0 +pytz<=2022.7.1 diff --git a/requirements/django.txt b/requirements/django.txt deleted file mode 100644 index d296127..0000000 --- a/requirements/django.txt +++ /dev/null @@ -1 +0,0 @@ -django==3.2.23 diff --git a/requirements/django32.txt b/requirements/django32.txt new file mode 100644 index 0000000..4fe48cc --- /dev/null +++ b/requirements/django32.txt @@ -0,0 +1 @@ +django==3.2.23 \ No newline at end of file diff --git a/requirements/django42.txt b/requirements/django42.txt new file mode 100644 index 0000000..5ecb3ea --- /dev/null +++ b/requirements/django42.txt @@ -0,0 +1 @@ +Django==4.2.8 \ No newline at end of file diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index a4c5357..0e88226 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.10 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # make upgrade @@ -8,6 +8,8 @@ build==1.0.3 # via pip-tools click==8.1.7 # via pip-tools +importlib-metadata==7.0.1 + # via build packaging==23.2 # via build pip-tools==7.3.0 @@ -19,8 +21,10 @@ tomli==2.0.1 # build # pip-tools # pyproject-hooks -wheel==0.41.3 +wheel==0.42.0 # via pip-tools +zipp==3.17.0 + # 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 e5e7b7d..0a52ba8 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.10 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # make upgrade @@ -12,21 +12,27 @@ asgiref==3.7.2 # via # -r requirements/base.txt # django -astroid==3.0.1 +astroid==3.0.3 # via pylint -attrs==23.1.0 +attrs==23.2.0 # via # -r requirements/base.txt # openedx-events +backports-zoneinfo[tzdata]==0.2.1 + # via + # -r requirements/base.txt + # celery + # django + # kombu billiard==4.2.0 # via # -r requirements/base.txt # celery -celery==5.3.5 +celery==5.3.6 # via # -c requirements/constraints.txt # -r requirements/base.txt -certifi==2023.7.22 +certifi==2024.2.2 # via requests charset-normalizer==3.3.2 # via requests @@ -49,9 +55,9 @@ click-repl==0.3.0 # via # -r requirements/base.txt # celery -coverage==7.3.2 +coverage==7.4.1 # via -r requirements/test.in -dill==0.3.7 +dill==0.3.8 # via pylint # via # -c requirements/constraints.txt @@ -61,7 +67,7 @@ dill==0.3.7 # openedx-events django-crum==0.7.9 # via -r requirements/base.txt -djangorestframework==3.12.4 +djangorestframework==3.14.0 # via # -c requirements/constraints.txt # -r requirements/base.txt @@ -69,15 +75,15 @@ edx-opaque-keys[django]==2.5.1 # via # -r requirements/base.txt # openedx-events -fastavro==1.9.0 +fastavro==1.9.3 # via # -r requirements/base.txt # openedx-events -idna==3.4 +idna==3.6 # via requests -isort==5.12.0 +isort==5.13.2 # via pylint -kombu==5.3.4 +kombu==5.3.5 # via # -r requirements/base.txt # celery @@ -85,7 +91,7 @@ mccabe==0.7.0 # via pylint mock==5.1.0 # via -r requirements/test.in -openedx-events==4.1.1 +openedx-events==9.0.0 # via # -c requirements/constraints.txt # -r requirements/base.txt @@ -93,15 +99,15 @@ pbr==6.0.0 # via # -r requirements/base.txt # stevedore -platformdirs==4.0.0 +platformdirs==4.2.0 # via pylint -prompt-toolkit==3.0.41 +prompt-toolkit==3.0.43 # via # -r requirements/base.txt # click-repl pycodestyle==2.11.1 # via -r requirements/test.in -pylint==3.0.2 +pylint==3.0.3 # via -r requirements/test.in pymongo==3.13.0 # via @@ -111,11 +117,11 @@ python-dateutil==2.8.2 # via # -r requirements/base.txt # celery -pytz==2022.2.1 +pytz==2022.7.1 # via # -c requirements/constraints.txt # -r requirements/base.txt - # django + # djangorestframework requests==2.31.0 # via -r requirements/test.in six==1.16.0 @@ -136,17 +142,20 @@ tomli==2.0.1 # via pylint tomlkit==0.12.3 # via pylint -typing-extensions==4.8.0 +typing-extensions==4.9.0 # via # -r requirements/base.txt # asgiref # astroid # edx-opaque-keys -tzdata==2023.3 + # kombu + # pylint +tzdata==2023.4 # via # -r requirements/base.txt + # backports-zoneinfo # celery -urllib3==2.1.0 +urllib3==2.2.0 # via requests vine==5.1.0 # via @@ -154,7 +163,7 @@ vine==5.1.0 # amqp # celery # kombu -wcwidth==0.2.10 +wcwidth==0.2.13 # via # -r requirements/base.txt # prompt-toolkit diff --git a/requirements/tox.txt b/requirements/tox.txt index 0f5705c..28261f3 100644 --- a/requirements/tox.txt +++ b/requirements/tox.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.10 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # make upgrade @@ -10,7 +10,7 @@ chardet==5.2.0 # via tox colorama==0.4.6 # via tox -distlib==0.3.7 +distlib==0.3.8 # via virtualenv filelock==3.13.1 # via @@ -20,11 +20,11 @@ packaging==23.2 # via # pyproject-api # tox -platformdirs==3.11.0 +platformdirs==4.2.0 # via # tox # virtualenv -pluggy==1.3.0 +pluggy==1.4.0 # via tox pyproject-api==1.6.1 # via tox @@ -32,7 +32,7 @@ tomli==2.0.1 # via # pyproject-api # tox -tox==4.11.3 +tox==4.12.1 # via -r requirements/tox.in -virtualenv==20.24.6 +virtualenv==20.25.0 # via tox diff --git a/tox.ini b/tox.ini index 3f28178..4febc50 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{38,310,311}-django{32} +envlist = py{38,310,311}-django{32,42} [testenv] @@ -10,7 +10,8 @@ envdir= py311: {toxworkdir}/py311 deps = - django32: -r requirements/django.txt + django32: -r requirements/django32.txt + django42: -r requirements/django42.txt -r requirements/test.txt commands =