-
Notifications
You must be signed in to change notification settings - Fork 2
/
tox.ini
100 lines (87 loc) · 2.22 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
# Sample usage:
# tox --sitepackages -e reformat,mypy,flake8
# tox --sitepackages -e pydocstyle
# tox --sitepackages -e mypy,flake8,pydocstyle
#
# tox -e reformat,mypy,flake8
# tox -e pydocstyle
# tox -e mypy,flake8,pydocstyle
[main]
src_dir=
notebooks
src
[tox]
envlist = reformat,flake8,pydocstyle
[pydocstyle]
match = (?!setup).*\.py
[flake8]
max-line-length = 100
max-complexity = 10
exclude =
build/
.git
__pycache__
.*_cache
examples/
.tox
data/
refdata/
test/data/
test/refdata/
venv/
ignore = E203, W503, E722
per-file-ignores = __init__.py:F401
[isort]
atomic = True
profile = black
line_length = 100
known_smepu=smepu
known_first_party=train,inference
sections=FUTURE,SMEPU,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
# Add heading before every import section
#import_heading_future=Future
#import_heading_stdlib=Standard library
#import_heading_firstparty=My stuff
#import_heading_thirdparty=Third party
#import_heading_localfolder=Local folder
[mypy]
ignore_missing_imports = True
files = **/*.py
[pytest]
addopts =
-v
filterwarnings =
# https://github.com/boto/boto3/issues/1968
ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated
[testenv:reformat]
# Used during development (before committing) to format .py files.
deps =
autoflake
black
isort >= 5
pydocstyle
commands =
autoflake --in-place --recursive --ignore-init-module-imports --remove-unused-variables --remove-all-unused-imports {[main]src_dir}
isort --recursive {[main]src_dir}
black {[main]src_dir}
[testenv:flake8]
deps =
flake8
commands =
flake8 {[main]src_dir}
[testenv:mypy]
deps =
mypy
commands =
mypy --config-file tox.ini {[main]src_dir}
[testenv:pydocstyle]
deps =
pydocstyle
commands =
pydocstyle {[main]src_dir}
[testenv:docs]
description = invoke sphinx-build to build the HTML docs
basepython = python3.7
deps = sphinx >= 1.7.5, < 2
commands = sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs}
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'