From e7704924a671eb1434f3b459b5fb986102e93072 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Thu, 11 Apr 2024 18:24:18 -0400 Subject: [PATCH] build: add support for Python 3.11 (#159) --- .github/workflows/ci.yml | 54 +++++++++++++++---------------- CHANGELOG.rst | 8 +++++ openedx_filters/__init__.py | 2 +- requirements/base.txt | 10 +++--- requirements/ci.txt | 4 +-- requirements/constraints.txt | 4 +-- requirements/dev.txt | 51 +++++++++++++++++++----------- requirements/doc.txt | 61 ++++++++++++++++++++++-------------- requirements/pip-tools.txt | 12 ++++--- requirements/pip.txt | 4 +-- requirements/quality.txt | 40 ++++++++++++++--------- requirements/test.txt | 13 ++++---- tox.ini | 13 ++------ 13 files changed, 160 insertions(+), 116 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c9ae6fe..949098a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,10 +2,10 @@ name: Python CI on: push: - branches: [ main ] + branches: [main] pull_request: branches: - - '**' + - '**' jobs: @@ -15,30 +15,30 @@ jobs: strategy: matrix: os: [ubuntu-20.04] - python-version: ['3.8'] - toxenv: ["py38", "quality", "docs"] + python-version: ['3.8', '3.11'] + toxenv: ["django42", "quality", "docs"] steps: - - uses: actions/checkout@v4 - - name: setup python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install pip - run: pip install -r requirements/pip.txt - - - name: Install Dependencies - run: pip install -r requirements/ci.txt - - - name: Run Tests - env: - TOXENV: ${{ matrix.toxenv }} - run: tox - - - name: Run coverage - if: matrix.python-version == '3.8' && matrix.toxenv == 'py38' - uses: codecov/codecov-action@v3 - with: - flags: unittests - fail_ci_if_error: true + - uses: actions/checkout@v4 + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install pip + run: pip install -r requirements/pip.txt + + - name: Install Dependencies + run: pip install -r requirements/ci.txt + + - name: Run Tests + env: + TOXENV: ${{ matrix.toxenv }} + run: tox + + - name: Run coverage + if: matrix.python-version == '3.8' && matrix.toxenv == 'django42' + uses: codecov/codecov-action@v3 + with: + flags: unittests + fail_ci_if_error: false diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c8439f18..23738901 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,14 @@ Change Log Unreleased ---------- +[1.7.0] - 2024-04-11 +-------------------- + +Added +~~~~~ + +* Add Python 3.11 support. + [1.6.0] - 2023-08-18 -------------------- diff --git a/openedx_filters/__init__.py b/openedx_filters/__init__.py index f2239440..b1b837b5 100644 --- a/openedx_filters/__init__.py +++ b/openedx_filters/__init__.py @@ -3,4 +3,4 @@ """ from openedx_filters.filters import * -__version__ = "1.6.0" +__version__ = "1.7.0" diff --git a/requirements/base.txt b/requirements/base.txt index 6b89c765..bde95399 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -4,15 +4,17 @@ # # make upgrade # -asgiref==3.7.2 - # via django -backports-zoneinfo==0.2.1 +asgiref==3.8.1 # via django +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 sqlparse==0.4.4 # via django -typing-extensions==4.10.0 +typing-extensions==4.11.0 # via asgiref diff --git a/requirements/ci.txt b/requirements/ci.txt index 9f335db1..641296fb 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -12,7 +12,7 @@ colorama==0.4.6 # via tox distlib==0.3.8 # via virtualenv -filelock==3.13.1 +filelock==3.13.4 # via # tox # virtualenv @@ -32,7 +32,7 @@ tomli==2.0.1 # via # pyproject-api # tox -tox==4.14.1 +tox==4.14.2 # via -r requirements/ci.in virtualenv==20.25.1 # via tox diff --git a/requirements/constraints.txt b/requirements/constraints.txt index b727b9d0..79fe34d9 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -11,5 +11,5 @@ # Common constraints for edx repos -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt -# Latest previous version has issues with doc8 because of conflicting docutils constraints -sphinx-book-theme==0.4.0rc1 +# 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 f261d9e9..f2a221d3 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -4,7 +4,7 @@ # # make upgrade # -asgiref==3.7.2 +asgiref==3.8.1 # via # -r requirements/quality.txt # django @@ -13,11 +13,16 @@ astroid==3.1.0 # -r requirements/quality.txt # pylint # pylint-celery -backports-zoneinfo==0.2.1 +backports-tarfile==1.0.0 # via # -r requirements/quality.txt + # jaraco-context +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt + # -r requirements/quality.txt # django -build==1.1.1 +build==1.2.1 # via # -r requirements/pip-tools.txt # pip-tools @@ -54,7 +59,7 @@ click-log==0.4.0 # via # -r requirements/quality.txt # edx-lint -code-annotations==1.6.0 +code-annotations==1.8.0 # via # -r requirements/quality.txt # edx-lint @@ -62,7 +67,7 @@ colorama==0.4.6 # via # -r requirements/ci.txt # tox -coverage[toml]==7.4.3 +coverage[toml]==7.4.4 # via # -r requirements/quality.txt # pytest-cov @@ -96,23 +101,24 @@ exceptiongroup==1.2.0 # via # -r requirements/quality.txt # pytest -filelock==3.13.1 +filelock==3.13.4 # via # -r requirements/ci.txt # tox # virtualenv -idna==3.6 +idna==3.7 # via # -r requirements/quality.txt # requests -importlib-metadata==7.0.2 +importlib-metadata==6.11.0 # via + # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/pip-tools.txt # -r requirements/quality.txt # build # keyring # twine -importlib-resources==6.1.3 +importlib-resources==6.4.0 # via # -r requirements/quality.txt # keyring @@ -124,7 +130,15 @@ isort==5.13.2 # via # -r requirements/quality.txt # pylint -jaraco-classes==3.3.1 +jaraco-classes==3.4.0 + # via + # -r requirements/quality.txt + # keyring +jaraco-context==5.3.0 + # via + # -r requirements/quality.txt + # keyring +jaraco-functools==4.0.0 # via # -r requirements/quality.txt # keyring @@ -138,7 +152,7 @@ jinja2==3.1.3 # -r requirements/quality.txt # code-annotations # diff-cover -keyring==24.3.1 +keyring==25.1.0 # via # -r requirements/quality.txt # twine @@ -162,7 +176,8 @@ more-itertools==10.2.0 # via # -r requirements/quality.txt # jaraco-classes -nh3==0.2.15 + # jaraco-functools +nh3==0.2.17 # via # -r requirements/quality.txt # readme-renderer @@ -201,7 +216,7 @@ pluggy==1.4.0 # tox pycodestyle==2.11.1 # via -r requirements/quality.txt -pycparser==2.21 +pycparser==2.22 # via # -r requirements/quality.txt # cffi @@ -247,7 +262,7 @@ pytest==8.1.1 # -r requirements/quality.txt # pytest-cov # pytest-django -pytest-cov==4.1.0 +pytest-cov==5.0.0 # via -r requirements/quality.txt pytest-django==4.8.0 # via -r requirements/quality.txt @@ -321,11 +336,11 @@ tomlkit==0.12.4 # via # -r requirements/quality.txt # pylint -tox==4.14.1 +tox==4.14.2 # via -r requirements/ci.txt twine==5.0.0 # via -r requirements/quality.txt -typing-extensions==4.10.0 +typing-extensions==4.11.0 # via # -r requirements/quality.txt # asgiref @@ -341,11 +356,11 @@ virtualenv==20.25.1 # via # -r requirements/ci.txt # tox -wheel==0.42.0 +wheel==0.43.0 # via # -r requirements/pip-tools.txt # pip-tools -zipp==3.17.0 +zipp==3.18.1 # via # -r requirements/pip-tools.txt # -r requirements/quality.txt diff --git a/requirements/doc.txt b/requirements/doc.txt index d5d83f4f..205a6b51 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -4,21 +4,28 @@ # # make upgrade # +accessible-pygments==0.0.4 + # via pydata-sphinx-theme alabaster==0.7.13 # via sphinx -asgiref==3.7.2 +asgiref==3.8.1 # via # -r requirements/test.txt # django babel==2.14.0 - # via sphinx -backports-zoneinfo==0.2.1 # via + # pydata-sphinx-theme + # sphinx +backports-tarfile==1.0.0 + # via jaraco-context +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt # -r requirements/test.txt # django beautifulsoup4==4.12.3 # via pydata-sphinx-theme -build==1.1.1 +build==1.2.1 # via -r requirements/doc.in certifi==2024.2.2 # via requests @@ -30,11 +37,11 @@ click==8.1.7 # via # -r requirements/test.txt # code-annotations -code-annotations==1.6.0 +code-annotations==1.8.0 # via -r requirements/test.txt colorama==0.4.6 # via sphinx-autobuild -coverage[toml]==7.4.3 +coverage[toml]==7.4.4 # via # -r requirements/test.txt # pytest-cov @@ -59,23 +66,28 @@ exceptiongroup==1.2.0 # via # -r requirements/test.txt # pytest -idna==3.6 +idna==3.7 # via requests imagesize==1.4.1 # via sphinx -importlib-metadata==7.0.2 +importlib-metadata==6.11.0 # via + # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # build # keyring # sphinx # twine -importlib-resources==6.1.3 +importlib-resources==6.4.0 # via keyring iniconfig==2.0.0 # via # -r requirements/test.txt # pytest -jaraco-classes==3.3.1 +jaraco-classes==3.4.0 + # via keyring +jaraco-context==5.3.0 + # via keyring +jaraco-functools==4.0.0 # via keyring jeepney==0.8.0 # via @@ -86,7 +98,7 @@ jinja2==3.1.3 # -r requirements/test.txt # code-annotations # sphinx -keyring==24.3.1 +keyring==25.1.0 # via twine livereload==2.6.3 # via sphinx-autobuild @@ -99,8 +111,10 @@ markupsafe==2.1.5 mdurl==0.1.2 # via markdown-it-py more-itertools==10.2.0 - # via jaraco-classes -nh3==0.2.15 + # via + # jaraco-classes + # jaraco-functools +nh3==0.2.17 # via readme-renderer packaging==24.0 # via @@ -119,12 +133,13 @@ pluggy==1.4.0 # via # -r requirements/test.txt # pytest -pycparser==2.21 +pycparser==2.22 # via cffi -pydata-sphinx-theme==0.12.0 +pydata-sphinx-theme==0.14.4 # via sphinx-book-theme pygments==2.17.2 # via + # accessible-pygments # doc8 # pydata-sphinx-theme # readme-renderer @@ -137,7 +152,7 @@ pytest==8.1.1 # -r requirements/test.txt # pytest-cov # pytest-django -pytest-cov==4.1.0 +pytest-cov==5.0.0 # via -r requirements/test.txt pytest-django==4.8.0 # via -r requirements/test.txt @@ -151,7 +166,6 @@ pyyaml==6.0.1 # via # -r requirements/test.txt # code-annotations - # sphinx-book-theme readme-renderer==43.0 # via twine requests==2.31.0 @@ -175,7 +189,7 @@ snowballstemmer==2.2.0 # via sphinx soupsieve==2.5 # via beautifulsoup4 -sphinx==5.3.0 +sphinx==6.2.1 # via # -r requirements/doc.in # pydata-sphinx-theme @@ -185,10 +199,8 @@ sphinx==5.3.0 # sphinxcontrib-contentui sphinx-autobuild==2021.3.14 # via -r requirements/doc.in -sphinx-book-theme==0.4.0rc1 - # via - # -c requirements/constraints.txt - # -r requirements/doc.in +sphinx-book-theme==1.0.1 + # via -r requirements/doc.in sphinx-copybutton==0.5.2 # via -r requirements/doc.in sphinxcontrib-applehelp==1.0.4 @@ -232,16 +244,17 @@ tornado==6.4 # via livereload twine==5.0.0 # via -r requirements/doc.in -typing-extensions==4.10.0 +typing-extensions==4.11.0 # via # -r requirements/test.txt # asgiref + # pydata-sphinx-theme # rich urllib3==2.2.1 # via # requests # twine -zipp==3.17.0 +zipp==3.18.1 # via # importlib-metadata # importlib-resources diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 82cca793..748bf44e 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -4,12 +4,14 @@ # # make upgrade # -build==1.1.1 +build==1.2.1 # via pip-tools click==8.1.7 # via pip-tools -importlib-metadata==7.0.2 - # via build +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 @@ -23,9 +25,9 @@ tomli==2.0.1 # build # pip-tools # pyproject-hooks -wheel==0.42.0 +wheel==0.43.0 # via pip-tools -zipp==3.17.0 +zipp==3.18.1 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/pip.txt b/requirements/pip.txt index 66656035..cf449024 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -4,11 +4,11 @@ # # make upgrade # -wheel==0.42.0 +wheel==0.43.0 # via -r requirements/pip.in # The following packages are considered to be unsafe in a requirements file: pip==24.0 # via -r requirements/pip.in -setuptools==69.1.1 +setuptools==69.2.0 # via -r requirements/pip.in diff --git a/requirements/quality.txt b/requirements/quality.txt index d33e2d29..ed6d19ea 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -4,7 +4,7 @@ # # make upgrade # -asgiref==3.7.2 +asgiref==3.8.1 # via # -r requirements/test.txt # django @@ -12,8 +12,11 @@ astroid==3.1.0 # via # pylint # pylint-celery -backports-zoneinfo==0.2.1 +backports-tarfile==1.0.0 + # via jaraco-context +backports-zoneinfo==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # -r requirements/test.txt # django certifi==2024.2.2 @@ -30,11 +33,11 @@ click==8.1.7 # edx-lint click-log==0.4.0 # via edx-lint -code-annotations==1.6.0 +code-annotations==1.8.0 # via # -r requirements/test.txt # edx-lint -coverage[toml]==7.4.3 +coverage[toml]==7.4.4 # via # -r requirements/test.txt # pytest-cov @@ -56,13 +59,14 @@ exceptiongroup==1.2.0 # via # -r requirements/test.txt # pytest -idna==3.6 +idna==3.7 # via requests -importlib-metadata==7.0.2 +importlib-metadata==6.11.0 # via + # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # keyring # twine -importlib-resources==6.1.3 +importlib-resources==6.4.0 # via keyring iniconfig==2.0.0 # via @@ -72,7 +76,11 @@ isort==5.13.2 # via # -r requirements/quality.in # pylint -jaraco-classes==3.3.1 +jaraco-classes==3.4.0 + # via keyring +jaraco-context==5.3.0 + # via keyring +jaraco-functools==4.0.0 # via keyring jeepney==0.8.0 # via @@ -82,7 +90,7 @@ jinja2==3.1.3 # via # -r requirements/test.txt # code-annotations -keyring==24.3.1 +keyring==25.1.0 # via twine markdown-it-py==3.0.0 # via rich @@ -95,8 +103,10 @@ mccabe==0.7.0 mdurl==0.1.2 # via markdown-it-py more-itertools==10.2.0 - # via jaraco-classes -nh3==0.2.15 + # via + # jaraco-classes + # jaraco-functools +nh3==0.2.17 # via readme-renderer packaging==24.0 # via @@ -116,7 +126,7 @@ pluggy==1.4.0 # pytest pycodestyle==2.11.1 # via -r requirements/quality.in -pycparser==2.21 +pycparser==2.22 # via cffi pydocstyle==6.3.0 # via -r requirements/quality.in @@ -143,7 +153,7 @@ pytest==8.1.1 # -r requirements/test.txt # pytest-cov # pytest-django -pytest-cov==4.1.0 +pytest-cov==5.0.0 # via -r requirements/test.txt pytest-django==4.8.0 # via -r requirements/test.txt @@ -195,7 +205,7 @@ tomlkit==0.12.4 # via pylint twine==5.0.0 # via -r requirements/quality.in -typing-extensions==4.10.0 +typing-extensions==4.11.0 # via # -r requirements/test.txt # asgiref @@ -206,7 +216,7 @@ urllib3==2.2.1 # via # requests # twine -zipp==3.17.0 +zipp==3.18.1 # via # importlib-metadata # importlib-resources diff --git a/requirements/test.txt b/requirements/test.txt index 5528c395..8af7660c 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -4,19 +4,20 @@ # # make upgrade # -asgiref==3.7.2 +asgiref==3.8.1 # via # -r requirements/base.txt # django -backports-zoneinfo==0.2.1 +backports-zoneinfo==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # -r requirements/base.txt # django click==8.1.7 # via code-annotations -code-annotations==1.6.0 +code-annotations==1.8.0 # via -r requirements/test.in -coverage[toml]==7.4.3 +coverage[toml]==7.4.4 # via pytest-cov ddt==1.7.2 # via -r requirements/test.in @@ -42,7 +43,7 @@ pytest==8.1.1 # via # pytest-cov # pytest-django -pytest-cov==4.1.0 +pytest-cov==5.0.0 # via -r requirements/test.in pytest-django==4.8.0 # via -r requirements/test.in @@ -62,7 +63,7 @@ tomli==2.0.1 # via # coverage # pytest -typing-extensions==4.10.0 +typing-extensions==4.11.0 # via # -r requirements/base.txt # asgiref diff --git a/tox.ini b/tox.ini index 54d356ec..6c907afe 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{38}, quality, docs, pii_check +envlist = py{38, 311}-django{42}, quality, docs [doc8] @@ -21,7 +21,7 @@ max-doc-length = 120 ; D405 = Section name should be properly capitalized (numpy style) ; D406 = Section name should end with a newline (numpy style) ; D407 = Missing dashed underline after section (numpy style) -; D408 = Section underline should be in the line following the section’s name (numpy style) +; D408 = Section underline should be in the line following the section's name (numpy style) ; D409 = Section underline should match the length of its name (numpy style) ; D410 = Missing blank line after section (numpy style) ; D411 = Missing blank line before section (numpy style) @@ -38,6 +38,7 @@ norecursedirs = .* docs requirements site-packages [testenv] deps = + django42: Django>=4.2,<4.3 -r{toxinidir}/requirements/test.txt commands = pytest {posargs} @@ -68,11 +69,3 @@ deps = -r{toxinidir}/requirements/quality.txt commands = make quality - -[testenv:pii_check] -setenv = - DJANGO_SETTINGS_MODULE = test_utils.test_settings -deps = - -r{toxinidir}/requirements/test.txt -commands = - code_annotations django_find_annotations --config_file .pii_annotations.yml --lint --report --coverage