Description:
Would be great if an arbirary path to a virtual environment could be cached, instead of / in addition to the default pip and pipenv caching behaviours.
Justification:
Using actions/cache@v2 and actions/setup-python@v1 we would cache our venvs like so:
A major cause of irritation with this is having to figure out what the cache key should be, resulting in every repo having a different one. So, I was very glad when I saw that actions/setup-python@v2 supports caching out of the box, figuring out the cache key itself, and we can ditch the cache action altogether
However, looking at the code it appears that the caching behaviour here is different
my understanding is that the pip global cache is what's being cached
Meaning, when we run python3 -m venv .venv && . .venv/bin/activate && python3 -m pip install ., although pip no longer has to download the dependencies, because they're cached, it still has to make api calls against upstream to check that local cached dependency hashes match upstream
Overall, in our tests, for a small-ish repo with 75 dependencies total, totaling cache size of 30MB, our setup step with the old caching method would take 1-2s, whereas with v2 it takes about 50s
Are you willing to submit a PR?
Yes, if a design is proposed
The text was updated successfully, but these errors were encountered:
lijok commentedNov 19, 2021
Description:
Would be great if an arbirary path to a virtual environment could be cached, instead of / in addition to the default
pipandpipenvcaching behaviours.Justification:
Using
actions/cache@v2andactions/setup-python@v1we would cache our venvs like so:A major cause of irritation with this is having to figure out what the cache key should be, resulting in every repo having a different one. So, I was very glad when I saw that
actions/setup-python@v2supports caching out of the box, figuring out the cache key itself, and we can ditch thecacheaction altogetherHowever, looking at the code it appears that the caching behaviour here is different
Using:
my understanding is that the pip global cache is what's being cached
Meaning, when we run
python3 -m venv .venv && . .venv/bin/activate && python3 -m pip install ., although pip no longer has to download the dependencies, because they're cached, it still has to make api calls against upstream to check that local cached dependency hashes match upstreamOverall, in our tests, for a small-ish repo with 75 dependencies total, totaling cache size of 30MB, our
setupstep with the old caching method would take 1-2s, whereas with v2 it takes about 50sAre you willing to submit a PR?
Yes, if a design is proposed
The text was updated successfully, but these errors were encountered: