diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbc6948..8a691a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,31 +13,34 @@ jobs: strategy: matrix: os: [ubuntu-20.04] - python-version: ['3.8'] - toxenv: [django32, django42, docs, quality] + python-version: + - '3.8' + - '3.11' + - '3.12' + toxenv: [django42, docs, quality] steps: - - uses: actions/checkout@v4 - - name: setup python - uses: actions/setup-python@v4 - 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 - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true + - uses: actions/checkout@v4 + - name: setup python + uses: actions/setup-python@v4 + 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 + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true diff --git a/docs/conf.py b/docs/conf.py index 058a4d3..45f5478 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -46,7 +46,7 @@ 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.ifconfig', - 'sphinxcontrib.napoleon' + 'sphinx.ext.napoleon' ] # A list of warning types to suppress arbitrary warning messages. diff --git a/requirements/ci.txt b/requirements/ci.txt index 0a99169..ed1e0e0 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -12,11 +12,11 @@ colorama==0.4.6 # via tox distlib==0.3.8 # via virtualenv -filelock==3.13.1 +filelock==3.13.3 # via # tox # virtualenv -packaging==23.2 +packaging==24.0 # via # pyproject-api # tox @@ -34,7 +34,7 @@ tomli==2.0.1 # via # pyproject-api # tox -tox==4.13.0 +tox==4.14.2 # via -r requirements/ci.in virtualenv==20.25.1 # via diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt index 96cc5db..e3bf8ea 100644 --- a/requirements/common_constraints.txt +++ b/requirements/common_constraints.txt @@ -21,3 +21,12 @@ elasticsearch<7.14.0 # django-simple-history>3.0.0 adds indexing and causes a lot of migrations to be affected django-simple-history==3.0.0 + +# opentelemetry requires version 6.x at the moment: +# https://github.com/open-telemetry/opentelemetry-python/issues/3570 +# Normally this could be added as a constraint in edx-django-utils, where we're +# adding the opentelemetry dependency. However, when we compile pip-tools.txt, +# that uses version 7.x, and then there's no undoing that when compiling base.txt. +# So we need to pin it globally, for now. +# Ticket for unpinning: https://github.com/openedx/edx-lint/issues/407 +importlib-metadata<7 diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 194646a..eedab7d 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -10,3 +10,8 @@ # This file contains all common constraints for edx-repos -c 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/dev.txt b/requirements/dev.txt index db21058..499c30a 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -4,14 +4,16 @@ # # make upgrade # -asgiref==3.7.2 +asgiref==3.8.1 # via django astroid==3.1.0 # via # pylint # pylint-celery -backports-zoneinfo==0.2.1 - # via django +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt + # django cachetools==5.3.3 # via tox certifi==2024.2.2 @@ -31,7 +33,7 @@ click==8.1.7 # edx-lint click-log==0.4.0 # via edx-lint -code-annotations==1.6.0 +code-annotations==1.7.0 # via edx-lint colorama==0.4.6 # via tox @@ -43,7 +45,7 @@ dill==0.3.8 # via pylint distlib==0.3.8 # via virtualenv -django==4.2.10 +django==4.2.11 # via # -c requirements/common_constraints.txt # -r requirements/quality.in @@ -54,23 +56,28 @@ edx-i18n-tools==1.3.0 # via -r requirements/dev.in edx-lint==5.3.6 # via -r requirements/quality.in -filelock==3.13.1 +filelock==3.13.3 # via # tox # virtualenv idna==3.6 # via requests -importlib-metadata==7.0.1 +importlib-metadata==6.11.0 # via + # -c requirements/common_constraints.txt # keyring # twine -importlib-resources==6.1.2 +importlib-resources==6.4.0 # via keyring isort==5.13.2 # via # -r requirements/quality.in # pylint -jaraco-classes==3.3.1 +jaraco-classes==3.4.0 + # via keyring +jaraco-context==4.3.0 + # via keyring +jaraco-functools==4.0.0 # via keyring jeepney==0.8.0 # via @@ -80,9 +87,9 @@ jinja2==3.1.3 # via # code-annotations # diff-cover -keyring==24.3.1 +keyring==25.0.0 # via twine -lxml==5.1.0 +lxml==5.2.0 # via edx-i18n-tools markdown-it-py==3.0.0 # via rich @@ -93,10 +100,12 @@ 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==23.2 +packaging==24.0 # via # pyproject-api # tox @@ -104,7 +113,7 @@ path==16.10.0 # via edx-i18n-tools pbr==6.0.0 # via stevedore -pkginfo==1.9.6 +pkginfo==1.10.0 # via twine platformdirs==4.2.0 # via @@ -120,7 +129,7 @@ polib==1.2.0 # via edx-i18n-tools 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 @@ -182,7 +191,7 @@ tomli==2.0.1 # tox tomlkit==0.12.4 # via pylint -tox==4.13.0 +tox==4.14.2 # via -r requirements/dev.in twine==5.0.0 # via -r requirements/dev.in @@ -200,9 +209,9 @@ virtualenv==20.25.1 # via # -r requirements/dev.in # tox -wheel==0.42.0 +wheel==0.43.0 # via -r requirements/dev.in -zipp==3.17.0 +zipp==3.18.1 # via # importlib-metadata # importlib-resources diff --git a/requirements/doc.txt b/requirements/doc.txt index 318a15a..7ca3ff9 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -8,14 +8,16 @@ accessible-pygments==0.0.4 # via pydata-sphinx-theme alabaster==0.7.13 # via sphinx -asgiref==3.7.2 +asgiref==3.8.1 # via django babel==2.14.0 # via # pydata-sphinx-theme # sphinx -backports-zoneinfo==0.2.1 - # via django +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt + # django beautifulsoup4==4.12.3 # via pydata-sphinx-theme certifi==2024.2.2 @@ -26,7 +28,7 @@ charset-normalizer==3.3.2 # via requests cryptography==42.0.5 # via secretstorage -django==4.2.10 +django==4.2.11 # via # -c requirements/common_constraints.txt # -r requirements/doc.in @@ -43,14 +45,19 @@ idna==3.6 # via requests imagesize==1.4.1 # via sphinx -importlib-metadata==7.0.1 +importlib-metadata==6.11.0 # via + # -c requirements/common_constraints.txt # keyring # sphinx # twine -importlib-resources==6.1.2 +importlib-resources==6.4.0 # via keyring -jaraco-classes==3.3.1 +jaraco-classes==3.4.0 + # via keyring +jaraco-context==4.3.0 + # via keyring +jaraco-functools==4.0.0 # via keyring jeepney==0.8.0 # via @@ -58,7 +65,7 @@ jeepney==0.8.0 # secretstorage jinja2==3.1.3 # via sphinx -keyring==24.3.1 +keyring==25.0.0 # via twine markdown-it-py==3.0.0 # via rich @@ -67,20 +74,22 @@ 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==23.2 +packaging==24.0 # via # pydata-sphinx-theme # sphinx pbr==6.0.0 # via stevedore -pkginfo==1.9.6 +pkginfo==1.10.0 # via twine pockets==0.9.1 # via sphinxcontrib-napoleon -pycparser==2.21 +pycparser==2.22 # via cffi pydata-sphinx-theme==0.14.4 # via sphinx-book-theme @@ -159,7 +168,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/pip-tools.txt b/requirements/pip-tools.txt index 8528adb..6401f54 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -4,15 +4,17 @@ # # make upgrade # -build==1.1.1 +build==1.2.1 # via pip-tools click==8.1.7 # via pip-tools -importlib-metadata==7.0.1 - # via build -packaging==23.2 +importlib-metadata==6.11.0 + # via + # -c requirements/common_constraints.txt + # build +packaging==24.0 # via build -pip-tools==7.4.0 +pip-tools==7.4.1 # via -r requirements/pip-tools.in pyproject-hooks==1.0.0 # via @@ -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 6665603..cf44902 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 2d63b76..392c5ed 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -4,14 +4,16 @@ # # make upgrade # -asgiref==3.7.2 +asgiref==3.8.1 # via django astroid==3.1.0 # via # pylint # pylint-celery -backports-zoneinfo==0.2.1 - # via django +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt + # django click==8.1.7 # via # click-log @@ -19,11 +21,11 @@ click==8.1.7 # edx-lint click-log==0.4.0 # via edx-lint -code-annotations==1.6.0 +code-annotations==1.7.0 # via edx-lint dill==0.3.8 # via pylint -django==4.2.10 +django==4.2.11 # via # -c requirements/common_constraints.txt # -r requirements/quality.in diff --git a/requirements/test.txt b/requirements/test.txt index 9dd8b7c..6aad064 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -4,7 +4,7 @@ # # make upgrade # -coverage[toml]==7.4.3 +coverage[toml]==7.4.4 # via pytest-cov ddt==1.3.1 # via -r requirements/test.in @@ -12,15 +12,15 @@ exceptiongroup==1.2.0 # via pytest iniconfig==2.0.0 # via pytest -packaging==23.2 +packaging==24.0 # via pytest pluggy==1.4.0 # via pytest -pytest==8.0.2 +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 diff --git a/setup.py b/setup.py index 514802d..22cbc5d 100644 --- a/setup.py +++ b/setup.py @@ -49,16 +49,16 @@ def get_version(*file_paths): classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', - 'Framework :: Django :: 3.0', - 'Framework :: Django :: 3.1', - 'Framework :: Django :: 3.2', + 'Framework :: Django :: 4.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', 'Natural Language :: English', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', ], extras_require={ - 'Django': ['Django>=3.0,<3.3'], + 'Django': ['Django>=4.2,<4.3'], } ) diff --git a/tox.ini b/tox.ini index ae42f34..b838493 100644 --- a/tox.ini +++ b/tox.ini @@ -1,53 +1,54 @@ [tox] -envlist = py38-django{32,42}, docs, quality +envlist = py{38, 311,312}-django{42}, docs, quality [pytest] addopts = --cov web_fragments --cov-report term-missing --cov-report xml [testenv] -deps = - django32: Django>=3.2,<3.3 - django42: Django>=4.2,<4.3 - -r{toxinidir}/requirements/test.txt -setenv = - DJANGO_SETTINGS_MODULE = test_settings -commands = - python -Wd -m pytest {posargs} +deps = + django42: Django>=4.2,<4.3 + -r{toxinidir}/requirements/test.txt +setenv = + DJANGO_SETTINGS_MODULE = test_settings +commands = + python -Wd -m pytest {posargs} [testenv:docs] setenv = - DJANGO_SETTINGS_MODULE = test_settings - PYTHONPATH = {toxinidir} -allowlist_externals = - make - rm + DJANGO_SETTINGS_MODULE = test_settings + PYTHONPATH = {toxinidir} +allowlist_externals = + make + rm deps = - -r{toxinidir}/requirements/doc.txt -commands = - doc8 --ignore-path docs/_build README.rst docs - rm -f docs/web_fragments.rst - rm -f docs/modules.rst - make -C docs clean - make -C docs html - python setup.py bdist_wheel - twine check dist/* + setuptools + wheel + -r{toxinidir}/requirements/doc.txt +commands = + doc8 --ignore-path docs/_build README.rst docs + rm -f docs/web_fragments.rst + rm -f docs/modules.rst + make -C docs clean + make -C docs html + python setup.py bdist_wheel + twine check dist/* [testenv:quality] -setenv = - DJANGO_SETTINGS_MODULE = test_settings - PYTHONPATH = {toxinidir} -allowlist_externals = - make - rm - touch -deps = - -r{toxinidir}/requirements/doc.txt - -r{toxinidir}/requirements/quality.txt - -r{toxinidir}/requirements/test.txt -commands = - touch web_fragments/tests/__init__.py - pylint web_fragments - rm web_fragments/tests/__init__.py - isort --check-only web_fragments manage.py setup.py test_settings.py - make help +setenv = + DJANGO_SETTINGS_MODULE = test_settings + PYTHONPATH = {toxinidir} +allowlist_externals = + make + rm + touch +deps = + -r{toxinidir}/requirements/doc.txt + -r{toxinidir}/requirements/quality.txt + -r{toxinidir}/requirements/test.txt +commands = + touch web_fragments/tests/__init__.py + pylint web_fragments + rm web_fragments/tests/__init__.py + isort --check-only web_fragments manage.py setup.py test_settings.py + make help diff --git a/web_fragments/__init__.py b/web_fragments/__init__.py index b6d7ebf..feadaae 100644 --- a/web_fragments/__init__.py +++ b/web_fragments/__init__.py @@ -1,4 +1,4 @@ """ Web fragments. """ -__version__ = '2.1.0' +__version__ = '2.2.0'