[Distutils] Provisionally accepting PEP 517's declarative build system interface

Nathaniel Smith njs at pobox.com
Sat Jun 3 20:36:17 EDT 2017


On Sat, Jun 3, 2017 at 5:09 PM, C Anthony Risinger
<c at anthonyrisinger.com> wrote:
> Fair enough. It seems like there will almost certainly emerge some way of
> chaining small "source tree mutators" (leading to an sdist) with truly
> custom build backends (that may ultimately terminate on either
> setuptools/distutils like you mention, or a completely separate toolchain [I
> want to say something like waf could be this alternate]).
>
> This wrapper/pipeline layer could be baked into pip/flit/whatever as a
> plugin system, but ideally it would just be a small and blessed pypa tool
> I'd think... then I suppose to make use of multiple transformations, a user
> would pass a list of actual build-system backends via
> tool.BLESSED-CHAINER-APP.build-backends in pyproject.toml or something.
>
> Is it unreasonable to request right now that build-system.build-backend be a
> repeatable key in pyproject.toml? Then I could just list them in order.
> Might be easy to add later without breakage though too.
>
> As long as all backends understand the hard separation between build_sdist
> "prepare the redistributable source tree" and build_wheel "construct an
> installable" they can be called in proper order and in phases.

That's a neat idea, but I'd prefer that this be handled by someone
(you?) writing a metabuild system that implements whatever layering
logic they prefer and putting it up on pypi, so it can be used like:

[build-system]
build-backend = metabuild

[tool.metabuild]
backends = ["backend1", "backend2", "backend3"]

As you can see, standards are hard; it takes hundreds of emails to
standardize the API of a function that just takes a source tree and
outputs a wheel :-). So the idea of PEP 517 is to push as much actual
semantics as possible into the build backend, where they can be easily
changed and evolved and experimented with. It's not at all obvious to
me right now whether monolithic or plugin-style build backends will
predominate, and it's also not at all obvious to me how *exactly*
you're imagining the layering/phases would work, but the great thing
is that PEP 517 is already flexible enough to let you do what you want
without having to convince me first :-)

-n

-- 
Nathaniel J. Smith -- https://vorpus.org


More information about the Distutils-SIG mailing list