-
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
Should pip install -e foo
be interpreted as a directory, or a package name?
#12745
Comments
Can you clarify what you mean by "PEP 508 editables"? PEP 508 doesn't refer to editabe installs anywhere (and the docs for |
I am referring to the idea that |
Ah, OK. I'm not sure I agree with that comment, as I don't actually think that (for example) I don't believe that equivalence between normal and editable installs is a useful principle - they are very different operations, used for very different purposes. The fact that we use (This is another case where I'd prefer it if Footnotes
|
Personally I don’t think installing a PEP 508 requirement as an editable makes sense. Either a wheel or sdist, the fetched artifact cannot always be “edited” in a way meaningful to end users. It may be possible to come up with a quasi-reasonable behaviour for some of the most trivial cases, but it falls apart quite quickly. The only possible alternative to the current behaviour, IMO, would be to make |
Completely agree that |
(For what it's worth, we do not support editables for VCS or URL dependencies in uv -- we only support local paths.) |
As of right now, no-one has provided a PR. There's #9471, but that got closed unmerged. And that was solely for @sbidoul is, I believe, the pip maintainer with most interest in this, so he may have further insight. |
I personally think we should support
I had not thought about that. That would certainly be simpler to implement. On the other hand, it's another non standard syntax to learn for users, so I'd go for the PEP 508 syntax.
A directory, I think, because considering it as a package name would not make much sense, and that is what pip does today. |
While I don't have a strong opinion here, I will point out that the PEP 508 style is also non standard, as it's similar to, but not identical to PEP 508. People will expect I'm happy to go with whatever the person writing the PR chooses, though. |
Since I haven’t seen this mentioned, for completeness, |
Does it? That's not documented anywhere, as far as I can see. The docs say:
There's no elaboration on "local project path", so the assumption has to be that's just a path to a directory, and VCS URLs for editable installs are documented here, with the allowed fragments, Looking at the code, I feel like we should either not allow extras with Have I mentioned recently that I hate extras (and for that matter I hate editables)? 🙂
@sbidoul I support that view. Maybe we should document that editable VCS installs are legacy only here? |
Yes, In
On the command-line, |
Note that none of that is documented (at best, there's some examples that suggest what the expected behaviour is). If we want any sort of consistency between pip and uv, we should start by defining something that we all agree is a reasonable set of functionality and syntax. Once we have that, we can then consider how to implement it, and which project needs to change. I certainly wouldn't commit pip to keeping the current behaviour unchanged. |
Description
(Apologies for using the issue tracker to ask a question, but I figured it'd be nice if we have similar behavior here across pip and uv.)
If
foo
is an empty local directory, then...pip install foo
fails withCould not find a version that satisfies the requirement foo
(i.e., it treats it as a PEP 508 requirement without a version specifier).pip install ./foo
fails withInvalid requirement: './foo'
(i.e., it treats it as an unnamed requirement).However:
pip install -e foo
fails withfoo does not appear to be a Python project
(i.e., it treats it as an unnamed requirement).pip install -e ./foo
fails withfoo does not appear to be a Python project
(i.e., it treats it as an unnamed requirement).So there's a difference right now in interpretation between
pip install foo
vs.pip install -e foo
, presumedly because PEP 508 editables aren't yet supported.My question is: when PEP 508 editables are supported, should
pip install -e foo
be interpreted as the pathfoo
, or as a named PEP 508 requirement (e.g.foo==*
)?Expected behavior
No response
pip version
24.0
Python version
3.12.3
OS
macOS
How to Reproduce
Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: