-
-
Notifications
You must be signed in to change notification settings - Fork 611
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-compile must not archive the entire directory of a locally available editable requirement #583
pip-compile must not archive the entire directory of a locally available editable requirement #583
Conversation
07fe05a
to
9f307e6
Compare
Hey @costypetrisor, thanks for putting your time into this. I've looked at the If you can give it a try, we could get this to be a maintainable patch, and merged. |
9f307e6
to
79979f6
Compare
Hi @vphilippon Thanks for looking at this :) I've updated the PR. Thanks :) |
79979f6
to
ab6e63f
Compare
@costypetrisor Could you rebase this on master? |
ab6e63f
to
dc5e777
Compare
@vphilippon rebase done :) |
hold on a second, I think I pushed the wrong thing |
dc5e777
to
a262323
Compare
@vphilippon the correct PR branch has been pushed now :) |
a262323
to
6759df3
Compare
…ent, no archive is being created in pip-tools cache dir
…ditable requirement and this can take a really long time
6759df3
to
3b9b5d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Also, I did a test with a larger-than-usual project myself (the tar.gz is ~180KB), and I'm seeing a 1 minute timesave on the first pip-compile
with cleared cache, and no performance loss on the next pip-compile. And that's on a SSD.
Good job!
I'm using pip-compile for a project whose working dir is really large, and that project is passed as an editable requirement to pip-compile.
Unfortunately the code behind pip-compile which is imported from pip will make an archive of this entire large working dir even if this editable requirement is available locally.
The archive will be done in
%USERPROFILE%\AppData\Local\pip-tools\Cache\pkgs
or~/.cache/pip-tools/Cache/pkgs
. I found out about this when this folder bloated to almost 10 gigs.And another ugly side effect is that I'm experiencing really slow pip-compile times (that large project's dir contains many files, so it's about 5 minutes for me).
I've fixed this by copying some code from pip's
RequirementSet._prepare_file
insideResolver._iter_dependencies
to avoid this call from pip just for local editable reqs.I know this fix's approach is not that easily maintainable in the future, and because of that I'm not expecting to have this merged in pip-tools, but I just wanted to share this PR anyway, just in case other people wish to use the fix just for them, like I do.
Contributor checklist
CHANGELOG entry:
Fixed long compile durations with an locally available editable requirement