Skip to content

Commit

Permalink
ci: Ensure we're using the right py version when testing on CI (#655)
Browse files Browse the repository at this point in the history
#653 enabled support for python 3.13, but CI should have failed since
the `pytket` dependency does not publish wheels for 3.13.

This PR ensures uv doesn't fallback to a lower version when it
encounters unsupported dependencies.
  • Loading branch information
aborgna-q authored Oct 14, 2024
1 parent 3fb67ac commit 994153e
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
# Pinned version for the uv package manager
UV_VERSION: "0.4.18"
UV_VERSION: "0.4.20"
# The highest and lowest supported Python versions, used for testing
PYTHON_HIGHEST: "3.12"
PYTHON_LOWEST: "3.10"

jobs:
# Check if changes were made to the relevant files.
Expand Down Expand Up @@ -89,10 +92,10 @@ jobs:
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Install Python 3.12
run: uv python install 3.12
- name: Install Python ${{ env.PYTHON_HIGHEST }}
run: uv python install ${{ env.PYTHON_HIGHEST }}
- name: Setup dependencies
run: uv sync --locked
run: uv sync --locked --python ${{ env.PYTHON_HIGHEST }}
- name: Type check with mypy
run: uv run mypy .
- name: Check formatting with ruff
Expand Down Expand Up @@ -231,10 +234,10 @@ jobs:
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Install Python 3.10
run: uv python install 3.10
- name: Install Python ${{ env.PYTHON_LOWEST }}
run: uv python install ${{ env.PYTHON_LOWEST }}
- name: Setup dependencies
run: uv sync --locked
run: uv sync --locked --python ${{ env.PYTHON_LOWEST }}
- name: Run python tests with coverage instrumentation
run: uv run pytest --cov=./ --cov-report=xml
- name: Upload coverage output artifact
Expand Down

0 comments on commit 994153e

Please sign in to comment.