Use a read-only cache adapter for downloading files to workaround mem… #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… usage issue
Why?
We have experienced and seen reports of poetry/pip running out of memory when installing certain large pypi packages:
We linked this to a known issue in pip: pypa#2984 and verified that disabling the cache mechanism solves the issue (at least for the large packages we tested).
What Changed?
Created a read-only version of
src/pip/_vendor/cachecontrol/adapter.py
insrc/pip/_internal/network/ro_cache_adapter.py
and replaced the original. This adapter disable the write-to-cache behavior when downloading a file, but it still reads from the cache when matching requests are found in the cache directory~/.cache/pip/http
.How to test
pip install nvidia_cublas_cu11
and see the install succeedpip install pyyaml
and see that the download used the cached version