-
Notifications
You must be signed in to change notification settings - Fork 7
/
tox.ini
75 lines (72 loc) · 2.02 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
[tox]
envlist =
lint
pkg
py{39,310,311}
minversion = 4.0
isolated_build = true
skip_missing_interpreters = true
[testenv]
description = run the tests with pytest under {basepython}
setenv =
PIP_DISABLE_PIP_VERSION_CHECK = 1
VIRTUALENV_NO_DOWNLOAD = 1
# isolate testing to avoid using developer config files:
HOME = {toxworkdir}
passenv =
PYTEST_*
PYTHONHTTPSVERIFY
REQUESTS_CA_BUNDLE
SSL_CERT_FILE
TERM
http_proxy
https_proxy
no_proxy
allowlist_externals =
sh
rm
commands =
gri --help
-gri -o report.html owned incoming merged abandon draft watched
[testenv:lint]
passenv = {[testenv]passenv}
# without PROGRAMDATA cloning using git for Windows will fail with an
# `error setting certificate verify locations` error
PROGRAMDATA
extras = lint
deps =
pre-commit >= 2
# `usedevelop = true` overrides `skip_install` instruction, it's unwanted
usedevelop = false
# don't install molecule itself in this env
skip_install = true
commands =
python -m pre_commit run --all-files --show-diff-on-failure
[testenv:pkg]
description =
Do packaging/distribution. If tag is not present or PEP440 compliant upload to
PYPI could fail
# `usedevelop = true` overrides `skip_install` instruction, it's unwanted
usedevelop = false
# don't install molecule itself in this env
skip_install = true
deps =
build >= 0.9.0
twine >= 4.0.1
setenv =
commands =
# build wheel and sdist using PEP-517
{envpython} -c 'import os.path, shutil, sys; \
dist_dir = os.path.join("{toxinidir}", "dist"); \
os.path.isdir(dist_dir) or sys.exit(0); \
print("Removing \{!s\} contents...".format(dist_dir), file=sys.stderr); \
shutil.rmtree(dist_dir)'
{envpython} -m build --outdir {toxinidir}/dist/ {toxinidir}
# Validate metadata using twine
twine check --strict {toxinidir}/dist/*
# Install the wheel
sh -c 'python3 -m pip install "gri @ file://$(echo {toxinidir}/dist/*.whl)"'
# call the tool
gri --help
# Uninstall it
python3 -m pip uninstall -y gri