Draft: generic PEP517 plugin for pybuild
This MR is a first draft at a generic PEP517 builder plugin for pybuild.
It needs:
- a build-dep on python-build (>> 0.7.0)
- a build-dep on python-installer (not yet uploaded to Debian)
- build-deps on whatever back-end builder packages are listed in
pyproject.toml
This plugin was able to build a trivial PEP517 (setuptools backend) package pep517-sample
Unresolved issues:
- the
install
module will refuse to overwrite files; installing into a staging directory and then moving the contents over todebian/tmp
is needed to handle the case there are multiple supported interpreters. - there is no clear place in the tooling for when the tests should be run (this appears to be in part because pypa upstream are yet to codify this question). The current implementation tries to run the build/test/install sequence in that Debian-normal order by poking the (intermediate) wheel file into
PYTHONPATH
; fiddling withPYTHONPATH
to run tests does not, in general, feel like the correct approach and also runs the tests too early as entry_points and scripts are not yet in place (see recent mailing list discussion.
In view of the above two issues, perhaps the correct sequence is
-
build: build the wheel and install it into a temporary location (presumably reusing
{build_dir}
?) - test: run the tests
-
install: copytree (or similar) into the debhelper-requested location such as
debain/tmp
, overwriting files that already exist
Comments, suggestions and competing proposals that make PEP517 compliant building with pybuild Just Work gratefully accepted.