-
Notifications
You must be signed in to change notification settings - Fork 14
/
tox.ini
121 lines (108 loc) · 4.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
[tox]
envlist = pyqt,pyqt-piexif,pyqt-pyexiv2,lint,packaging,mypy,mypy-pyqt5
# Standard test suite using pytest
[testenv]
setenv =
cov: PYTEST_ADDOPTS= --cov {envsitepackagesdir}/vimiv --cov-report xml:{toxinidir}/coverage/coverage.xml --cov-report html:{toxinidir}/coverage/html
passenv = PYTHONPATH, CI, USER, HOME, XDG_*, DISPLAY
basepython = {env:PYTHON:python3}
deps =
-r{toxinidir}/misc/requirements/requirements_setup.txt
-r{toxinidir}/misc/requirements/requirements_tests.txt
pyqt: -r{toxinidir}/misc/requirements/requirements_pyqt6.txt
pyqt6: -r{toxinidir}/misc/requirements/requirements_pyqt6.txt
pyqt67: -r{toxinidir}/misc/requirements/requirements_pyqt6.txt
pyqt66: PyQt6==6.6.1
pyqt66: PyQt6-Qt6==6.6.3
pyqt65: PyQt6==6.5.1
pyqt65: PyQt6-Qt6==6.5.3
pyqt64: PyQt6==6.4.2
pyqt64: PyQt6-Qt6==6.4.3
pyqt63: PyQt6==6.3.1
pyqt63: PyQt6-Qt6==6.3.2
pyqt62: PyQt6==6.2.3
pyqt62: PyQt6-Qt6==6.2.4
pyqt5: -r{toxinidir}/misc/requirements/requirements_pyqt5.txt
pyqt515: -r{toxinidir}/misc/requirements/requirements_pyqt5.txt
pyside6: -r{toxinidir}/misc/requirements/requirements_pyside6.txt
cov: -r{toxinidir}/misc/requirements/requirements_cov.txt
piexif: -r{toxinidir}/misc/requirements/requirements_piexif.txt
pyexiv2: -r{toxinidir}/misc/requirements/requirements_pyexiv2.txt
commands_pre = {envpython} scripts/maybe_build_cextension.py
commands = pytest {posargs}
# Linters and checkers for the source code
[testenv:lint]
ignore_errors = true
deps =
-r{toxinidir}/misc/requirements/requirements_setup.txt
-r{toxinidir}/misc/requirements/requirements_pyqt5.txt
-r{toxinidir}/misc/requirements/requirements_pyqt6.txt
-r{toxinidir}/misc/requirements/requirements_piexif.txt
-r{toxinidir}/misc/requirements/requirements_lint.txt
commands =
pylint vimiv scripts/pylint_checkers
{toxinidir}/scripts/lint_tests.py tests
black --check --diff --exclude ".*syntax_error.*" vimiv tests scripts/pylint_checkers
pydocstyle vimiv scripts/pylint_checkers
allowlist_externals =
{toxinidir}/scripts/lint_tests.py
# Check the packaging for best-practices and completeness
[testenv:packaging]
ignore_errors = true
deps =
-r{toxinidir}/misc/requirements/requirements_packaging.txt
commands =
pyroma .
check-manifest
# Check for errors with type annotations
[testenv:mypy{,-pyqt5,-pyqt6,-pyside6}]
passenv = PYTHONPATH, CI, TERM
setenv =
!pyqt5-!pyside6: WRAPPER_ARGS=--always-true=USE_PYQT6 --always-false=USE_PYQT5 --always-false=USE_PYSIDE6
pyqt5: WRAPPER_ARGS=--always-true=USE_PYQT5 --always-false=USE_PYQT6 --always-false=USE_PYSIDE6
pyside6: WRAPPER_ARGS=--always-true=USE_PYSIDE6 --always-false=USE_PYQT5 --always-false=USE_PYQT6
deps =
-r{toxinidir}/misc/requirements/requirements_setup.txt
-r{toxinidir}/misc/requirements/requirements_piexif.txt
-r{toxinidir}/misc/requirements/requirements_mypy.txt
!pyqt5-!pyside6: PyQt6==6.5.1
pyqt5: -r{toxinidir}/misc/requirements/requirements_pyqt5.txt
pyside6: -r{toxinidir}/misc/requirements/requirements_pyside6.txt
commands = mypy {env:WRAPPER_ARGS} vimiv {posargs}
# Create a virtual environment to run the development version
[testenv:mkvenv{,-pyqt5,-pyqt6,-pyside6}]
envdir = {toxinidir}/.venv
usedevelop = true
deps =
!pyqt5-!pyside6: -r{toxinidir}/misc/requirements/requirements_pyqt6.txt
pyqt5: -r{toxinidir}/misc/requirements/requirements_pyqt5.txt
pyside6: -r{toxinidir}/misc/requirements/requirements_pyside6.txt
commands = {envpython} -c ""
# Create a virtual environment to build the documentation
[testenv:docs]
deps =
-r{toxinidir}/misc/requirements/requirements_pyqt6.txt
-r{toxinidir}/misc/requirements/requirements_piexif.txt
-r{toxinidir}/misc/requirements/requirements_docs.txt
commands =
{toxinidir}/scripts/src2rst.py
sphinx-build -b html docs {posargs}
allowlist_externals =
{toxinidir}/scripts/src2rst.py
[testenv:man]
deps = {[testenv:docs]deps}
commands =
{toxinidir}/scripts/src2rst.py
sphinx-build -b man docs misc
allowlist_externals = {[testenv:docs]allowlist_externals}
# Settings for check-manifest
[check-manifest]
ignore =
.*
pytest.ini
tox.ini
mypy.ini
scripts
scripts/*
tests
tests/*