-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathtox.ini
More file actions
102 lines (91 loc) · 3.18 KB
/
tox.ini
File metadata and controls
102 lines (91 loc) · 3.18 KB
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
# tox.ini file for Tox https://tox.wiki/en/latest/config.html
# To perform the same tests done in GitHub Actions by CI-CD but locally (i.e. before pushing), run $ tox or
# $ tox --parallel # TODO This can be unreliable
# At its core tox provides a convenient way to run arbitrary commands in isolated environments to serve as a single
# entry point for build, test and release activities.
[tox]
requires =
tox>=4.53.0
tox-uv-bare>=1.35.1
env_list =
pre-commit
py{314, 311}-new-install # We install it for the current and lowest version we support
py{314, 313, 312, 311}-pytest
post
docs
skip_missing_interpreters = true
[testenv]
# Settings defined here are automatically inherited by individual environments unless overridden
parallel_show_output = true
pass_env =
REDIS_URI
TELEGRAM_TOKEN
set_env =
PRE_COMMIT_COLOR = always
PYTEST_ADDOPTS = --color=yes
PYTHONPATH = {toxinidir}
PYTHONUTF8 = 1
USERPROFILE = {env:TEMP}
# TODO The command below works in Windows only
WEBCHANGES_BROWSER_PATH = C:\Program Files\Google\Chrome\Application\chrome.exe
[testenv:pre-commit]
# Settings defined in the top-level testenv section are automatically inherited if not overwritten
description = Run pre-commit
deps =
-rtests/requirements_pre-commit.txt
commands =
pre-commit run -a
allowlist_externals =
pre-commit
temp_dir = {work_dir}/.tmp_pre-commit
# skip_install = true
[testenv:new-install]
# Settings defined in the top-level testenv section are automatically inherited if not overwritten
# Empty values are to remove (override) top level
description = Emulate a new installation using wheel, ensuring e.g. that all packages are installed
deps =
uv
commands =
uv build -w
uv pip install --upgrade --find-links={toxinidir}\dist webchanges
python -m webchanges.cli --help
# python -c "from pathlib import Path; dir = Path.home().joinpath('Documents').joinpath('webchanges'); [f.unlink() for f in dir.iterdir()]; dir.rmdir()"
[testenv:pytest]
# Settings defined in the top-level testenv section are automatically inherited if not overwritten
description = Run tests
deps =
-rtests/requirements_pytest.txt
commands =
uv run --no-project pytest -v --cov=./ --cov-report=term --cov-report=xml --browser chromium --browser-channel chrome tests/
depends =
pre-commit
new-install
[testenv:post]
description = Post-tests cleanup for coverage
skip_install = true
deps =
coverage
coverage-conditional-plugin
commands =
coverage combine
# TODO The command below works in Windows only
coverage html
cmd /c if %errorlevel% equ 0 start "" "file://{toxinidir}/post/htmlcov/index.html"
allowlist_externals =
cmd
depends =
py{313, 312, 311, 310}-pytest
[testenv:docs]
description = Docs build
# We run in Python 3.12 to match the default image https://docs.readthedocs.io/en/stable/config-file/v2.html
base_python = python3.12
skip_install = true
deps =
-rdocs/requirements.txt
commands =
sphinx-build -W -j auto docs docs/_build
# TODO The command below works in Windows only
cmd /c if %errorlevel% equ 0 start "" "file://{toxinidir}/docs/_build/index.html"
allowlist_externals =
cmd
sphinx-build