-
Notifications
You must be signed in to change notification settings - Fork 9
/
tox.ini
109 lines (95 loc) · 2.34 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
[tox]
min_version = 4
envlist =
flake8
doc8
pydocstyle
docs
black-check
isort-check
build-{lin,mac,win}
coverage
labels =
lint = flake8, doc8, pydocstyle, black-check, isort-check
format = black-format, isort-format
docs = docs
build = build-{lin,mac,win}
test = coverage
publish = publish-{lin,mac,win}
no_package = true
[flake8]
max-line-length = 80
select = C,E,F,W,W504,B,B9
ignore = E203,E501,W503,B905,B906
[doc8]
; Ignore for Windows development
ignore = D004
max-line-length = 80
[testenv]
description = Run test suite with code coverage
platform =
lin: linux
mac: darwin
win: win32
allowlist_externals = coverage
commands = coverage run
coverage report
[testenv:coverage]
; Inherit everything from testenv
[testenv:doc8]
description = Check documentation .rst files
allowlist_externals = doc8
commands = doc8 docs/src
[testenv:flake8]
description = Check code style
allowlist_externals = flake8
commands = flake8 src tests
[testenv:pydocstyle]
description = Check documentation string style
allowlist_externals = pydocstyle
commands = pydocstyle src
[testenv:docs]
description = Build Sphinx documentation
allowlist_externals = sphinx-build
change_dir = docs
commands = sphinx-build -M html src build -W
[testenv:black-check]
description = Check code formatting
allowlist_externals = black
commands = black . --check
[testenv:black-format]
description = Format code
allowlist_externals = black
commands = black .
[testenv:isort-check]
description = Check import sorting
allowlist_externals = isort
commands = isort . --check-only
[testenv:isort-format]
description = Format imports
allowlist_externals = isort
commands = isort .
[testenv:build-{lin,mac,win}]
description = Build and check package
deps = -r requirements/build
allowlist_externals = rm, cmd
commands =
python -m build
twine check --strict dist/*
commands_post =
lin,mac: rm -r dist
win: cmd /c rmdir /s /q dist
[testenv:publish-{lin,mac,win}]
description = Build, check and publish package
deps = -r requirements/build
allowlist_externals = rm, cmd
commands_pre =
lin,mac: rm -rf dist
win: cmd /c if exist dist rmdir /s /q dist
commands =
python -m build
twine check --strict dist/*
twine upload dist/* --config-file .pypirc
commands_post =
lin,mac: rm -r dist
win: cmd /c rmdir /s /q dist