forked from canonical/rockcraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
62 lines (56 loc) · 2.53 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
[tox]
env_list = # Environments to run when called with no parameters.
minversion = 4.3.5
# Tox will use these requirements to bootstrap a venv if necessary.
# tox-igore-env-name-mismatch allows us to have one virtualenv for all linting.
# By setting requirements here, we make this INI file compatible with older
# versions of tox. Tox >= 3.8 will automatically provision the version provided
# inside of a virtual environment, so users of Ubuntu >= focal can simply
# install tox from apt. Older than that, the user gets an upgrade warning.
requires =
# renovate: datasource=pypi
tox-ignore-env-name-mismatch==0.2.0.post2
# Allow tox to access the user's $TMPDIR environment variable if set.
# This workaround is required to avoid circular dependencies for TMPDIR,
# since tox will otherwise attempt to use the environment's TMPDIR variable.
user_tmp_dir = {env:TMPDIR}
[testenv] # Default config for all environments. Overridable in each env.
# We have many tests that create temporary files. Unless the user has set a
# TMPDIR, this will prefer putting those temp files in $XDG_RUNTIME_DIR,
# which will speed up those tests since they'll run on a ramdisk.
env_tmp_dir = {user_tmp_dir:{env:XDG_RUNTIME_DIR:{work_dir}}}/tox_tmp/{env_name}
set_env =
TMPDIR={env_tmp_dir}
COVERAGE_FILE={env_tmp_dir}/.coverage_{env_name}
[docs] # Sphinx documentation configuration
deps =
-r requirements-jammy.txt
-r requirements-doc.txt
extras = doc
package = editable
no_package = true
env_dir = {work_dir}/docs
runner = ignore_env_name_mismatch
allowlist_externals = bash
commands_pre =
bash -c 'if [[ ! -e docs ]];then echo "No docs directory. Run `tox run -e sphinx-quickstart` to create one.";return 1;fi'
[testenv:link-docs-pkg]
description =
Use a local (editable) dependency package for documentation rather than the version in requirements.
To run: `tox run -e link-docs-pkg -- [repo_directory]`
base = docs
commands = pip install -e {posargs}
[testenv:build-docs]
description = Build sphinx documentation
base = docs
# "-W" is to treat warnings as errors
commands = sphinx-build -W {posargs:-b html} {tox_root}/docs {tox_root}/docs/_build
[testenv:autobuild-docs]
description = Build documentation with an autoupdating server
base = docs
commands = sphinx-autobuild {posargs: -W -b html --open-browser --port 8080} --watch {tox_root}/rockcraft {tox_root}/docs {tox_root}/docs/_build
[testenv:lint-docs]
description = Lint the documentation with sphinx-lint
base = docs
commands = sphinx-lint --ignore docs/_build -e all {posargs} docs/
labels = lint