-
Notifications
You must be signed in to change notification settings - Fork 731
/
tox.ini
216 lines (162 loc) · 6.14 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
[tox]
envlist =
# Envs to build
{win,lin,mac}-{py36,py37,py38,py39,py310,py311,py312}-{pyqt6,pyside6,pyqt5,pyside2}-{build,test}
# Envs for metrics and development
{win,lin,mac}-{py38}-{lint,safety,metric,develop,doc,release}
# Docs with screenshots
{win,lin,mac}-{py38}-{pyqt5,pyside2}-{doc}
skip_missing_interpreters =
true
[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
develop: -rreq-develop.txt
doc: -rreq-doc.txt
release: -rreq-release.txt
# basic dependencies for each env
pyqt5: pyqt5
pyqt6: pyqt6
pyside2: pyside2
pyside6: pyside6
whitelist_externals =
# non python dependencies
qmake
doc: make
doc: latexpdf
changedir=
doc: docs
commands =
# check dependencies
pip check
# list all deps
pip list
# BUILD ------------------------------------------------------------------
# update resources
build: python qdarkstyle/utils
# try generate build
build: python setup.py sdist bdist_wheel
# try install with pip
build: pip install .
# get some info
build: python -m qdarkstyle --all
# need to run the interface to certify the build, run example
pyqt5-build: python -m qdarkstyle.example --qt_from=pyqt5 --test --offscreen
pyqt5-build: python -m qdarkstyle.example --qt_from=pyqt6 --test --offscreen
pyside2-build: python -m qdarkstyle.example --qt_from=pyside2 --test --offscreen
pyside2-build: python -m qdarkstyle.example --qt_from=pyside6 --test --offscreen
# 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"
pyqt5-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 "./qdarkstyle"
# lint: mypy --config-file="tox.ini" "qdarkstyle"
# Code and doc linting
lint: pylint -r y --rcfile="pylint.ini" "./qdarkstyle" --disable="R1260,R0912"
# Doc linting
lint: pydocstyle --config="tox.ini" "."
lint: doc8 --ignore="D002,D004" --config="tox.ini" "."
# Safety
safety: safety check
safety: bandit --recursive qdarkstyle
# Code metrics
metric: radon cc -a qdarkstyle --exclude="*/ui/*"
metric: radon mi qdarkstyle --exclude="*/ui/*"
metric: radon raw -s qdarkstyle --exclude="*/ui/*"
metric: radon hal -f qdarkstyle --exclude="*/ui/*"
# DOC (inside docs folder) ----------------------------------------------
# Documentation - generate apidocs, build html, build latex, build pdf
doc: sphinx-apidoc --private --separate --force --module-first -o "reference" "{toxworkdir}/../qdarkstyle" "{toxworkdir}/../qdarkstyle/example/ui/*"
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/*
# try upload in test platform before the official
# release: twine upload --repository-url https://test.pypi.org/legacy/ dist/*
# release: pip install --index-url https://test.pypi.org/simple/ qdarkstyle
# upload to official
# release: twine upload dist/*
# release: pip uninstall qdarkstyle
# release: pip install qdarkstyle
usedevelop =
develop: true
# BANDIT #####################################################################
[bandit]
skips: B607,B404 # Related to call module
# 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-qdarkstyle]
ignore_missing_imports = True
[mypy-jsonpickle]
ignore_missing_imports = True