-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds support for using the PyPA build backend (https://pypa-build.readthedocs.io/en/latest/index.html) to build the project wheels in an isolated virtualenv as prescribed by PEP517. This is similar to the existing PEP517 support except that build will first create an sdist and then produce the wheel from that, thus validating the sdist as well as the wheel. This behaviour is controlled by the wheel_pep517 tox testenv attribute - this was a bool but is now a string. An empty string or missing attribute gives the legacy behaviour, the string "build" gives the new behaviour, and any other value gives the previous pip based PEP517 build. In essence the change is in the command run to build the wheel, switching from "pip wheel --use-pep517" to "python -Im build". Because there is an extra build artefact (the sdist), we filter the distdir for wheels only before returning the first one. Because build is not part of the standard library, it must be installed in the tox virtualenv to be used - this is accomplished by implementing the tox_testenv_install_deps() hook, if the wheel_pep517 parameter is set to "build" then the build package will be installed. Currently it is necessary to install it with the [virtualenv] option specified, build normally uses venv to create its isolated environment but that doesn't work inside tox because venvs currently cannot be created inside virtualenvs. As venv becomes more accepted (and possibly the internal backend for virtualenv) this requirement may go away. In terms of testing, I have simply added two tests (and a fixture) to match the existing PEP517 behaviour testing. build has the same requirements of Python 3.6 or above that tox-wheel has so I have not implemented any kind of checks based on different versions. Locally it is passing tests on Python 3.8 and 3.9.
- Loading branch information
Ben Rowland
committed
Jan 21, 2022
1 parent
ec9049c
commit 05b0aea
Showing
3 changed files
with
92 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters