-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
151 lines (128 loc) · 3.51 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
envlist = py39, lint, build
skip_missing_interpreters = true
[testenv]
whitelist_externals = *
passenv = *
deps = -rrequirements-test.txt
commands = {[testenv:unit]commands}
[gh-actions]
python =
3.9: py39, lint, build
; Trying this from https://github.com/Knewton/python-project-template-with-pip-compile/blob/master/tox.ini
[testenv:pip-compile]
; Run this to `pip-compile` your `requirements*.in` files into `requirements.txt`. Note that
; this will use your default version of python when doing dependency resolution, even though there
; are four other environments in `envlist` above.
deps=
# Note that we require `pip-tools` here, *not* in a `requirements.*` file.
pip-tools
commands=
pip-compile requirements-test.in -o requirements-test.txt
pip-compile requirements.in -o requirements.txt
[testenv:pip-compile-upgrade]
deps=
pip-tools
commands=
pip-compile --upgrade
[testenv:unit]
deps = {[testenv]deps}
commands = pytest {posargs:--cov={envsitepackagesdir}/movie_file_fixer {envsitepackagesdir}/movie_file_fixer src/tests src/movie_file_fixer src/utils}
[testenv:black]
deps = black
commands = black src/movie_file_fixer src/tests
[testenv:flake8]
deps = flake8
commands = flake8 src/movie_file_fixer src/tests
[testenv:pylint]
deps = pylint
commands = pylint -E -d not-callable,no-self-argument,no-member,no-value-for-parameter,method-hidden src/movie_file_fixer
[testenv:isort]
deps = isort
commands = isort --recursive src/movie_file_fixer src/tests
[testenv:lint]
deps =
{[testenv:black]deps}
{[testenv:flake8]deps}
{[testenv:pylint]deps}
{[testenv:isort]deps}
commands =
{[testenv:black]commands}
{[testenv:flake8]commands}
{[testenv:pylint]commands}
{[testenv:isort]commands}
[testenv:test]
deps =
{[testenv]deps}
{[testenv:build]deps}
commands =
{[testenv:unit]commands}
{[testenv:build]commands}
[testenv:build]
skip_install = true
deps =
wheel
commands =
rm -rf dist build
python -W ignore setup.py -q sdist bdist_wheel
[testenv:release]
deps =
{[testenv:build]deps}
twine
commands =
{[testenv:build]commands}
twine upload dist/*
# From https://pytest-cov.readthedocs.io/en/latest/tox.html
[testenv:clean]
deps = coverage
skip_install = true
commands =
coverage erase
bash -c "find . | grep -E '(__pycache__)|\.pyc|\.pyo|\.pyd$' | xargs rm -rf"
rm -rf .tox .coverage .cache .egg* *.egg* dist build
[pytest]
addopts =
-v -s
--color=yes
--cov
--cov-append
--cov-report=term-missing
--cov-config=tox.ini
[coverage:report]
show_missing = True
omit =
*/usr/*
*/.tox/*
*/tests/*
[black]
exclude =.tox,env
[flake8]
# F401 - `module` imported but unused
# F811 - redefinition of unused `name` from line `N`
# W503 - line break before a binary operator
# W504 - line break after binary operator
# C901 - function is too complex
# ignore = E226,E302,E41,F401
ignore = F401,F811,W503,W504,C901
max-line-length = 250
max-complexity = 10
exclude = .tox,env
[pylint]
exclude = .tox,env
[isort]
multi_line_output=3
include_trailing_comma=True
line_length=1000
default_section = THIRDPARTY
known_first_party = movie_file_fixer
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
; #exclude = .tox,env
[report]
omit =
*/usr/*
*/.tox/*
*/tests/*