Skip to content

Commit 1b98a30

Browse files
committed
Use uv in GitHub actions
1 parent 055f85f commit 1b98a30

File tree

1 file changed

+32
-24
lines changed

1 file changed

+32
-24
lines changed

.github/workflows/build.yml

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,28 @@ jobs:
3131
steps:
3232
- uses: actions/checkout@v4
3333

34+
- name: Install uv
35+
uses: astral-sh/setup-uv@v5
36+
with:
37+
enable-cache: true
38+
3439
- name: Set up Python
3540
uses: actions/setup-python@v5
3641
with:
3742
python-version: ${{ matrix.python }}
3843
architecture: ${{ matrix.architecture }}
3944

40-
- name: Install python dependencies
41-
run: |
42-
python -m pip install --upgrade pip
43-
pip install poetry
44-
poetry install
45+
- name: Install the project
46+
run: uv sync
4547

4648
- name: Run pre-commit
4749
if: "!startsWith(matrix.python, 'pypy')"
4850
run: |
49-
python -m pip install pre-commit
51+
uv tool install pre-commit
5052
pre-commit run --all-files --verbose
5153
5254
- name: Run unit tests
53-
run: poetry run pytest -v -k "not device"
55+
run: uv run pytest -v -k "not device"
5456

5557
device_test:
5658
runs-on: ${{ matrix.os }}
@@ -63,16 +65,18 @@ jobs:
6365
steps:
6466
- uses: actions/checkout@v4
6567

68+
- name: Install uv
69+
uses: astral-sh/setup-uv@v5
70+
with:
71+
enable-cache: true
72+
6673
- name: Set up Python
6774
uses: actions/setup-python@v5
6875
with:
6976
python-version: 3.x
7077

71-
- name: Install python dependencies
72-
run: |
73-
python -m pip install --upgrade pip
74-
python -m pip install poetry
75-
poetry install -E http
78+
- name: Install the project
79+
run: uv sync --extra http
7680

7781
- name: Set up tunnel
7882
env:
@@ -90,7 +94,7 @@ jobs:
9094
if: ${{ env.BACKEND }}
9195
run: |
9296
echo Using backend $BACKEND
93-
poetry run pytest -v --backend "$BACKEND" tests/device/
97+
uv run pytest -v --backend "$BACKEND" tests/device/
9498
9599
- name: Release HSM
96100
if: ${{ always() && env.BACKEND }}
@@ -103,16 +107,18 @@ jobs:
103107
steps:
104108
- uses: actions/checkout@v4
105109

110+
- name: Install uv
111+
uses: astral-sh/setup-uv@v5
112+
with:
113+
enable-cache: true
114+
106115
- name: Set up Python
107116
uses: actions/setup-python@v5
108117
with:
109118
python-version: 3.x
110119

111120
- name: Build source package
112-
run: |
113-
python -m pip install --upgrade pip
114-
python -m pip install poetry
115-
poetry build
121+
run: uv build
116122

117123
- name: Upload source package
118124
uses: actions/upload-artifact@v4
@@ -127,19 +133,21 @@ jobs:
127133
steps:
128134
- uses: actions/checkout@v4
129135

136+
- name: Install uv
137+
uses: astral-sh/setup-uv@v5
138+
with:
139+
enable-cache: true
140+
130141
- name: Set up Python
131142
uses: actions/setup-python@v5
132143
with:
133-
python-version: 3.12
144+
python-version: 3.x
134145

135-
- name: Install python dependencies
136-
run: |
137-
python -m pip install --upgrade pip
138-
python -m pip install poetry
139-
poetry install -E http -E usb
146+
- name: Install the project
147+
run: uv sync --extra usb --extra http
140148

141149
- name: Build sphinx documentation
142-
run: poetry run make -C docs/ html
150+
run: uv run make -C docs/ html
143151

144152
- name: Upload documentation
145153
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)