I know very little about conda. Could you give me a pointer to some sort of example that shows how conda handles the sort of “20-30 different namespaces” problem that you referred to here?
Isn’t that precisely the opposite of this proposal - they explicitly avoid dealing with binary distribution, so they don’t have the problems we’re trying to solve here?
From a very quick read of that document, it looks much more like the “fat wheel”/“dynamic dispatch” approach that @pitrou was suggesting (which the wheel variant people seem to disagree with).
Awesome - I look forward to seeing it (and sorry if the above felt like a point-by-point rebuttal of the examples you gave, I’m genuinely glad to know this has been thought about, and I’ll be glad to have the gaps in my knowledge around prior art filled
). In the interests of keeping things a manageable size, I’d recommend focusing mainly on prior art that implements solutions similar to what you’re proposing (dynamic selector plugins invoked at runtime to choose which binary artifact to download and install) - those would be much more helpful (IMO) than examples that demonstrate alternative approaches which wouldn’t suit Python.
Speaking personally, I’d be against including the code (in the sense of being responsible for it ourselves) but vendoring is much more plausible.
Your points all apply, but if I’m trading them off against the risks and problems around adding a mechanism whereby pip downloads and installs plugins on demand, based on package metadata, then I’d be willing to consider vendoring.
There would be some concerns, of course:
- How much would this increase the size of the pip wheel (both in bytes, and in “number of vendored dependencies”)? You were talking 20-30 possible variables - Adding 20-30 new vendored dependencies to pip is a lot.
- The libraries would need to conform to pip’s vendoring requirements (most critically, only pure Python code is allowed).
We could avoid these issues, at the cost of a less user friendly approach, by requiring selectors to be 3rd party packages, and expecting the user to install any needed selectors before running pip.
I’d like to believe that, but in practice I think it’s going to be impossible to avoid a pressure for installers to implement some level of “minimum expected” behaviour. And I think that’s entirely reasonable. Therefore, not saying what that “minimum expectation” is, simply pushes the responsibility onto installer maintainers to make that judgement - and you’ve already made the point that installer maintainers don’t have the expertise necessary to make informed choices in this area (a statement that I agree with!)
To be specific, on a purely personal basis, I don’t understand why all of this is such a big deal. I’ve never found the current state of affairs with numpy/scipy and BLAS to be a problem, and while I’ve not used torch or any of the other GPU-intensive libraries, I feel that if I did, needing to point pip at the correct index to pick up the libraries that are optimised for my system wouldn’t be that much of an ask. So for me, as a user and as a pip maintainer, I’d be inclined to do the bare minimum to support wheel variants. And in the absence of a standard that says “this is the absolute minimum needed to provide a good user experience for a broad range of users, and installers must implement at least this level of functionality” I’d push back hard on any PRs that added significant extra complexity to pip in order to support extra wheel variant functionality.
I don’t think that is where we want to be - I think the proposal should require specific designs from installers. I’m not talking about UI (command line flags, defaults, etc.) but I do mean everything else - should selectors be downloaded and invoked dynamically, or should they be static based on a fixed whitelist? Should the user pre-generate a “selector values” metadata file for the environment, or should installers generate this on demand?
I’m happy for the PEPs to be split up into “technical mechanism” and “installer features”, but I’m not comfortable with the latter being merely advisory or informational. Apart from anything else, users have a right to know what they can expect from standards-compliant installers, without having to research every tool individually.