Skip to content
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

ci: enable pip cache #4812

Merged
merged 2 commits into from
May 13, 2024
Merged

ci: enable pip cache #4812

merged 2 commits into from
May 13, 2024

Conversation

minrk
Copy link
Member

@minrk minrk commented May 9, 2024

add cache: pip to setup-python invocations

@@ -158,6 +158,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python }}"
cache: pip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know after when / how the cache will be invalidated by default?

Copy link
Member Author

@minrk minrk May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by default the cache key is the hash of requirements.txt, so if our dependencies change, this will clear the cache. We can set cache-dependency-path to be more precise, which I've done now.

Note that an outdated cache doesn't cause problems because it only caches pip's own cache dir, i.e. downloaded wheels, not install results (the same cache you use every time you pip install on your own machine). So when there is a cache hit on an outdated package, pip will still lookup and install the latest available version, updating the cache.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooooh then im very much in favor of this without any hesitation!

@minrk minrk merged commit 95d479a into jupyterhub:main May 13, 2024
21 checks passed
@minrk minrk deleted the setup-python-cache branch May 13, 2024 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants