Skip to content

Enable setting up version from .uv-version file #215

@paduszyk

Description

@paduszyk

The uv project changes dynamically, so keeping both local and CI version of uv might be challenging. In order to keep both versions consistent, I would suggest to enable pinning them in a "version" file.

For example, this can be achieved by adding an extra input variable:

name: uv

on:
  pull_request:
    branches:
      - main
  push:
    branches:
      - main

jobs:
  uv:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: astral-sh/setup-uv@v4
        with:
          enable-cache: true
          version-file: .uv-version  # <- this is the idea of this issue
      - uses: actions/setup-python@v5
        with:
          python-version-file: .python-version
      - run: uv lock --locked

The file could be also auto-detected if neither version nor version-file is explicitly stated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions