-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pip should provide a way to specify index lookup order #8224
Comments
I’m not convinced with the “not be implementable” part, at least I don’t see anyone making the argument in either of the two issues you linked. |
Simply re-opening the same request isn't going to change the conclusion. Python packages are intended to be unique by name, so if you use a name that is taken by another package, you will get conflicts. I understand the issue around using a name that is subsequently taken, but this is not something that should be solved at the pip level. If you want to have a means for "reserving" names or a namespace, that is a standardisation issue across all packaging tools, and in particular should be something covered by PyPI. So this needs to be raised as a proposal for a packaging interoperability PEP. There is already some discussion on this on Discourse. I'd suggest that if you want to riase this topic, you'd need to have a discussion there - but be aware that this is potentially a very complex issue. (One relatively simple proposal might be to have PyPI "reserve" a certain prefix for local use, similar to the way some IP addresses are guaranteed available locally. That might address the "how do I name my private packages?" problem without getting sucked into global name registry issues). But Python's packaging is unlikely ever to change the principle that every package named foo, regardless of source, is expected to be the same project. That's built into far too much of the infrastructure to change. I'll leave this issue open for a short while, as I don't want to close it without giving the OP time to respond, but I'm strongly of the view that there's nothing pip can or will do here, without a standard to back any change. |
(If anyone can find better labels, feel free to change - "wrong project" isn't ideal, but there isn't a "needs a standard" label...) Edit: Never mind, I added one 🙂 |
Issue #5045 explicitly says that this is not the case. |
the problem is that packages should be namespaced somehow.
That would be very nice indeed.
The point is that the assumption that the name is unique is fine, but it is conditional to my choice of what order I consider them unique and with highest priority in resolving a given name. |
@pfmoore, since there are flags such as: To address this issue, we have started tagging all of our wheels with a localversion specifier, and it works to prefer this against an equivalent upstream version, but when a new upstream version comes out, it takes over. Having a |
Is this different from #8606? As I mention in #8606 (comment) we have a real world example now, in uv, of a pip-like API that by default guarantees an ordering of index lookups. uv has had to implement |
It seems to be a very similar (identical?) issue, yes. My proposal was meant to be a not-so-heavy proposal as changing the index strategy for all packages, and more of a tailored approach which could still address the core of the issue (the impossibility to tell pip to not look at pypi for specific packages). |
Honestly, no I don't. I think we already have far too many such flags, and I think adding more is not only going to add confusion, but also suggests there's an underlying problem. Rather than simply adding another flag any time someone comes up with a new problem, we should look deeper. That's a lot harder, but ultimately will give better results. Specifically, if anyone has the interest in addressing this (I don't, myself) they should consider the following structure:
I'll also note that all of this sort of "what pip sees" control can be done right now, using an index proxy like simpleindex. So in theory, we don't "need" any of these options (specifically option types 1 and 2). But clearly running an index proxy isn't very user friendly, as is demonstrated by the fact that we still get requests for this to be added to pip. But IMO, we should be comparing any set of options provided in pip with the approach of running a proxy, and only offer ones that have a clear use case, explicitly stating that using a proxy is our supported solution for all other cases. It's worth pointing out #11771, which is relevant here, as well. All of this (as well as #8606) relies on someone caring enough to create a PR for it, though. At the moment, no-one who is actually affected by these issues seems to be interested in doing that, unfortunately 🙁 |
Not only not user friendly, it can simply be forbidden by network/security rules... Running a proxy server is not something that is isolated to a given user's process, it is a whole-node server. It is a security issue on shared infrastructures. |
What's the problem this feature will solve?
Currently, --extra-index-url will always operate after the pypi url, no matter what.
This has already been debated at length in #3454 and #5045, where it is hinted that not even by specifying --index-url takes over the order.
In these issues, the accepted solution is to use devpi, or just to use a non-taken name on pypi. However, both these solutions are workarounds:
Describe the solution you'd like
Pip should have an additional option to specify exactly the order in which to honor the lookup for pypi services. This will allow to preserve backward compatibility, while solving the above issues.
Alternative Solutions
Workarounds are suboptimal, fragile, potentially a security issue, and rely on solutions that might not be implementable in a large corporate environment.
Additional context
See above posted issues.
The text was updated successfully, but these errors were encountered: