Description
This is an issue ticket to track discussion and planning on adding PEP-517 support. Pip 10 does support PEP-518 (with the limitation that the build tool must be a wheel - this avoids the issue of circular dependencies). The next step now is to support PEP-517. All I describe here is the result of my discussion with @dstufft at PyCon 2018 sprints.
pip for PEP-518 does (for a given package to build):
- if an sdist is acquired extract it to a tree source,
- get the build tool and build requirements from
pyproject.toml
(must containsetuptools
andwheel
), - for the current build environment (which is a temporary directory) install the build tool and requirements (this happens by invoking pip via a subprocess),
- invoke the build command by using this temporary folder to build a wheel,
- install then the wheel.
Phase 1: pip install
in a PEP-517 and 518 would do:
- if an sdist is acquired extract it to a tree source,
- get the build tool
pyproject.toml
, - for the current build environment (which is a temporary directory) install the build tool (this happens by invoking pip via a subprocess),
- use
get_requires_for_build_sdist
(or it's wheel counterpart) to get the build requirements (this happens via invoke python within a subprocess of the build environment), - for the current build environment (which is a temporary directory) install the build requirements (this happens by invoking pip via a subprocess),
- invoke the build command by using this temporary environment to build a wheel (
build_wheel
). - install then the wheel.
Phase 2: allow pip to build packages for distribution - pip build
- this follows the same paths as above with the sole difference that allows for the user to select either wheel or sdist, and that it's invoked from the cli (e.g.
pip build . --sdist
.
For phase 1 most of the things are already implemented in https://github.com/pypa/pep517 by @takluyver. It even follows the method pip uses to implement PEP-518
. I suggest we just take that package as a vendored package within pip, and maybe make slight alternation to it where required. Once that's done we can go onto phase 2.
Please show your take on this if you have any obligations, otherwise I'll try to create a PR for this.