[Distutils] A possible refactor/streamlining of PEP 517

Nick Coghlan ncoghlan at gmail.com
Mon Jul 10 09:58:53 EDT 2017


On 10 July 2017 at 22:08, Jeremy Stanley <fungi at yuggoth.org> wrote:
> On 2017-07-10 20:33:16 +1000 (+1000), Nick Coghlan wrote:
> [...]
>> we don't really *want* folks to be adding generated files to their
>> sdist that they aren't keeping under source control - we'd prefer
>> that such activities were postponed to "build_wheel" now that we
>> have separate source and precompiled distribution formats.
> [...]
>
> This is a mildly naive view. The software I'm familiar with is
> actually attempting to reflect metadata _from_ the source revision
> control _into_ the sdist because while it's "tracked" there it's not
> tracked as normal files (version information from tags, change logs
> from the commit history, contributor lists from commit authorship).
> The metadata in question is lost by just blindly tarring up tracked
> files, so needs some mechanism to export and inject as untracked
> files (from the source revision control perspective) for inclusion
> in the sdist.

Right, we know there will be *some* generated files (as Daniel notes,
there will typically at least be the metadata files in a
setuptools/distutils generated sdist), as well as potentially
modifications to some files based on the version history.

That isn't the question though - the question is whether we want to
actively support folks moving "compilation" like activities
(minification, pyx->C conversion, etc) to the sdist generation stage
by adding the optional "build_directory" option to "build_sdist" as
well.

And that's the part where we decided the answer is "No", we only want
to support the following configurations:

build_sdist:
    working directory -> target directory

build_wheel:
    working directory -> target directory
    working directory -> build directory -> target directory

In all cases the frontend provides a target directory that is distinct
from the current working directory, so backends have a place to put
both generated intermediate artifacts *and* the final assembled
archive file.

The difference is that in the build_wheel case, the frontend can
explicitly say "don't put intermediate artifacts in the working
directory *or* the target directory, put them in the build directory".

Backends are obviously still free to create their own temporary and
caching directories that the frontend doesn't know anything about, but
that's up to the backend to worry about.

Cheers,
Nick.

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


More information about the Distutils-SIG mailing list