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

A command to install/get version of the package from uv.lock #10082

Open
paduszyk opened this issue Dec 21, 2024 · 0 comments
Open

A command to install/get version of the package from uv.lock #10082

paduszyk opened this issue Dec 21, 2024 · 0 comments

Comments

@paduszyk
Copy link

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-latest
    steps:
      # 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant