-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtox.ini
149 lines (113 loc) · 4.59 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
[tox]
envlist =
# tests without qt binding because they are hard to install via pip
{win,lin,mac}-{py36,py37,py38,py39,py310}-{build}
{win,lin,mac}-{py38}-{doc,release,test,lint,safety,metric,develop}
[testenv]
changedir =
doc: docs
platform =
# Test for Windows, Linux and Mac (if possible, otherwise skip)
win: win32
lin: linux
mac: osx
skip_missing_interpreters =
True
deps =
# Dependencies for each environment
build: -rreq-stable.txt
test: -rreq-test.txt
lint: -rreq-test.txt
safety: -rreq-test.txt
metric: -rreq-test.txt
develop: -rreq-develop.txt
doc: -rreq-doc.txt
release: -rreq-release.txt
# Essential dependencies to run the application must be in the setup.py
whitelist_externals =
doc: make
doc: latexpdf
doc: textlive-full
commands =
# ALL --------------------------------------------------------------------
# try generate build
build: python setup.py sdist bdist_wheel
# try install with pip
build: python -m pip install .
# check depedencies
build: python -m pip check
# TEST -------------------------------------------------------------------
# Those commands commented below correct style problems
# DO NOT RUN ON SERVER, it is just to keep registry for local use
# autopep8 --ignore=E501 --aggressive --aggressive --aggressive --experimental
# docformatter -r -i --wrap-summaries=0 --wrap-descriptions=0 *.py
# eradicate
# Test and coverage
test: pytest --cov "./tests"
# Code and docstring style check, running alone for now - pylama-#156
# test: pylama -v --options="tox.ini" "{toxinidir}"
# Code linting
lint: pycodestyle --config="tox.ini" "."
# test: pyflakes "./helpdev"
# test: mypy --config-file="tox.ini" "helpdev"
# Code and doc linting
lint: pylint -r y --rcfile="pylint.ini" "./inspect_extensions.py" --disable="R1260,R0912"
# Doc linting
lint: pydocstyle --config="tox.ini" "./inspect_extensions.py"
lint: doc8 --config="tox.ini" "./inspect_extensions.py"
# Safety
safety: safety check
safety: bandit --recursive --skip=B404,B603 "./inspect_extensions.py"
# Code metrics
metric: radon cc -a "./inspect_extensions.py"
metric: radon mi "./inspect_extensions.py"
metric: radon raw -s "./inspect_extensions.py"
metric: radon hal -f "./inspect_extensions.py"
# DOC (inside docs folder) ----------------------------------------------
# Documentation - generate apidocs, build html, build latex, build pdf
doc: make clean
doc: sphinx-build -b html -j auto -E -d "." "." "{toxworkdir}/../build/docs/html"
doc: sphinx-build -b latex -j auto -E -d "{toxworkdir}/../build/docs/doctrees" "." "{toxworkdir}/../build/docs/latex"
doc: make --ignore-errors --keep-going --silent -C "{toxworkdir}/../build/docs/latex" all-pdf
# RELEASE ---------------------------------------------------------------
release: python setup.py sdist bdist_wheel
release: twine check dist/*
# try upload in test platform before the oficial
release: twine upload --repository-url https://test.pypi.org/legacy/ dist/*
release: python -m pip install --index-url https://test.pypi.org/simple/ helpdev
# upload to oficial
release: twine upload dist/*
release: python -m pip uninstall helpdev
release: python -m pip install helpdev
usedevelop =
develop: True
# PYCODESTYLE ################################################################
[pycodestyle]
ignore = E501,C0301
max-line-length = 100
statistics = True
count = True
exclude =
.tox,.env,.venv,build,dist,tests,examples,ui,*.egg-info*,*cache*,.coverage,
*/.tox/*,*/.env/*,*/.venv/*,*/build/*,*/dist/*,*/tests/*,*/ui/*,*/*.egg*,
*/.*,*/.coverage,*/./venv/*,./venv,*/docs/*,docs,venv
# PYDOCSTYLE #################################################################
[pydocstyle]
ignore = D107,D202,D203,D213,D406,D407,D413
match-dir="[^\.].*,!(docs),!(venv)"
# DOC8 #######################################################################
[doc8]
extension = .rst
file-encoding = "utf-8"
ignore-path =
.tox,.env,.venv,build,dist,tests,examples,ui,*.egg-info*,*cache*,.coverage,
*/.tox/*,*/.env/*,*/.venv/*,*/build/*,*/dist/*,*/tests/*,*/ui/*,*/*.egg*,
*/.*,*/.coverage,*/./venv/*,./venv
# PYLAMA #####################################################################
[pylama]
format = pylint
linters = pyflakes
skip =
.tox,.env,.venv,build,dist,tests,examples,ui,*.egg-info*,*cache*,.coverage,
*/.tox/*,*/.env/*,*/.venv/*,*/build/*,*/dist/*,*/tests/*,*/ui/*,*/*.egg*,
*/.*,*/.coverage,*/./venv/*,./venv,venv