Summary: There are a number of things that really need to be clarified, IMO, before we have a workable spec. I’ve noted the key things for me below. Hopefully thrashing those out is the point of doing the POC, and we’ll work on getting answers.
(Edit: Accidentally hit “send” too early. But I was only proof-reading, and I can’t face more editing, so please accept my apologies for any typos or weird formatting).
OK, I’ve re-read it. As you say it’s not that long, but I still find the discussion hard to follow, so my apologies if I’ve misunderstood something. It’s also possible some or all of my issues were discussed at the packaging summit, but in the absence of any details I’ll assume not (and I don’t expect it matters much now anyway, as people will quite probably not remember all of any discussions that were had).
Things that bother me are:
- We’re discussing “editable installs” without a proper definition of what an editable install actually is. The obvious definition is “what
setup.py develop
does”, but we’ve explicitly decided not to copy that behaviour in a number of ways:
- Adding a new (Python) file needs a reinstall in the proposed approach.
- The behaviour around excluded directories becomes a front-end problem.
I don’t believe anyone has actually discussed whether or not these changes are acceptable to people who use editable installs (if that was discussed, I missed it). I’m not going to bring up my own view again, the point here is that we shouldn’t be relying just on our own views if we’re going to change behaviour.
- The front end behaviour is badly under-specified at the moment. The proposal suggests that the backend provide a list of files and the front-end “make the files available”. That’s not an implementable spec for front ends. There’s discussions about symlinks or
.pth
files, but no real meat. That becomes very obvious when talking about the excluded files issue. The proposal doesn’t actually solve that problem, it just makes it the front-end’s issue, and gives front ends no support in how they handle it.
At this point I’m going to specifically put my “pip maintainer” hat on.
I’m not at all happy with how this proposal leaves all of the technical questions on how to implement editables up to the front end1, while passing responsibility for what you yourself describe as a “huge bug” to the front end and yet claiming that “front ends don’t need to fix this bug”. If it’s such a huge bug, then yes, they do, because users will demand it, and appealing to the fact that the PEP says we can ignore it won’t make any difference. And the point of providing full lists of files is to allow front ends to address this issue - so if I advocate for pip to ignore this problem because the PEP lets us, and I don’t view it as particularly critical, then what’s the point in having all that extra mechanism in the proposal?
Similarly, there’s been talk about using symlinks, but not all platforms have reliable symlinks. So any solution either needs to be implementable without symlinks, or front ends need to be willing to offer degraded support on platforms without symlinks. I’m OK with this being a front end choice, but personally, I’d advocate for pip using .pth
files. So again, anything that’s in support of front ends using symlinks, who’s it going to be used by?
So what I’d like to see is:
- A background section that details what editable mode is, and explains how the standard version differs from the version as implemented currently, so that we’re open about the changes.
- A section in the proposal that describes the standard runtime layout for editable installs2, so that front ends have something to work with, and potential consumers don’t have to rely on implementation-defined layouts.
- Better clarity over what front ends MUST do, what they SHOULD do, and what they are allowed to ignore3.
Note: I get that we’re only in “write a POC” stage at the moment, and so the standard isn’t written yet. But the POC is triggering these questions, and if we don’t come up with proper answers as part of doing the POC, there’s not much point. And let’s be realistic here - if the POC works, it’s very unlikely we’ll just throw it away and write something different. So the code needs to implement the behaviour we want to have as the reference implementation.
Also, we do have UX specialists currently working on pip’s user interface. We could, I suspect, ask them to collect data on how people use editable mode and what they want from it (@sumanah please correct me if I’m speaking out of turn here and that would be out of scope for the work they are funded to do). But I’d be cautious about doing that unless we have some good, focused questions we want answering. Just asking for ideas will probably get either nothing useful, or too much for us to deal with (we’re already stretched just covering the questions we know about!)
1 We’re supposed to be avoiding implementation-defined behaviour…
2 I’m OK with labelling such a description as “provisional”, or “version 1”, but there will be consumers of this layout, as well as front ends producing it, and we should acknowledge taht and document the format.
3 Given that pip is, in practical terms, the only front end at the moment, I’d argue that any feature in the spec that frontends can ignore and that pip is expected to ignore, should be an obvious candidate for omission on the grounds of YAGNI.