| 1 |
[tox] |
| 2 |
envlist = |
| 3 |
py{38,39,310,311,312}-dj42 |
| 4 |
py{310,311,312}-dj{50,main} |
| 5 |
lint |
| 6 |
sphinx |
| 7 |
readme |
| 8 |
|
| 9 |
[gh-actions] |
| 10 |
python = |
| 11 |
3.8: py38, lint, sphinx, readme |
| 12 |
3.9: py39 |
| 13 |
3.10: py310 |
| 14 |
3.11: py311 |
| 15 |
3.12: py312 |
| 16 |
|
| 17 |
[gh-actions:env] |
| 18 |
DJANGO = |
| 19 |
4.2: dj42 |
| 20 |
5.0: dj50 |
| 21 |
main: djmain |
| 22 |
|
| 23 |
[testenv] |
| 24 |
deps = |
| 25 |
coverage |
| 26 |
dj42: Django>=4.2,<5.0 |
| 27 |
dj50: Django>=5.0,<5.1 |
| 28 |
djmain: https://github.com/django/django/archive/main.tar.gz |
| 29 |
pytest |
| 30 |
pytest-cov |
| 31 |
commands = |
| 32 |
pip install -e . |
| 33 |
pip install -e demo |
| 34 |
# doctests and unit tests |
| 35 |
pytest --cov=django_downloadview --cov=demoproject {posargs} |
| 36 |
# demo project integration tests |
| 37 |
coverage run --append {envbindir}/demo test {posargs: demoproject} |
| 38 |
coverage xml |
| 39 |
pip freeze |
| 40 |
ignore_outcome = |
| 41 |
djmain: True |
| 42 |
|
| 43 |
[testenv:lint] |
| 44 |
deps = |
| 45 |
flake8 |
| 46 |
black |
| 47 |
isort |
| 48 |
commands = |
| 49 |
flake8 demo django_downloadview tests |
| 50 |
black --check demo django_downloadview tests |
| 51 |
isort --check-only --recursive demo django_downloadview tests |
| 52 |
|
| 53 |
[testenv:sphinx] |
| 54 |
deps = |
| 55 |
Sphinx |
| 56 |
commands = |
| 57 |
pip install -e . |
| 58 |
make --directory=docs SPHINXOPTS='-W' clean {posargs:html doctest linkcheck} |
| 59 |
whitelist_externals = |
| 60 |
make |
| 61 |
|
| 62 |
[testenv:readme] |
| 63 |
description = Ensure README renders on PyPI |
| 64 |
deps = twine |
| 65 |
commands = |
| 66 |
{envpython} setup.py -q sdist bdist_wheel |
| 67 |
twine check dist/* |
| 68 |
|
| 69 |
[flake8] |
| 70 |
max-line-length = 88 |
| 71 |
ignore = E203, W503 |
| 72 |
|
| 73 |
[coverage:run] |
| 74 |
source = django_downloadview,demo |
| 75 |
|
| 76 |
[pytest] |
| 77 |
DJANGO_SETTINGS_MODULE = demoproject.settings |
| 78 |
addopts = --doctest-modules --ignore=docs/ |
| 79 |
python_files = tests/*.py |