Skip to content

Commit a0ed92c

Browse files
Merge pull request #393 from tpvasconcelos/219-uv-managed-python-pr
Manage the CI Python interpreter with uv
2 parents a70141e + c2c4ca7 commit a0ed92c

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

.github/actions/setup-python/action.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,20 @@ inputs:
1313
runs:
1414
using: composite
1515
steps:
16-
- uses: actions/setup-python@v5
17-
with:
18-
python-version: "${{ inputs.python-version }}"
19-
20-
# Install uv and enable its built-in cache. The cache key takes the
21-
# platform, the uv version, and a hash of the files below into account.
16+
# Install uv together with a uv-managed Python interpreter, and
17+
# create and activate a virtual environment that is used by all
18+
# subsequent steps (e.g. the `uv pip install` step below installs
19+
# into it). Also enables uv's built-in cache. The cache key takes
20+
# the platform, the uv version, and a hash of the files below
21+
# into account.
2222
# See https://docs.astral.sh/uv/guides/integration/github/ for details.
2323
# NOTE: setup-uv publishes immutable releases only (no
2424
# floating major tags), so we pin the full version
25-
- name: Install uv
25+
- name: Install uv and python
2626
uses: astral-sh/setup-uv@v9.0.0
2727
with:
28+
python-version: "${{ inputs.python-version }}"
29+
activate-environment: true
2830
enable-cache: true
2931
cache-suffix: "py${{ inputs.python-version }}"
3032
cache-dependency-glob: |
@@ -34,4 +36,4 @@ runs:
3436
- name: Install requirements
3537
if: ${{ inputs.requirements != '' }}
3638
shell: bash
37-
run: uv pip install --verbose --system ${{ inputs.requirements }}
39+
run: uv pip install --verbose ${{ inputs.requirements }}

docs/reference/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Unreleased changes
3131
- pre-commit autoupdate ({gh-pr}`379`)
3232
- Fix the test suite's compatibility with the latest pytest release ({gh-pr}`384`)
3333
- Use the official `astral-sh/setup-uv` action to install and cache `uv` in CI ({gh-pr}`386`)
34+
- Let `uv` manage the Python interpreter and virtual environment in CI ({gh-pr}`393`)
3435

3536
---
3637

0 commit comments

Comments
 (0)