[Distutils] A possible refactor/streamlining of PEP 517

Nick Coghlan ncoghlan at gmail.com
Mon Jul 17 08:35:47 EDT 2017


On 17 July 2017 at 22:19, Paul Moore <p.f.moore at gmail.com> wrote:
> On 17 July 2017 at 13:04, Nick Coghlan <ncoghlan at gmail.com> wrote:
>> While I do think it's still worthwhile to include the aspirational
>> guidance around backends trying to keep their out-of-tree builds as
>> close to the "build sdist -> unpack sdist -> build wheel" approach as
>> they can (as well as implementing the example backend that way), we
>> can also attempt to make it more explicit that frontends can only
>> *ensure* sdist-consistency by actually making an sdist first - while
>> backends are encouraged to make the two paths as consistent as they
>> can, they're not *required* to do so (which is the distinction that
>> allows both in-place and out-of-tree wheel builds to work in cases
>> where building the sdist will fail due to missing VCS metadata or
>> tools).
>
> And yet I'm coming round to Donald's view that if we can't build a
> sdist, then we should just switch straight to "build_wheel", and dump
> both the responsibility for integrity of the result *and* any user
> issues that might result onto the backend. So I don't know that in
> practice, pip will bother with the "out-of-tree" option (explicitly
> specifying a build_directory). I may be wrong on that, though - we
> won't know for sure until we try to implement support for the PEP.

Right, and that's why I think it's worth keeping the aspirational
wording for out-of-tree builds in the initially accepted version of
the PEP.

If we later decide it's unnecessary even as an aspirational statement,
then we can drop it without any problems (since the worst case
scenario is that a trailblazing backend that isn't flit or enscons
gets to simplify their build_wheel implementation a bit by changing
how they handle out-of-tree build requests).

> That's going to be an education issue, as we currently tend to get
> users reporting these types of problem as pip issues (and with
> setuptools also being a PyPA project, I don't think currently it's
> necessarily an obvious distinction when we describe the behaviour as a
> setuptools limitation rather than a pip one). But again, if the
> community here is happy with that, I'm not going to argue.

I think that's inevitable for any build frontend, and PEP 517 should
at least give you improved options for reporting *which* part of the
overall build process couldn't be executed (and perhaps even lead to
changes in the way pip builds setuptools/distutils based projects by
default).

Cheers,
Nick.

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


More information about the Distutils-SIG mailing list