Skip to content

Commit d13d5ab

Browse files
authored
Upgrade packaging testing (#71)
1 parent 469762f commit d13d5ab

File tree

1 file changed

+25
-19
lines changed

1 file changed

+25
-19
lines changed

tox.ini

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
[tox]
2-
# toxworkdir = /data1/DATA/tox/ruyaml
2+
minversion = 3.16.1
33
envlist =
44
linters
55
docs
66
packaging
77
py{36,37,38,39,310}
8+
isolated_build = true
9+
requires =
10+
setuptools >= 41.4.0
11+
pip >= 19.3.0
12+
skip_missing_interpreters = False
813

914
[testenv]
1015
description = Unittest using {basepython}
@@ -13,6 +18,9 @@ commands =
1318
/bin/bash -c 'pytest _test/test_*.py'
1419
deps =
1520
pytest
21+
allowlist_externals =
22+
make
23+
sh
1624

1725
[testenv:docs]
1826
description = Build docs
@@ -22,8 +30,6 @@ extras =
2230
commands =
2331
make singlehtml
2432
changedir = {toxinidir}/_doc
25-
whitelist_externals =
26-
make
2733

2834
[testenv:linters]
2935
description = Linting
@@ -37,29 +43,29 @@ commands =
3743

3844
[testenv:packaging]
3945
description =
40-
Do packaging/distribution. If tag is not present or PEP440 compliant upload to
41-
PYPI could fail
46+
Do packaging/distribution
4247
# `usedevelop = true` overrides `skip_install` instruction, it's unwanted
4348
usedevelop = false
4449
# don't install package itself in this env
4550
skip_install = true
4651
deps =
47-
collective.checkdocs==0.2
48-
pep517 >= 0.5.0
49-
twine==1.14.0 # pyup: ignore
52+
build >= 0.7.0
53+
twine >= 3.7.0
5054
setenv =
5155
commands =
52-
rm -rfv {toxinidir}/dist/
53-
python -m pep517.build \
54-
--source \
55-
--binary \
56-
--out-dir {toxinidir}/dist/ \
57-
{toxinidir}
58-
# metadata validation
59-
sh -c "python -m twine check {toxinidir}/dist/*"
60-
whitelist_externals =
61-
rm
62-
sh
56+
# build wheel and sdist using PEP-517
57+
{envpython} -c 'import os.path, shutil, sys; \
58+
dist_dir = os.path.join("{toxinidir}", "dist"); \
59+
os.path.isdir(dist_dir) or sys.exit(0); \
60+
print("Removing \{!s\} contents...".format(dist_dir), file=sys.stderr); \
61+
shutil.rmtree(dist_dir)'
62+
{envpython} -m build \
63+
--outdir {toxinidir}/dist/ \
64+
{toxinidir}
65+
# Validate metadata using twine
66+
twine check --strict {toxinidir}/dist/*
67+
# Install the wheel
68+
sh -c "python3 -m pip install --force-reinstall {toxinidir}/dist/*.whl"
6369

6470
[pytest]
6571
filterwarnings =

0 commit comments

Comments
 (0)