Skip to content

Commit 725fc1a

Browse files
committed
update tests to use uv
1 parent b99a3e1 commit 725fc1a

File tree

3 files changed

+41
-47
lines changed

3 files changed

+41
-47
lines changed

.github/workflows/ci_linux.yml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ jobs:
2020
with:
2121
python-version: '3.12'
2222

23+
- name: Install the latest version of uv
24+
uses: astral-sh/setup-uv@v6
25+
26+
- name: Cache uv dependencies
27+
uses: actions/cache@v3
28+
with:
29+
path: ~/.cache/uv
30+
key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }}
31+
restore-keys: |
32+
${{ runner.os }}-uv-
33+
34+
- name: Install dependencies
35+
run: uv sync
36+
2337
# Create a cache key based on the LLVM version and Ubuntu version
2438
- name: Set LLVM cache key
2539
id: llvm-cache-key
@@ -72,28 +86,9 @@ jobs:
7286
sudo ln -sf /usr/bin/mlir-translate-20 /usr/bin/mlir-translate
7387
sudo ln -sf /usr/bin/mlir-opt-20 /usr/bin/mlir-opt
7488
75-
# Install Poetry using the snok action
76-
- name: Install Poetry
77-
uses: snok/install-poetry@v1
78-
with:
79-
version: latest
80-
virtualenvs-create: true
81-
virtualenvs-in-project: false
89+
8290

83-
# Cache Poetry dependencies
84-
- name: Cache Poetry dependencies
85-
uses: actions/cache@v3
86-
with:
87-
path: ~/.cache/pypoetry
88-
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
89-
restore-keys: |
90-
${{ runner.os }}-poetry-
91-
92-
- name: Install dependencies
93-
run: |
94-
poetry env use python3.12
95-
poetry install
91+
9692

9793
- name: Run Tests
98-
run: |
99-
poetry run pytest tests -v
94+
run: uv run pytest

.github/workflows/ci_mac.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,21 @@ jobs:
5252
# Verify mlir-opt is available
5353
which mlir-opt || echo "mlir-opt not found in PATH"
5454
55-
# Install Poetry using the snok action
56-
- name: Install Poetry
57-
uses: snok/install-poetry@v1
58-
with:
59-
version: latest
60-
virtualenvs-create: true
61-
virtualenvs-in-project: false
55+
56+
57+
- name: Install the latest version of uv
58+
uses: astral-sh/setup-uv@v6
6259

63-
# Cache Poetry dependencies
64-
- name: Cache Poetry dependencies
60+
- name: Cache uv dependencies
6561
uses: actions/cache@v3
6662
with:
67-
path: ~/Library/Caches/pypoetry
68-
key: ${{ runner.os }}-${{ matrix.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
63+
path: ~/.cache/uv
64+
key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }}
6965
restore-keys: |
70-
${{ runner.os }}-${{ matrix.os }}-poetry-
66+
${{ runner.os }}-uv-
7167
7268
- name: Install dependencies
73-
run: |
74-
poetry env use python3.12
75-
poetry install
69+
run: uv sync
7670

7771
- name: Run Tests
7872
run: |
@@ -82,4 +76,4 @@ jobs:
8276
# Verify mlir-opt is available before running tests
8377
which mlir-opt || echo "mlir-opt not found in PATH"
8478
85-
poetry run pytest tests -v
79+
uv run pytest

.github/workflows/python-checks.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,21 @@ jobs:
1818
with:
1919
python-version: "3.12"
2020

21-
- name: Install uv
22-
run: |
23-
curl -LsSf https://astral.sh/uv/install.sh | sh
24-
echo "$HOME/.uv/bin" >> $GITHUB_PATH
2521

22+
23+
- name: Install the latest version of uv
24+
uses: astral-sh/setup-uv@v6
25+
26+
- name: Cache uv dependencies
27+
uses: actions/cache@v3
28+
with:
29+
path: ~/.cache/uv
30+
key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }}
31+
restore-keys: |
32+
${{ runner.os }}-uv-
33+
2634
- name: Install dependencies
27-
run: |
28-
mkdir -p output
29-
uv pip install --system .
30-
uv pip install --system ".[dev]"
35+
run: uv sync
3136

3237
- name: Run black
3338
run: uv run black . --check
@@ -36,4 +41,4 @@ jobs:
3641
run: uv run ruff check .
3742

3843
- name: Run mypy
39-
run: uv run mypy . --exclude build/
44+
run: uv run mypy .

0 commit comments

Comments
 (0)