[Distutils] PEP 517: Build system API

Thomas Kluyver thomas at kluyver.me.uk
Wed Nov 23 09:35:30 EST 2016

I'd like to push PEP 517 forwards again. This PEP specifies a general
build system interface so that a source tree can specify a tool (such as
flit), and pip can ask that tool to generate a wheel. This would allow
us to install from an sdist or a VCS checkout without running a setup.py


Developments since the last time this was discussed (to my knowledge):
- It now uses the pyproject.toml file specified in PEP 518, which was
already accepted. 517 originally specified a JSON file; 518 explains why
TOML is preferred (basically: comments).
- I have implemented the proposed build-system API in a pull request for
Flit; this has been fairly straightforward so far.

1. Editable installs. The PEP currenly specifies a hook to do an
editable install (like 'pip install -e' or 'setup.py develop') into a
given prefix. I don't think that specifying a prefix is sufficient to
cover '--user' installation, which uses a different install scheme,
especially on Windows and OSX framework builds. We can:
a. Add an extra parameter 'user' to the hook, to override the prefix and
do a user install.
b. Leave it as is, and do not support editable user installation (which
would make me sad, as I do editable user installs regularly)
c. Decide that editable installs are too fiddly to standardise, and
leave it to users to invoke a tool directly to do an editable install.

2. Dash vs. underscore, bikeshed reloaded! Currently,  the table name
uses a dash: [build-system], but the key added by PEP 517 uses an
underscore: build_backend. This seems a bit messy. I propose that we
change build_backend to build-backend for consistency. Dashes and
underscores can both be used in a TOML key without needing quoting.


More information about the Distutils-SIG mailing list