-
Notifications
You must be signed in to change notification settings - Fork 3
/
tox.ini
223 lines (166 loc) · 5.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
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
[tox]
envlist =
# Envs to build
{linux, darwin, win32}-{py39}-{build}-{pyqt5,pyside2}
# Envs for metrics and development
{linux}-{py39}-{lint}
{linux}-{py39}-{safety}
{linux}-{py39}-{metric}
{linux}-{py39}-{doc}
{linux}-{py39}-{release}
skip_missing_interpreters =
true
[gh-actions]
python =
3.9: py39
[gh-actions:env]
PLATFORM =
ubuntu-latest: linux
macos-latest: darwin
windows-latest: win32
TASK =
build: build
lint: lint
safety: safety
metric: metric
doc: doc
release: release
[testenv]
platform =
# platforms to run
win: win32
lin: linux
mac: osx
deps =
build: -rreq-stable.txt
test: -rreq-test.txt
lint: -rreq-test.txt
safety: -rreq-test.txt
metric: -rreq-test.txt
doc: -rreq-doc.txt
release: -rreq-release.txt
# basic dependencies for each env
pyqt: pyqt4
pyqt5: pyqt5
pyside: pyside
pyside2: pyside2
whitelist_externals =
# non python dependencies
qmake
doc: make
doc: latexpdf
changedir=
doc: docs
commands =
python -m pip install --upgrade pip
# check depedencies
pip check
# list all deps
pip list
# BUILD ------------------------------------------------------------------
# try generate build
build: python setup.py sdist bdist_wheel
# try install with pip
build: pip install .
# get some info
build: python -m qrainbowstyle --all
# need to run the interface to certify the build, run example
build-pyqt5: python example/example.py --qt_from=pyqt5 --test
build-pyside2: python example/example.py --qt_from=pyside2 --test
# 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"
test: pytest --cov
# 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" "."
# lint: pyflakes "./qrainbowstyle"
# lint: mypy --config-file="tox.ini" "qrainbowstyle"
# Code and doc linting
lint: pylint -r y --rcfile="pylint.ini" "./qrainbowstyle" --disable="R1260,R0912" --exit-zero
# Doc linting
lint: pydocstyle --config="tox.ini" "."
lint: doc8 --ignore="D002,D004" --config="tox.ini" "."
# Safety
safety: safety check
safety: bandit --recursive qrainbowstyle
# Code metrics
metric: radon cc -a qrainbowstyle --exclude="*/ui/*" --exclude="*/styles/*"
metric: radon mi qrainbowstyle --exclude="*/ui/*" --exclude="*/styles/*"
metric: radon raw -s qrainbowstyle --exclude="*/ui/*" --exclude="*/styles/*"
metric: radon hal -f qrainbowstyle --exclude="*/ui/*" --exclude="*/styles/*"
# DOC (inside docs folder) ----------------------------------------------
# Documentation - generate apidocs, build html, build latex, build pdf
doc: sphinx-apidoc --private --separate --force --module-first -o "example" "{toxworkdir}/../example" "{toxworkdir}/../example/ui/*"
doc: sphinx-apidoc --private --separate --force --module-first -o "reference" "{toxworkdir}/../qrainbowstyle"
doc: sphinx-apidoc --private --separate --force --module-first -o "scripts" "{toxworkdir}/../scripts"
doc: sphinx-build -b html -j auto -E -d "{toxworkdir}/../build/docs/doctrees" . "{toxworkdir}/../build/docs/html"
# RELEASE -------------------------------------------------------------------------------
# Try to use re-ver package
release: python setup.py clean --all
release: python setup.py sdist bdist_wheel
release: python setup.py check -s -r # even deprecated, shows better error messages that are passing in twine
release: twine check dist/*
usedevelop =
develop: true
# PYCODESTYLE ################################################################
[pycodestyle]
ignore = E501,C0301,W503,W504 # Issue: in travis shows W504, local W503 the same line
max-line-length = 150
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,
style_rc.py,mw_for_ui_tests.py,test.py
# PYDOCSTYLE #################################################################
[pydocstyle]
ignore = D107,D200,D202,D203,D212,D213,D406,D407,D413
match-dir = "[^\.].*,!(docs),!(venv)"
match = "!style_rc.py"
# DOC8 #######################################################################
[doc8]
extension = .rst
ignore = D002,D004 # problems in Windows fyle system, issue. Also, it just works with the first ignored code
max-line-length = 150
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
# MYPY #######################################################################
[mypy]
# general configuration
[mypy-numpy]
ignore_missing_imports = True
[mypy-qtpy]
ignore_missing_imports = True
[mypy-scipy]
ignore_missing_imports = True
[mypy-pint]
ignore_missing_imports = True
[mypy-pyqtgraph]
ignore_missing_imports = True
[mypy-spyder]
ignore_missing_imports = True
[mypy-networkx]
ignore_missing_imports = True
[mypy-qrainbowstyle]
ignore_missing_imports = True
[mypy-jsonpickle]
ignore_missing_imports = True