From b96e9e552799e81d083cc63fcece6c16184adca3 Mon Sep 17 00:00:00 2001 From: Paul Ganssle Date: Thu, 30 Sep 2021 14:00:35 -0400 Subject: [PATCH 1/2] Use `pypa/build` in favor of `pep517.build` `pep517.build` is deprecated and has various bugs related to isolation, and `pypa/build` has matured quite a bit. --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 5cadff8..8235e38 100644 --- a/tox.ini +++ b/tox.ini @@ -73,12 +73,12 @@ commands = description = Build a wheel and source distribution skip_install = True deps = - pep517 + build twine commands = python -c "from pathlib import Path; \ [x.unlink(missing_ok=True) for x in Path('{toxinidir}/dist').glob('*')]" - python -m pep517.build -s -b {toxinidir} -o {toxinidir}/dist + python -m build -s -w -o {toxinidir}/dist {toxinidir} twine check {toxinidir}/dist/* [testenv:release] From 01f90ea8615ff552fe8887c55a6f23f9e0845695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Thu, 30 Sep 2021 14:05:11 -0400 Subject: [PATCH 2/2] Build wheel from sdist Starting in version 0.5.0, the default behavior of `pypa/build` is to first build the sdist, then to buil a wheel from the sdist, see: https://pypa-build.readthedocs.io/en/latest/changelog.html#id10 If you specify `-s -w`, both will be built from the local directory. Since the sdist is the correct release artifact from which to build wheels, the default behavior is preferred. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 8235e38..e3f82b4 100644 --- a/tox.ini +++ b/tox.ini @@ -78,7 +78,7 @@ deps = commands = python -c "from pathlib import Path; \ [x.unlink(missing_ok=True) for x in Path('{toxinidir}/dist').glob('*')]" - python -m build -s -w -o {toxinidir}/dist {toxinidir} + python -m build -o {toxinidir}/dist {toxinidir} twine check {toxinidir}/dist/* [testenv:release]