Skip to content

Commit

Permalink
Merge pull request #151 from PetrDlouhy/tox_testing
Browse files Browse the repository at this point in the history
update tox.ini, use tox testing in GitHub actions
  • Loading branch information
blag committed Jun 4, 2024
2 parents 2ae2103 + a54b6bf commit 46ff271
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 237 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,33 @@ jobs:
# and https://docs.djangoproject.com/en/4.2/faq/install/#what-python-version-can-i-use-with-django
matrix:
include:
- { dj: "4.2.*", py: "3.8" }
- { dj: "4.2.*", py: "3.12" }
- { dj: "5.0.*", py: "3.10" }
- { dj: "5.0.*", py: "3.12" }
- { django: "4.2", python: "3.8" }
- { django: "4.2", python: "3.12" }
- { django: "5.0", python: "3.10" }
- { django: "5.0", python: "3.12" }
- { django: "5.1", python: "3.10" }
- { django: "5.1", python: "3.12" }
fail-fast: false

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
python-version: ${{ matrix.python }}

- name: Install test deps
run: pip install flake8 coverage
run: pip install flake8 tox

- name: Install django
run: pip install django==${{ matrix.dj }}

- name: Install library
run: pip install -e .

# Disabled for now, at some point we'll use black instead
# - name: Lint
# run: flake8 --ignore=E501
- name: Lint
run: flake8 --ignore=E501

- name: Run tests
working-directory: example
run: python -m coverage run manage.py test
run: |
PYTHON_VERSION=`echo ${{ matrix.python }} | sed 's/\.//'`
DJANGO_VERSION=`echo ${{ matrix.django }} | sed 's/\.//'`
tox -e python${PYTHON_VERSION}-django${DJANGO_VERSION}
1 change: 1 addition & 0 deletions example/app/test_msf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

from .models import Book, PROVINCES, STATES, PROVINCES_AND_STATES, ONE, TWO


class MultiSelectTestCase(TestCase):

fixtures = ['app_data.json']
Expand Down
239 changes: 15 additions & 224 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
[tox]
envlist = py{27,34,35,36}-dj{14,15,16,16,17,18,19,110,111},py{34,35,36,37}-dj{14,15,16,16,17,18,19,110,111,20},py{35,36,37}-dj{21,22},py{38}-dj{22},py{36,37,38}-dj{30}
envlist =
python{36,37,38,39,310}-django32,
python{38,39,310}-django40,
python{38,39,310,311}-django41,
python{38,39,310,311,312}-django42,
python{310,311,312}-django50

[testenv]
usedevelop = True
Expand All @@ -11,228 +16,14 @@ commands =
python {envbindir}/coverage run -p example/run_tests.py example.settings_no_debug
install_command =
pip install {opts} {packages}

[testenv:py27-dj14]
basepython = python2.7
deps =
django==1.4.22
pillow==1.7.8
PyYAML==3.10
coveralls==0.3
flake8

[testenv:py27-dj15]
basepython = python2.7
deps =
django==1.5.12
pillow==1.7.8
PyYAML==3.10
coveralls==0.3
flake8

[testenv:py27-dj16]
basepython = python2.7
deps =
django==1.6.11
pillow==1.7.8
PyYAML==3.10
coveralls==0.3
flake8

[testenv:py27-dj17]
basepython = python2.7
deps =
django==1.7.11
pillow==1.7.8
PyYAML==3.10
coveralls==0.3
flake8

[testenv:py27-dj18]
basepython = python2.7
deps =
django==1.8.17
pillow==1.7.8
PyYAML==3.10
coveralls==0.3
flake8

[testenv:py27-dj19]
basepython = python2.7
deps =
django==1.9.12
pillow==1.7.8
PyYAML==3.10
coveralls==0.3
flake8

[testenv:py27-dj110]
basepython = python2.7
deps =
django==1.10.4
pillow==1.7.8
PyYAML==3.10
coveralls==0.3
flake8

[testenv:py27-dj111]
basepython = python2.7
deps =
django==1.11.15
pillow==1.7.8
PyYAML==3.13
coveralls==0.3
flake8

[testenv:py34-dj111]
basepython = python3.4
deps =
django==1.11.15
pillow==2.1.0
PyYAML==3.13
coveralls==0.3
flake8

[testenv:py34-dj20]
basepython = python3.4
deps =
django==2.0.8
pillow==2.1.0
PyYAML==3.13
coveralls==0.3
flake8

[testenv:py35-dj111]
basepython = python3.5
deps =
django==1.11.15
pillow==2.1.0
PyYAML==3.13
coveralls==0.3
flake8

[testenv:py35-dj20]
basepython = python3.5
deps =
django==2.0.8
pillow==2.1.0
PyYAML==3.13
coveralls==0.3
flake8

[testenv:py35-dj21]
basepython = python3.5
deps =
django==2.1.1
pillow==2.1.0
PyYAML==3.13
coveralls==0.3
flake8

[testenv:py35-dj22]
basepython = python3.5
deps =
django==2.2.1
pillow==2.1.0
PyYAML==3.13
coveralls==0.3
flake8

[testenv:py36-dj111]
basepython = python3.6
deps =
django==1.11.15
pillow==2.1.0
PyYAML==3.13
coveralls==0.3
flake8

[testenv:py36-dj20]
basepython = python3.6
deps =
django==2.0.8
pillow==2.1.0
PyYAML==3.13
coveralls==0.3
flake8

[testenv:py36-dj21]
basepython = python3.6
deps =
django==2.1.1
pillow==2.1.0
PyYAML==3.13
coveralls==0.3
flake8

[testenv:py36-dj22]
basepython = python3.6
deps =
django==2.2.1
pillow==2.1.0
PyYAML==3.13
coveralls==0.3
flake8

[testenv:py37-dj20]
basepython = python3.7
deps =
django==2.0.8
pillow==2.1.0
PyYAML==3.13
coveralls==0.3
flake8

[testenv:py37-dj21]
basepython = python3.7
deps =
django==2.1.1
pillow==2.1.0
PyYAML==3.13
coveralls==0.3
flake8

[testenv:py37-dj22]
basepython = python3.7
deps =
django==2.2.1
pillow==2.1.0
PyYAML==3.13
coveralls==0.3
flake8

[testenv:py38-dj22]
basepython = python3.8
deps =
django==2.2.1
pillow==2.1.0
PyYAML==3.13
coveralls==0.3
flake8

[testenv:py36-dj30]
basepython = python3.6
deps =
django==3.0
pillow==2.1.0
PyYAML==3.13
coveralls==0.3
flake8

[testenv:py37-dj30]
basepython = python3.6
deps =
django==3.0
pillow==2.1.0
PyYAML==3.13
coveralls==0.3
flake8

[testenv:py38-dj30]
basepython = python3.8
deps =
django==3.0
pillow==2.1.0
PyYAML==3.13
coveralls==0.3
coveralls
flake8
pillow
PyYAML
django32: django~=3.2
django40: django~=4.0
django41: django~=4.1
django42: django~=4.2
django50: django~=5.0
django51: django>=5.1a1,<5.2

0 comments on commit 46ff271

Please sign in to comment.