-
Notifications
You must be signed in to change notification settings - Fork 2.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
What does it actually mean to install a git dependency in editable mode? #6390
Comments
This would probably be a good FAQ item, or maybe something to add around the dependency management section. To answer your question, this is a bit of a 'completeness' feature for parity with pip. I wouldn't consider it super useful for most Poetry users, but it was requested and it was easy to implement, plus some external tools might want to make use of it. When you install a VCS url in editable mode, it hybridizes the install modes. If I fully explain it, this will probably make sense:
So when you install a VCS dependency in editable mode, the repo is cloned into the I hope that helps -- a MR cleaning up my explanation and adding it to the docs would be very welcome! |
Ah okay that's actually pretty neat, I could make use of that. I sometimes have to simultaneously develop on a "upstream" and "downstream" project at the same time, where the downstream project depends on the upstream project's git repo. So being able to edit the upstream and see the changes straightaway in my local dev version of downstream is nice. I don't have to constantly push and pull the changes. It is a little awkward to have the repo inside the virtual environment though ... I just tried symlinking it into the root of the project folder for convenience and it seems to work, although it feels a little iffy. Would there be any problems caused by doing this? i.e.
It seems to import the same way. |
So by spec, VCS deps have to be present at That being said, be cautious of leaning on this too much, as I don't think it was ever intended for longer-term use -- |
Yes I just tested it, Am I right in thinking a path dependency would be safer? |
I think technically what happens is An editable path dependency is the classical solution, yes (putting the dependency back when you are done). One day we might grow support for local replacements or similar, but for now there's not a great way to do that. Okay, the 1.2 betas did allow for one to have multiple copies of a dep, in different groups, with different source URLs. However that was actually the result of a bug that caused some other problems. With the current architecture, two deps that are identical except in terms of source URL are considered the same and will collide/cause your project to become uninstallable. |
Okay, that makes sense. Oh one other thing, maybe this is a bug: in |
I think we don't currently clean up as we use pip to manage installations, and pip will just install the new package when you switch back (deleting/creating It is possible #6205 could change this as then the installer would become part of Poetry, and aware of more than the immediate task (install |
My current setup is that I have a
These four are different repos, but In this way, I need Don't really know how to do this in current poetry workflow. |
@lainisourgod I was thinking about making |
Hi, I see in the documentation it's possible to install a git dependency in editable mode:
But I'm having trouble understanding what this actually means. How do I actually .. you know, edit it? Where does it go? I don't see any repo created in my project directory when I do this, although I am able to import it. What is the expected workflow, what am I meant to do with it?
The text was updated successfully, but these errors were encountered: