hynek / setup-cached-uv Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Adding cached-uv sped up my pypy jobs (yay!), but slowed down all the other jobs, as it takes 2-10 seconds to restore the cache, and uv's just as fast without it if it doesn't have to build anything (so slower if you include the cache restore time, its almost always double the time). PyPy (and probably Python 3.13, forgot to check) need to build, so I'd like to have an with: use-cache:
field that I could put a template into that would be true if I need the cache, and false if not (the cache is ~70MB per job, and I have a lot of jobs, so it would be nice to just do the important bits).
I can do this with something like this:
- name: Setup uv (uncached)
uses: yezz123/setup-uv@v4
if: "!startsWith(matrix.python-version, 'pypy')"
- name: Setup uv (cached)
uses: hynek/setup-cached-uv@v1
if: "startsWith(matrix.python-version, 'pypy')"
with:
cache-suffix: -${{ matrix.python-version }}
but it's not as pretty to require two separate actions, IMO.
(FWIW, caching doesn't seem to be worth it for pixi or uv unless they have to build (which pixi never does...)
Hi ๐
This action could allow pinning the uv version, to avoid always getting the latest version with a potential breaking change. Something like:
steps:
- uses: hynek/setup-cached-uv@v1
with:
version: 0.1.31
Two side-effects of this feature to consider:
pip install
to allow installing a specific version.I was about to post this issue over in baipp but this might be a better place for it.
The default cache key ${{runner.os}}-uv
is not fine-grained enough to work with a heterogeneous CI/CD pipeline with separated build and test steps, because the requirements to build may be very different from the requirements to run and test. since baipp runs first, it will have a cache miss and save the uv cache for the build step, then any subsequent run using setup-cached-uv will have a cache hit, but only primed for the build dependencies and unable to update the cache with additional test dependencies.
Hopefully setup-python will eventually have cache: uv
but until then it would be swell if I could add:
- uses: hynek/setup-cached-uv
with:
cache-dependency-path: '**/requirements-dev.txt'
which would result in cache keys like:
setup-cached-uv-Linux-22.04-Ubuntu-python-3.12.2-de25a2691d32d697d64ac0f45eb15fbab0ef7c4ca684a123bb5ec913fb6498d0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.