Skip to content

Commit

Permalink
update test suite to check all officially maintained django + python …
Browse files Browse the repository at this point in the history
…versions
  • Loading branch information
MarcoGlauser committed Mar 27, 2024
1 parent 0a50fcd commit 8924d72
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 28 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.10", "3.11"]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -28,26 +28,29 @@ jobs:
run: tox
env:
PLATFORM: ${{ matrix.platform }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: coverage-results
name: coverage-results-${{ matrix.python-version }}
path: .coverage.*

coverage:
needs: tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12']
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/checkout@v3
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install coverage
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: coverage-results
name: coverage-results-${{ matrix.python-version }}
- name: Coverage check
run: |
coverage combine
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ classifiers =
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Framework :: Django
Framework :: Django :: 3.2
Framework :: Django :: 4.0
Expand Down
34 changes: 17 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
distribute = False
envlist =
coverage_setup
# Latest
py311-latest{-pyuca,-noi18n}
# Historical Python, Django and DRF versions
py310-previous
# Legacy
py37-legacy
# Package checks
# Currently supported django/python combinations
# https://www.djangoproject.com/download/#supported-versions
py{38,39}-django{32}-{legacy,previous,latest}
py{38,39,310,311,312}-django{42}-{latest}
py{310,311,312}-django{50}-{latest}{-pyuca,-noi18n}
readme
bandit
mypy
Expand All @@ -18,9 +16,11 @@ ignore_basepython_conflict = True

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311, readme, bandit, mypy
3.11: py311
3.12: py312, readme, bandit, mypy

[testenv]
basepython = python3
Expand All @@ -30,14 +30,14 @@ setenv =
DJANGO_SETTINGS_MODULE = django_countries.tests.settings
deps =
coverage
django32: Django>=3.2,<4.0
django42: Django>=4.2,<4.3
django50: Django>=5.0,<5.1
legacy: djangorestframework==3.11.*
previous: djangorestframework==3.14.*
latest: djangorestframework==3.15.*
pyuca,legacy: pyuca
legacy: Django==3.2.*
previous: Django==4.2.*
latest: Django==5.*
latest: graphene-django==3.0.*
latest: graphene-django==3.2.*
depends = coverage_setup
commands = coverage run -m pytest {posargs}

Expand All @@ -50,7 +50,7 @@ commands =
rst2html.py --report=info --halt=warning README.rst /dev/null
rst2html.py --report=info --halt=warning CHANGES.rst /dev/null

[py311-latest-noi18n]
[py311-django50-latest-noi18n]
setenv =
DJANGO_SETTINGS_MODULE = django_countries.tests.settings_noi18n

Expand All @@ -73,9 +73,9 @@ commands = coverage erase
skip_install = True
parallel_show_output = True
depends =
py311-latest{-pyuca,-noi18n}
py310-previous
py37-legacy
py312-django50-latest{-pyuca,-noi18n}
py311-django42-latest
py39-django32-latest
commands =
coverage combine
coverage html
Expand Down

0 comments on commit 8924d72

Please sign in to comment.