Skip to content

Commit fca192c

Browse files
committed
Migrate the test workflow to uv
1 parent b59d64d commit fca192c

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,29 +47,25 @@ jobs:
4747
run: echo "$GITHUB_CONTEXT"
4848
- uses: actions/checkout@v5
4949
- name: Set up Python
50-
uses: actions/setup-python@v5
50+
uses: actions/setup-python@v6
5151
with:
5252
python-version: ${{ matrix.python-version }}
5353
# Issue ref: https://github.com/actions/setup-python/issues/436
5454
# cache: "pip"
5555
# cache-dependency-path: pyproject.toml
56-
- uses: actions/cache@v4
57-
id: cache
58-
with:
59-
path: ${{ env.pythonLocation }}
60-
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-tests.txt') }}-{{ matrix.pydantic-version }}
56+
- name: Install uv
57+
uses: astral-sh/setup-uv@v7
6158
# Allow debugging with tmate
6259
- name: Setup tmate session
6360
uses: mxschmitt/action-tmate@v3
6461
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
6562
with:
6663
limit-access-to-actor: true
6764
- name: Install Dependencies
68-
if: steps.cache.outputs.cache-hit != 'true'
69-
run: pip install -r requirements-tests.txt
65+
run: uv sync --locked --all-extras --dev
7066
- name: Install Pydantic v1
7167
if: matrix.pydantic-version == 'v1'
72-
run: pip install "pydantic<2.0.0"
68+
run: uv pip install "pydantic<2.0.0"
7369
- name: Lint
7470
run: bash scripts/lint.sh
7571
- run: mkdir coverage
@@ -94,9 +90,9 @@ jobs:
9490
GITHUB_CONTEXT: ${{ toJson(github) }}
9591
run: echo "$GITHUB_CONTEXT"
9692
- uses: actions/checkout@v5
97-
- uses: actions/setup-python@v5
93+
- uses: actions/setup-python@v6
9894
with:
99-
python-version: '3.8'
95+
python-version-file: "pyproject.toml"
10096
# Issue ref: https://github.com/actions/setup-python/issues/436
10197
# cache: "pip"
10298
# cache-dependency-path: pyproject.toml

scripts/lint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
set -e
44
set -x
55

6-
mypy src tests
7-
ruff check src tests scripts
8-
ruff format src tests --check
6+
uv run --no-sync mypy src tests
7+
uv run --no-sync ruff check src tests scripts
8+
uv run --no-sync ruff format src tests --check

scripts/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
set -e
44
set -x
55

6-
coverage run -m pytest tests ${@}
6+
uv run --no-sync coverage run -m pytest tests ${@}

0 commit comments

Comments
 (0)