-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtox.ini
45 lines (40 loc) · 1.25 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
[tox]
# the Python versions in which the tests will be executed, currently only Python3.8
envlist = py
[testenv]
# the requirements to be installed in the environment in which the tests
# will be executed
deps = -rbuild-requirements.txt
# test command to execute
commands =
pytest tests/ --cov=movai_core_shared --cov-report=term --cov-report=xml
[pytest]
pythonpath = .
[coverage:run]
# report with relative paths (needed for SonarCloud)
relative_files = True
# report branching coverage
branch = True
# documentation
[testenv:docs]
# get env var
passenv =
VERSION
# set env var for commands
setenv =
VERSION={env:VERSION:TODO}
allowlist_externals =
bash
cp
deps =
-rbuild-requirements.txt
commands =
# generate code documentation
sphinx-apidoc -f -o docs/source/ . tests/
# build documentation
sphinx-build -E -c ./docs/source/ -b html ./docs/source/ ./docs/build/{env:VERSION:TODO}
# update versions.json
bash -c "echo $(cd docs/build/ && ls -mQd */ | sed 's/\///g' | sed 's/^/[/' | sed 's/$/]/') > docs/build/versions.json"
# copy root index.html
cp docs/source/_static/index.html docs/build/
bash -c "echo -e '\nTo serve the documentation locally run:\n\tpython3 -m http.server --directory docs/build/ 8000\n'"