You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some circumstances, one may need a package installed using an exact version pinned in uv.lock.
For instance, this is the case when one wants to run ruff check on ruff format in CI and use the same version of the Ruff as the one installed in the environment — in fact, in the case of linting/formatting with ruff, the ruff is the only dependency required.
The following workflow:
# ...jobs:
ruff:
runs-on: ubuntu-lateststeps:
# Check out.# Set up Python.
- run: uv add ruff
- run: uv run ruff check
- run: uv run ruff format
will use the latest version compatible with Python set up — It does not have to be the same as the one in uv.lock.
One can circumvent this by using:
- run: uv sync --only-group ruff --frozen
with the ruff dependency group available in pyproject.toml. But is there any sense to define a separate group for a single development dependency?
I think that adding an extra command that would either return the exact version or install the pinned package would be an interesting feature. If the former, the version could be used as input for GitHub Actions...
Note that similar ideas were tried to be added to other dependency managers, e.g. python-poetry/poetry#3570.
The text was updated successfully, but these errors were encountered:
In some circumstances, one may need a package installed using an exact version pinned in
uv.lock
.For instance, this is the case when one wants to run
ruff check
onruff format
in CI and use the same version of the Ruff as the one installed in the environment — in fact, in the case of linting/formatting withruff
, theruff
is the only dependency required.The following workflow:
will use the latest version compatible with Python set up — It does not have to be the same as the one in
uv.lock
.One can circumvent this by using:
with the
ruff
dependency group available inpyproject.toml
. But is there any sense to define a separate group for a single development dependency?I think that adding an extra command that would either return the exact version or install the pinned package would be an interesting feature. If the former, the version could be used as input for GitHub Actions...
Note that similar ideas were tried to be added to other dependency managers, e.g. python-poetry/poetry#3570.
The text was updated successfully, but these errors were encountered: