-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
68 lines (60 loc) · 2.24 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
[tox]
envlist =
{py39, py38, py37}-{sdist, wheel}-test
pypy39-sdist-test
build
isolated_build = true
skip_missing_interpreters = true
minversion = 3.14
requires = virtualenv >= 20.0.34
[testenv]
description = Test environment for running tests
PYTEST_*
setenv =
# These will overide variables in passenv in case of collision
DIST_DIR = dist
# Confusingly, sdist uses a dash, while wheel uses an underscore
PY_PACKAGE = adam-sandler
PY_PACKAGE_UNDER = adam_sandler
PKG_VERSION = 0.1.0
black,lint,isort: LINT_ARGS = "tests src"
allowlist_externals = pytest
skip_install = true
extras =
# This is where dependencies are defined
test
commands =
pytest -vs {posargs:{toxinidir}{/}tests}
[testenv:{py39, py38, py37, pypy39}-sdist-test]
description = Install as source distribution & test
changedir = {toxinidir}
allowlist_externals = pytest
commands_pre =
python -c 'import os; d = "{env:DIST_DIR}"; import shutil; exec("if os.path.exists(d):\n shutil.rmtree(d)");'
commands =
# Generate the sdist, install it, and run tests
python setup.py sdist --dist-dir {toxworkdir}{/}{env:DIST_DIR}
pip install {toxworkdir}{/}{env:DIST_DIR}{/}{env:PY_PACKAGE}-{env:PKG_VERSION}.tar.gz
{[testenv]commands}
[testenv:{py39, py38, py37}-wheel-test]
description = Install as binary wheel distribution & test
skip_install = true
changedir = {toxinidir}
allowlist_externals = pytest
commands_pre =
python -c 'import os; d = "{env:DIST_DIR}"; import shutil; exec("if os.path.exists(d):\n shutil.rmtree(d)");'
commands =
# Generate the wheel, install it, and run tests
pip wheel --wheel-dir {toxworkdir}{/}{env:DIST_DIR} -e {toxinidir}
pip install --exists-action w --force-reinstall "{toxworkdir}{/}{env:DIST_DIR}{/}{env:PY_PACKAGE_UNDER}-{env:PKG_VERSION}-py3-none-any.whl"
{[testenv]commands}
[testenv:build]
description = Create a source and wheel distribution.
Creates .tar.gz and .whl artifacts in the {env:DIST_DIR} folder.
basepython = {env:TOXPYTHON:python3}
deps = build
skip_install = true
changedir = {toxinidir}
commands_pre =
python -c 'import os; import shutil; d = "{env:DIST_DIR}"; exec("if os.path.exists(d):\n shutil.rmtree(d)");'
commands = python -m build {toxinidir} --outdir {env:DIST_DIR}