forked from mborsetti/webchanges
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
98 lines (89 loc) · 2.82 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
# tox.ini file for Tox https://tox.readthedocs.io/en/latest/config.html
# To perform the same tests done in GitHub Actions by CI-CD but locally (i.e. before pushing), run $ tox --parallel
# 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.
# May be run in parallel:
# > tox -p # TODO: this can be unreliable
[tox]
minversion = 3.24.5
envlist =
# pre-commit,
py{310,39,38,37},
post,
docs,
new-install,
skip_missing_interpreters = true
[testenv]
commands =
coverage run --parallel-mode -m pytest
allowlist_externals =
coverage
deps =
-rrequirements.txt
-rtests/requirements_pytest.txt
setenv =
PYTHONPATH = {toxinidir}
PYTHONUTF8 = 1
PYTEST_ADDOPTS = --color=yes
PRE_COMMIT_COLOR = always
# TODO The command below works in Windows only
WEBCHANGES_BROWSER_PATH = C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
passenv =
REDIS_URI
TELEGRAM_TOKEN
sitepackages = true
download = true
skip_install = true
parallel_show_output = true
depends =
# py{310,39,38,37}: pre-commit, new-install
post: py{310,39,38,37}
[testenv:pre-commit]
commands =
pre-commit autoupdate
pre-commit run -a
deps =
-rtests/requirements_pre-commit.txt
-rdocs/requirements.txt
[testenv:post]
# Post-test cleanup
commands =
coverage combine
coverage html --fail-under = 78
# TODO The command below works in Windows only
cmd /c start "" htmlcov/index.html
allowlist_externals =
cmd
coverage
skip_install = true
[testenv:docs]
# Test docs
# We run in Python 3.9 per https://docs.readthedocs.io/en/stable/config-file/v2.html?#build-image
basepython = python3.9
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
deps =
-rrequirements.txt
-rdocs/requirements.txt
[testenv:new-install]
# Settings defined in the top-level testenv section are automatically inherited if not overwritten
# This test emulates a new installation using wheel, ensuring e.g. that all packages are installed
isolated_build = true
# using Python 3.8 because tox fails with 3.7 (does not run pip correctly)
basepython = python3.8
commands =
pip install --upgrade pip setuptools wheel
python setup.py bdist_wheel
pip install --upgrade --find-links={toxinidir}/dist webchanges
webchanges --help
python -c "from pathlib import Path; dir = Path.home().joinpath('Documents').joinpath('webchanges'); [f.unlink() for f in dir.iterdir()]; dir.rmdir()"
# The empty list of deps below overrides top level deps
deps =
setenv = USERPROFILE = {env:TEMP}
download = true
skip_install = true