forked from stephenmcd/mezzanine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
82 lines (75 loc) · 1.86 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
[tox]
skip_missing_interpreters = true
envlist =
py{36,37,38,39}-dj{22,30,31,32}
package
lint
[testenv]
# Run test suite
usedevelop = true
deps =
.[testing]
https://github.com/stephenmcd/filebrowser-safe/archive/master.tar.gz#egg=filebrowser_safe
https://github.com/stephenmcd/grappelli-safe/archive/master.tar.gz#egg=grappelli_safe
dj22: Django>=2.2, <3
dj30: Django>=3.0, <3.1
dj31: Django>=3.1, <3.2
dj32: Django>=3.2, <3.3
commands =
pytest --basetemp="{envtmpdir}" --junitxml="junit/TEST-{envname}.xml" {posargs}
[testenv:package]
# Check package integrity and compatibility with PyPI
deps =
twine
check-manifest
skip_install = true
commands =
python setup.py -q sdist --dist-dir="{envtmpdir}/dist"
twine check "{envtmpdir}/dist/*"
check-manifest --ignore-bad-ideas '*.mo' {toxinidir}
[testenv:lint]
skip_install = true
deps = .[codestyle]
commands =
isort --diff --atomic .
black --check .
flake8 .
[testenv:pyupgrade]
# Run pyupgrade with non-zero exit code (notice `+` at the end of command)
skip_install = true
allowlist_externals = sh
deps = .[codestyle]
commands =
sh -c 'find . -path ./.tox -prune -false -o -name "*.py" -exec pyupgrade --py36-plus \{\} +'
[testenv:format]
# This env is not run by default. It's provided here for you to easily
# autoformat code by running `tox -e format`
skip_install = true
allowlist_externals = sh
deps = .[codestyle]
commands =
sh -c 'find . -path ./.tox -prune -false -o -name "*.py" -exec pyupgrade --py36-plus \{\} \;'
isort --atomic .
black .
[flake8]
# Configured to match black
ignore =
E203
W503
E731
max-line-length = 88
exclude =
migrations
.tox
.git
.eggs
*.egg-info
build
dist
[gh-actions]
# Connect GitHub Action matrices with tox envs
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39