-
Notifications
You must be signed in to change notification settings - Fork 14
/
tox.ini
117 lines (109 loc) · 3.73 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
[tox]
envlist = py{38,39,310,311,312,313}
ignore_basepython_conflict = True
skip_missing_interpreters = True
[testenv]
usedevelop = True
install_command = pip install {opts} {packages}
; XDG_* is used by helm and gcloud among others
; set TF_DATA_DIR so we don't need to download plugins everytime
; for test isolation, map the enviroment vars needed for tests from UNFURL_TEST_* vars
setenv =
UNFURL_HOME={envtmpdir}/unfurl_home
UNFURL_TMPDIR={envtmpdir}
UNFURL_NORUNTIME=1
UNFURL_APPROVE=1
UNFURL_VALIDATION_MODE="additionalProperties types"
UNFURL_RAISE_LOGGING_EXCEPTIONS=1
XDG_CACHE_HOME={envtmpdir}/.cache
XDG_CONFIG_HOME={envtmpdir}/.config
XDG_DATA_HOME={envtmpdir}/.local/share
TF_DATA_DIR={toxworkdir}/.terraform
GOOGLE_APPLICATION_CREDENTIALS={env:UNFURL_TEST_GCP_CRED:}
CLOUDSDK_COMPUTE_ZONE={env:UNFURL_TEST_GCP_ZONE:}
; XXX set HOME to isolated path
; can also set TOX_TESTENV_PASSENV="ENV_VAR1 ENV_VAR1"
passenv=HOME CI GITHUB_* RUNNER_* ANSIBLE_VERBOSITY ANSIBLE_DEBUG UNFURL_WORKDIR UNFURL_LOGGING UNFURL_RAISE_LOGGING_EXCEPTIONS UNFURL_LOG_TRUNCATE UNFURL_TEST_* ANDROID_* TRAVIS* DOCKER_*
basepython =
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11
py312: python3.12
py313: python3.13
deps =
setuptools-rust>=1.7.0
-r{toxinidir}/all-requirements.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/tosca-parser/test-requirements.txt
; docutils
; check-manifest
; flake8
allowlist_externals =
rm
bash
commands =
; XXX:
; check-manifest --ignore tox.ini,tests*
; twine check
; flake8 .
bash -c 'echo $(realpath {toxinidir}) > {envsitepackagesdir}/unfurl.pth'
rm -rf {envsitepackagesdir}/tosca
bash -c 'echo $(realpath {toxinidir}/tosca-package) > {envsitepackagesdir}/tosca.pth'
rm -f .coverage
bash -c 'if [[ -z "$UNFURL_TEST_SKIP_BUILD_RUST" ]]; then python setup.py build_rust --debug --inplace; else true; fi'
pytest {posargs}
[testenv:py{38,39,310,311,312,313}-lock]
; creates Pipfile.lock for distribution, run tox -r -e 'py{38,39,310,311,312,313}-lock'
changedir =
unfurl/templates/{basepython}
allowlist_externals = rm
deps =
pipenv==2024.0.0
commands =
rm -f Pipfile Pipfile.lock
pipenv --no-site-packages install --ignore-pipfile -r ../../../all-requirements.txt
; separate environment
[testenv:py38-docker]
setenv =
HOME={envtmpdir}/home
USER=unfurl
UNFURL_HOME={envtmpdir}/unfurl_home
UNFURL_TMPDIR={envtmpdir}
UNFURL_NORUNTIME=1
XDG_CACHE_HOME={envtmpdir}/.cache
XDG_CONFIG_HOME={envtmpdir}/.config
XDG_DATA_HOME={envtmpdir}/.local/share
TF_DATA_DIR={toxworkdir}/.terraform
GOOGLE_APPLICATION_CREDENTIALS={env:UNFURL_TEST_GCP_CRED:}
CLOUDSDK_COMPUTE_ZONE={env:UNFURL_TEST_GCP_ZONE:}
[testenv:docs]
basepython = python3.12
deps =
-r{toxinidir}/requirements.txt
sphinx==4.5.0
sphinxcontrib-applehelp==1.0.4
sphinxcontrib-devhelp==1.0.0
sphinxcontrib-htmlhelp==2.0.1
sphinxcontrib-serializinghtml==1.1.5
sphinxcontrib-qthelp==1.0.3
typed_ast
myst-parser
sphinx-click>=2.5.0
stevedore>=1.20.0
sphinxcontrib-documentedlist
sphinx_rtd_theme
sphinx_design
; -W turns warnings into errors
; to rebuild all: tox -e docs -- -E -a
commands = sphinx-build ./docs {toxworkdir}/docs/html -d {toxworkdir}/docs/doctrees --color -bhtml {posargs}
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs" / "html" / "index.html"))'
[flake8]
exclude = .tox,*.egg,build,data
select = E,W,F
[pytest]
testpaths = tests
filterwarnings =
ignore:ast:DeprecationWarning
addopts = --cov=unfurl --cov-report html --cov-report term --cov-append --ignore=unfurl/vendor --ignore=tosca-parser --tb short --no-cov
; -n auto --dist loadfile to run in parallel