forked from beeware/beeware
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
80 lines (74 loc) · 3.59 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
# Flake8 doesn't believe in pyproject.toml, so we put the configuration here.
[flake8]
# https://flake8.readthedocs.org/en/latest/
exclude=\
venv*/*,\
local/*,\
docs/*,\
build/*,\
tests/apps/*,\
.eggs/*,\
.tox/*
max-line-length = 119
extend-ignore =
# whitespace before :
# See https://github.com/PyCQA/pycodestyle/issues/373
E203,
[tox]
envlist = pre-commit,package,docs-lint,docs-all
[testenv:pre-commit]
package = wheel
wheel_build_env = .pkg
extras = dev
commands = pre-commit run --all-files --show-diff-on-failure --color=always
[testenv:py]
package = wheel
wheel_build_env = .pkg
extras = dev
commands = python -m pytest {posargs:-vv --color yes}
[docs]
docs_dir = {tox_root}{/}docs
build_dir = {[docs]docs_dir}{/}_build
# replace when Sphinx>=7.3 and Python 3.8 is dropped:
# -T => --show-traceback
# -W => --fail-on-warning
# -b => --builder
# -v => --verbose
# -a => --write-all
# -E => --fresh-env
sphinx_args = -T -W --keep-going --jobs auto
[testenv:docs{,-lint,-translate,-all,-live}]
package = wheel
wheel_build_env = .pkg
extras = docs
passenv =
# On macOS M1, you need to manually set the location of the PyEnchant
# library:
# export PYENCHANT_LIBRARY_PATH=/opt/homebrew/lib/libenchant-2.2.dylib
PYENCHANT_LIBRARY_PATH
commands =
!lint-!all-!translate-!live : python -m sphinx {[docs]sphinx_args} {posargs} -b html {[docs]docs_dir} {[docs]build_dir}{/}html{/}en
lint : python -m sphinx {[docs]sphinx_args} {posargs} -b linkcheck {[docs]docs_dir} {[docs]build_dir}{/}links
lint : python -m sphinx {[docs]sphinx_args} {posargs} -b spelling {[docs]docs_dir} {[docs]build_dir}{/}spell
live : sphinx-autobuild {[docs]sphinx_args} {posargs} -b html {[docs]docs_dir} {[docs]build_dir}{/}live
translate : python -m sphinx {[docs]sphinx_args} {posargs} -b gettext {[docs]docs_dir} {[docs]build_dir}{/}gettext
translate : python -m sphinx_intl update -p {[docs]build_dir}{/}gettext -d {[docs]docs_dir}{/}locales -w 0 -l de,es,fr,it,pt,zh_CN,zh_TW
all : python -m sphinx {[docs]sphinx_args} {posargs} -v -a -E -b html {[docs]docs_dir} {[docs]build_dir}{/}html{/}en
# Replace `-t machine_translation` with `-t human_translation` if/when a translation
# has been audited by a human. The ReadTheDocs environment variable should also be
# updated to read `TRANSLATION=human`.
all : python -m sphinx {[docs]sphinx_args} {posargs} -v -a -E -b html -D language=de -t machine_translation {[docs]docs_dir} {[docs]build_dir}{/}html{/}de
all : python -m sphinx {[docs]sphinx_args} {posargs} -v -a -E -b html -D language=es -t machine_translation {[docs]docs_dir} {[docs]build_dir}{/}html{/}es
all : python -m sphinx {[docs]sphinx_args} {posargs} -v -a -E -b html -D language=fr -t machine_translation {[docs]docs_dir} {[docs]build_dir}{/}html{/}fr
all : python -m sphinx {[docs]sphinx_args} {posargs} -v -a -E -b html -D language=it -t machine_translation {[docs]docs_dir} {[docs]build_dir}{/}html{/}it
all : python -m sphinx {[docs]sphinx_args} {posargs} -v -a -E -b html -D language=pt -t machine_translation {[docs]docs_dir} {[docs]build_dir}{/}html{/}pt
all : python -m sphinx {[docs]sphinx_args} {posargs} -v -a -E -b html -D language=zh_CN -t machine_translation {[docs]docs_dir} {[docs]build_dir}{/}html{/}zh-cn
all : python -m sphinx {[docs]sphinx_args} {posargs} -v -a -E -b html -D language=zh_TW -t machine_translation {[docs]docs_dir} {[docs]build_dir}{/}html{/}zh-tw
[testenv:package]
skip_install = True
deps =
build==1.2.1
twine==5.1.0
commands =
python -m build . --outdir dist{/}
python -m twine check dist{/}*