On Jul 28, 2017, at 3:53 PM, Thomas Kluyver <thomas@kluyver.me.uk> wrote:

On Fri, Jul 28, 2017, at 04:16 PM, Daniel Holth wrote:
It looks like we've run out of things to say about PEP 517, except, how soon can we get it into pip?

I admire your optimism! ;-)

While I partly hope that I get a unanimous disagreement, as it would be simpler, I have a nagging concern about something that someone mentioned ages ago: does it make sense for building sdists and building wheels to be part of the same backend?

Flit now makes both sdists and wheels, but for a long time it only made wheels, and the two parts are largely separate: it wouldn't take much work to use flit's sdist machinery but build the wheel with a different tool (e.g. if it had compiled parts).

Requiring one backend to build both formats may result in a significantly higher barrier to entry for backend developers: I don't know if I would have started writing flit if PEP 517 had already been finalised and I had to make both wheels and sdists to comply with it. They're also, at least to my mind, quite different kinds of thing: an sdist is almost like an archive of a VCS tag, whereas a wheel is the end result of any build steps the project needs.

So I'd like us to circle back round and reconsider allowing projects to specify 'use tool X to make wheels, and tool Y to make sdists'. If everyone else thinks that's unnecessary, I think we'd all be glad to finish this discussion up, but this concern has been growing in my mind for a while, and I want to get it out there before we finalise the PEP.


I think if we do that, we *have* to mandate that the only path to take is VCS -> Sdist -> Wheel, because otherwise every tool is going to end up coupled. This is ultimately because you need to know how you’re supposed to get metadata.

For instance, if we say “You can specify foo to build sdists, and bar to build wheels”, and if foo wants to pull version numbers from git tags, but bar wants to pull it from __init__.py AND you allow VCS -> sdist and VCS -> wheel, then you end up in a situation where the two tools disagree and do the complete wrong thing. However if you mandate that the only path is VCS -> sdist -> wheel, then the sdist tool is responsible for generating metadata like version etc, and the wheel tool only consumes the previous metadata created by the sdist tool (and adds it’s own, like wheel tag and such).

I suspect that we don’t want to do that thought (even if I think that it’s a good idea!) because the flexibility afforded by allowing both means we can adapt to whatever the reality of the situation is in the end if one works better then the other.



Donald Stufft