Skip to content

Commit

Permalink
feat: add python 3.11 and 3.12 support
Browse files Browse the repository at this point in the history
  • Loading branch information
edx-requirements-bot authored and awais786 committed Mar 31, 2024
1 parent 52fc520 commit d11ec93
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 73 deletions.
54 changes: 28 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,33 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [django32, django42, docs, quality]
python-version:
- '3.8'
- '3.11'
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
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
9 changes: 9 additions & 0 deletions requirements/common_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
83 changes: 41 additions & 42 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,53 +1,52 @@
[tox]
envlist = py38-django{32,42}, docs, quality
envlist = py{38, 311}-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
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/*
setenv =
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/*

[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

2 changes: 1 addition & 1 deletion web_fragments/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
Web fragments.
"""
__version__ = '2.1.0'
__version__ = '2.2.0'

0 comments on commit d11ec93

Please sign in to comment.