-
Notifications
You must be signed in to change notification settings - Fork 66
/
tox.ini
64 lines (59 loc) · 2.57 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
[tox]
env_list = docs-lint,pre-commit,py
[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{,38,39,310,311,312,313}{,-ci}]
package = wheel
wheel_build_env = .pkg
depends: pre-commit
extras = dev
allowlist_externals = docker
setenv =
DOCKER_ARGS = {env:DOCKER_ARGS:--rm -d --name qbt-tox-testing --pull=always --publish 8080:8080 --volume {tox_root}/tests/_resources:/tmp/_resources}
DOCKER_QBT_IMAGE_NAME = {env:DOCKER_IMAGE_NAME:ghcr.io/rmartin16/qbittorrent-nox}
DOCKER_QBT_IMAGE_TAG = {env:DOCKER_QBT_IMAGE_TAG:master-debug}
passenv =
CI # needed for test_shutdown()
IS_QBT_DEV # needed for test skips
commands_pre = !ci: -docker stop qbt-tox-testing
commands =
!ci: docker run {env:DOCKER_ARGS} {env:DOCKER_QBT_IMAGE_NAME}:{env:DOCKER_QBT_IMAGE_TAG}
!ci: python -Xdev -m pytest {posargs:-vv --color=yes}
ci: python -Xdev -m coverage run -m pytest {posargs:-vv --color=yes}
commands_post = !ci: docker stop qbt-tox-testing
[docs]
docs_dir = {tox_root}{/}docs
source_dir = {[docs]docs_dir}{/}source
build_dir = {[docs]docs_dir}{/}_build
sphinx_args = --show-traceback --fail-on-warning --keep-going --jobs auto
[testenv:docs{,-lint,-all,-man,-live,-live-src}]
base_python = py312
# give sphinx-autobuild time to shut down http server
suicide_timeout = 0.5
package = wheel
wheel_build_env = .pkg
change_dir = docs
passenv = FORCE_COLOR
deps = -e {tox_root}[docs]
commands =
!lint-!all-!man-!live : python -m sphinx {[docs]sphinx_args} --builder html {[docs]source_dir} {[docs]build_dir}/html
lint : python -m sphinx {[docs]sphinx_args} --builder linkcheck {[docs]source_dir} {[docs]build_dir}/links
lint : python -m sphinx {[docs]sphinx_args} --builder spelling {[docs]source_dir} {[docs]build_dir}/spell
all : python -m sphinx {[docs]sphinx_args} --verbose --write-all --fresh-env --builder html {[docs]source_dir} {[docs]build_dir}/html
man : python -m sphinx {[docs]sphinx_args} --builder man {[docs]source_dir} {[docs]build_dir}/man
live-!src : sphinx-autobuild {[docs]sphinx_args} {posargs} --builder html {[docs]source_dir} {[docs]build_dir}{/}live
live-src : sphinx-autobuild {[docs]sphinx_args} {posargs} --write-all --fresh-env --watch {tox_root}{/}src{/}qbittorrentapi --builder html {[docs]source_dir} {[docs]build_dir}{/}live
[testenv:package]
skip_install = True
passenv = FORCE_COLOR
deps =
check_manifest
build
twine
commands =
check-manifest -v
python -m build --outdir dist/ .
python -m twine check dist/*