-
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
Parallelize removing deps in poetry intall --sync
#9263
Comments
I see now that the source of this is #2658, but is seems like that was never fully investigated and a lot has changed in the internals of poetry since 2020 (e.g. not calling pip via subprocess, I think?). It seems prime candidate to re-evaluate. |
This was certainly not an accident. poetry/src/poetry/installation/executor.py Lines 190 to 192 in bd029ac
Uninstall is one of the few places where poetry does still call pip via a subprocess. I expect a pull request to reimplement uninstallation more directly would be desirable - but more work than just "don't act serially" |
Yeah I saw those lines, I was just hoping that "reimplement uninstallation more directly" had already been done so this would be easy. I guess not. Seems like that's what this issue is asking for then. |
@dimbleby if I wanted to start working on this, could you give me some pointers as to where to begin? I tried looking at how |
I have started some PoC work on this by taking out the uninstaller from |
I guess conceptually the answer is: look at the package dist-info directory in the venv, and remove the items named in the Practically I expect that Secrus is on the right lines in looking at how other projects do their uninstalling. Others that I might consider taking ideas from would include I agree wibni this were pulled out into a nice library that we all could use |
Thank you folks. @Secrus do you plan on continuing work? For context I'd like to use this for better caching in a monorepo setup. The idea is that you build a base or builder image with all of the deps and cache that (and you can tag it with the hash of poetry.lock or similar), then for each service you copy over the .venv and do a sync to minimize image size. At some point I'd like to present this at a conference or group. |
@adriangb Yes, but can't give any real timeline right now. |
Issue Kind
Change in current behaviour
Description
Currently
poetry install --sync
removes dependencies one by one. It's also somewhat slow for each one (~1s, I'd think it should me ms). Uninstalling should be done in parallel and hopefully can be sped up.Impact
This enables a workflow where you cache all of the dependencies for a monorepo and then uninstall the ones you don't need in each services' Docker layer.
Workarounds
None that I know of. Just don't use the pattern.
The text was updated successfully, but these errors were encountered: