Skip to content

Commit d1e0f5f

Browse files
committed
[ci] use uv to manage Python and pip dependencies
The GitHub-provided setup-python action does not create portable binaries and can cause failure for bitstream cache. Instead, ask uv to manage our dependencies. Signed-off-by: Gary Guo <gary.guo@lowrisc.org>
1 parent 7d3d80a commit d1e0f5f

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

.github/actions/install-deps/action.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ inputs:
2222
description: Path at which to install Verible
2323
required: true
2424
default: /tools/verible
25+
venv-path:
26+
description: Path at which to place Python venv
27+
required: true
28+
default: ~/.local/share/venv
2529

2630
runs:
2731
using: composite
@@ -32,15 +36,29 @@ runs:
3236
grep '^[^#]' apt-requirements.txt | xargs sudo apt install -y
3337
shell: bash
3438

35-
- uses: actions/setup-python@v5
39+
- uses: astral-sh/setup-uv@v3
3640
with:
37-
python-version: '3.8'
38-
cache-dependency-path: python-requirements.txt
39-
cache: pip
41+
version: '0.4.20'
42+
enable-cache: true
43+
cache-dependency-glob: |
44+
pyproject.toml
45+
python-requirements.txt
46+
47+
- name: Install Python
48+
shell: bash
49+
run: |
50+
uv python install 3.8
51+
# Create a virtual environment for UV
52+
uv venv ${{ inputs.venv-path }}
53+
echo "${{ inputs.venv-path }}/bin" >> "$GITHUB_PATH"
54+
echo "VIRTUAL_ENV=${{ inputs.venv-path }}" >> "$GITHUB_ENV"
4055
4156
- name: Install Python dependencies
42-
run: python3 -m pip install -r python-requirements.txt --require-hashes
4357
shell: bash
58+
run: |
59+
uv pip install -r python-requirements.txt --require-hashes
60+
# We installed uv from setup-uv action, so uninstall from venv to prevent conflict
61+
uv pip uninstall uv
4462
4563
- name: Install Verilator
4664
run: |

0 commit comments

Comments
 (0)