-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Install repo or path with extras without knowing project name #10097
Comments
Personally I am -1. Pip supports bare URLs only because it had it before PEP 508 was introduced. Now we have PEP 508, pip should try to reduce non-standard syntax instead of adding more. The bare URL format is still useful since it is convenient and pretty trivial to parse, but we should avoid doing anything more complicated than that. |
I agree with @uranusjr here. If there's sufficient justification for this, then it should be proposed as an extension to PEP 508. But if it is, I'd be against it there as well - having to deal with projects that don't have proper names is a source of difficult to handle edge cases, and I'd much rather we were moving towards a principle of "every project must have a well-defined, easily determined name" and this suggestion seems to be moving in the opposite direction. |
In the pytest-perf project, I'm trying to install the "project under test". I don't know the project name in advance. It's whatever repo is checked out at I could, of course, in order to determine the name, copy the pip logic that clones the repo and checks it out to the desired revision, then run Even the current implementation, which installs from a remote URL, in order to produce a PEP 508 URL with extras, infers the project name from the stem of the remote URL. That approach is likely to work, but I'm sure there are cases where it does not. I guess in this particular use-case, one could determine the distribution name of the project under test using the local checkout, but that's still an expensive operation and troublesome. I can imagine a scenario where the user doesn't want to use the local checkout, but would want to use some other reference repository or branch. Since it's possible to install a file system path without specifying the project name (i.e.
I'm not sure how this concern applies here. I want to install a project with a proper name. I just don't know the name in advance.
The syntax I'm suggesting is based on PEP 508, specifically the non-bare URL form, but providing a way not to have to over-specify the name. I agree that PEP 508 maybe should be amended. I raise the issue here to express the use-case that I'd like to see supported. |
Probably a combination of legacy reasons (the non-URL forms aren't standardised and just sort of grew over time) plus performance (it's not as costly to get the name from a local directory - However, the more important point is that newer developments (like the new resolver) are heavily impacted by the cost of determining the name (and version) of a project, so while we've had to maintain existing cases where "unnamed" projects are supported, we'd rather avoid adding more such cases.
My concern revolves around the resolver "candidate" implementation, where candidates need to have a name, and lazily resolving the name is potentially problematic (especially in conjunction with extras, which are a whole additional world of pain 🙂). But it is only a concern, I'm not saying there's an actual problem here, just that someone needs to verify that there isn't before we decide to accept a feature like this...
OK, I guess that if PEP 508 gets revised, then pip will support that change. But I'm saying that pip shouldn't implement this independently of such a standard. Is that sufficient? If so, then I'd argue that you'd be better making this case on Discourse as part of that proposal. |
I'd like to be able to install a project from a file system path or URL and install extras for it without having to know the project name.
It's possible to install without knowing the project name if extras aren't needed:
And it's possible to install with extras if the project name is known:
But if one wants to install a project with its extras without knowing its name, there appears to be no syntax for that.
Perhaps pip could support something like
Or allow a special sentinel to stand in for the actual project name.
The text was updated successfully, but these errors were encountered: