[Distutils] Finishing up PEP 517

Paul Moore p.f.moore at gmail.com
Sat Jun 17 03:36:47 EDT 2017

On 17 June 2017 at 08:07, Nathaniel Smith <njs at pobox.com> wrote:
> Proposal: "NotImplemented" is a legal return value from build_sdist
> (similar to dunder methods), and should trigger whatever fallback
> behavior the frontend would do if the hook was simply undefined.

The PEP currently allows build_sdist to fail, but frontends don't have
much option do do anything other than present that failure direct to
the user. Not because there isn't a special "fall back to something
else" return value, but because the PEP provides no guarantee that any
fallback is possible. We've been very careful to *not* require
anything of source trees than what the hooks offer, as I understand
it, so it seems like we're doing a bit of a U-turn now if we say "if
the hook fails, front ends will fall back" and don't provide any
information as to what front ends are allowed to assume as part of
that fallback. You mention falling back to copying, but the PEP
doesn't even specify that source trees must be copyable. I'd probably
have to work quite hard to come up with a scenario where they aren't,
but if we want to make that guarantee, let's just be explicit about
it. A single sentence "backend operations on source trees must behave
the same if the source tree is copied to a different filesystem
location, and front ends are free to copy source trees if needed" is
easy to add, if that's what we want to guarantee.

Personally, I prefer not adding constraints on source trees, and
leaving the PEP as it is, with no fallback required or expected if a
hook fails.


More information about the Distutils-SIG mailing list