Per this comment on this pip
issue, and tracked in setuptools
in issue 1644, the new PEP 517 roll-out has caused the problem that it seems that no provision was made in PEP 517 for custom backends to be provided by the project itself.
This is primarily a problem because it means that PEP 517 backends cannot bootstrap their own builds. The biggest problem at the moment is that there is nowhere for setuptools
to put its build code that works with PEP 517. We could declare a dependency on setuptools
in pyproject.toml
, but this only works when you are able to get a setuptools
wheel from PyPI. If you specify --no-binary :all:
, you will try to install setuptools
from an sdist, and if PEP 517 is enabled that will fail.
As far as I can tell, once we ship a release of setuptools
that contains pyproject.toml
(assuming it adds setuptools
to the build-requires
), it will become impossible to use pip install --no-binary :all:
for any project that uses PEP 517 and uses setuptools
as a backend. Regardless of the advisability of using --no-binary :all:
I think this is a major problem generally, and specifically itās a total pain for setuptools
, which is one project that really needs to be able to build itself from source.
I propose that we add some mechanism in pyproject.toml
for a project to specify that it wants to use a pre-built PEP 517 backend that it is supplying. Probably this would be used only by setuptools
or other PEP 517 backends that want to bootstrap rather than using setuptools
. A few options for what this could look like:
- Add the ability to specify build backends relative to the project root, so for example,
setuptools could specify.setuptools.build_meta
instead ofsetuptools.build_meta
. - A dedicated ābootstrap backendā module to invoke, e.g.
__build_hooks__.py
- An option to specify the current project root as a dependency in
build-requires
(which would basically have the effect of adding the CWD to the Python path).
I personally like option 1. Option 3 is basically the same thing as option 1, except with sloppier semantics.
I put this here rather than on the pip
tracker because as far as I can tell, this needs either a new PEP or a modification to PEP 517. If we can do it without that, Iād be perfectly happy with that as well.