From 90c7664af739f57ad49e32fa0bb1c05cb926bfa3 Mon Sep 17 00:00:00 2001 From: Thierry Martinez Date: Wed, 27 May 2026 15:29:27 +0200 Subject: [PATCH] Take `enable-cache` and `python-version` into account when setting up `uv` in CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `setup-uv` composite action ignored the `enable-cache` and `python-version` inputs. Cache was still enabled by default, which is the intended behaviour, but the system Python version was used instead of the one specified. As a result, type‑checking and coverage ran with Python 3.12 rather than the requested Python 3.14. This commit fixes the `setup-uv` composite action so that it respects both the `enable-cache` and `python-version` inputs. --- .github/actions/setup-uv/action.yml | 20 ++++++++++++++++++-- .github/workflows/typecheck.yml | 6 ++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup-uv/action.yml b/.github/actions/setup-uv/action.yml index 309716e3d..078bccb5a 100644 --- a/.github/actions/setup-uv/action.yml +++ b/.github/actions/setup-uv/action.yml @@ -1,6 +1,14 @@ name: Set up uv description: Install the pinned version of uv and cache its package cache - +inputs: + enable-cache: + description: Enable cache + required: false + type: boolean + python-version: + description: Python version + required: false + type: string runs: using: composite steps: @@ -8,10 +16,18 @@ runs: shell: bash run: pip install -r .github/uv-requirements.txt + - name: Pin Python version ${{ inputs.python-version }} + if: ${{ inputs.python-version != '' }} + shell: bash + run: uv python pin "$PYTHON_VERSION" + env: + PYTHON_VERSION: ${{ inputs.python-version }} + - name: Cache uv packages + if: ${{ inputs.enable-cache == 'true' }} uses: actions/cache@v4 with: path: ~/.cache/uv key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} restore-keys: | - uv-${{ runner.os }}- \ No newline at end of file + uv-${{ runner.os }}- diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index a40d377cd..f80fc2f95 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -12,9 +12,7 @@ concurrency: cancel-in-progress: true env: - # We stick to Python 3.13 since qiskit-aer is not available yet for Python 3.14. - # See https://github.com/Qiskit/qiskit-aer/issues/2378. - python-version: "3.13" + python-version: "3.14" jobs: mypy-pyright: @@ -67,4 +65,4 @@ jobs: run: | cd ${{ runner.temp }} echo "from graphix import Pattern" > test_graphix_type.py - uv run --project ${{ github.workspace }} --no-sync mypy test_graphix_type.py \ No newline at end of file + uv run --project ${{ github.workspace }} --no-sync mypy test_graphix_type.py