-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Skipping rye pin
considered harmful :)
#313
Comments
Can you please add an explanation why you do not include the |
My original project where I've noticed this problem originally is a library that needs Python 3.10 at minimum. What would I set the Also,
would still be there, just with a different version in place of 3.8.19? |
You are completely right. The example is wrong and |
The example is updated. I now use https://rye.astral.sh/guide/pyproject/#toolryeuniversal to create lock files for all python versions. |
@yacoob since the latest release of uv it has feature parity for my previous use of rye. I am switching all my projects to it. Since it creates a universal lock file by default this problem does not exist with it. If you want to try it out I just created https://github.com/eifinger/setup-uv |
I was experimenting today with this action, and found a subtle discrepancy. Take a look at this minimal repository: https://github.com/yacoob/rye-pin-caching
The workflow in that repo skips
rye pin
andrye sync
, ifsetup-rye
was able to recover the venv from cache.rye-pin-caching
doesn't have a.python-version
file checked in, and the workflow runspython --version
for 3 different Python versions: 3.10, 3.11, 3.12 via a matrix strategy. The first run behaves as expected:https://github.com/yacoob/rye-pin-caching/actions/runs/10190413244/job/28190062641
On a second run, the following happens:
setup-rye
manages to recover the venv from cacherye pin
andrye sync
are skipped, as configuredrye run python --version
looks like this:Full logs here: https://github.com/yacoob/rye-pin-caching/actions/runs/10190430876
The restored venv is correctly configured with py3.10. Rye doesn't know what version it should expect, and it defaults to the minimum requested by
pyproject.toml
- which in my case is 3.8.Removing the
if: ...
line fromrye pin
that hinges the execution on whether there was a cache hit solves this problem completely.This is not a bug per-se, more of an unexpected consequence of the suggested configuration linked from the doc. Has this ever worked for you, with multiple Python versions configured via
matrix
? Wasrye run
behaviour different before? This discrepancy ate some of time, so I wanted to compare notes, so to speak :) The example linked from the README uses a single version instrategy.matrix
, plus it has a.python-version
file present, so the problem doesn't appear there.The text was updated successfully, but these errors were encountered: