[Distutils] A possible refactor/streamlining of PEP 517

Nick Coghlan ncoghlan at gmail.com
Mon Jul 10 02:01:14 EDT 2017


On 8 July 2017 at 15:58, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Mostly assume in-place builds, no generic support for out-of-tree
> builds that I can find, so developers of these shims will need to work
> out how to handle "build_directory" (probably by copying the relevant
> input files into the specified build directory and then doing an
> in-place build, similar to the way Scons handles "variant_dir" by
> default):
>
> - setuptools/distutils

Following up based on Daniel's clarification thread: it turns out
setuptools/distutils falls into the same category of "opt-in native
out-of-tree build support" as autotools, CMake, maven, Scons, etc.

That means that a setuptools/distutils PEP 517 backend chosen
specifically by the publisher (as opposed to implicitly by the front
end as a fallback) would be able to rely on "setup.py build -b
<build_directory>" to do the out-of-tree builds rather than having to
copy the input files over. Alternatively, it could work the same way
Scons does, which is to copy the input files by default, and have an
off-switch that allows the publisher to say "we've ensured that
out-of-tree builds work properly, so skip the copy step".

So I think we have pretty solid evidence that the reason the
procedural "build directory preparation" hook wasn't sitting well with
people was because that isn't the way build systems typically model
the concept, while a "build directory" setting is very common (even if
that "setting" is "the current working directory when configuring or
running the build").

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Distutils-SIG mailing list