Skip to content

Commit

Permalink
[ci] use uv to manage Python and pip dependencies
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nbdd0121 committed Oct 14, 2024
1 parent 7d3d80a commit 43e48cf
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .github/actions/install-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,29 @@ runs:
grep '^[^#]' apt-requirements.txt | xargs sudo apt install -y
shell: bash

- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v3
with:
python-version: '3.8'
cache-dependency-path: python-requirements.txt
cache: pip
version: '0.4.20'
enable-cache: true
cache-dependency-glob: |
pyproject.toml
python-requirements.txt
- name: Install Python
shell: bash
run: |
uv python install 3.8
# Create a virtual environment for UV
uv venv ~/.local/share/venv
echo "$HOME/.local/share/venv/bin" >> "$GITHUB_PATH"
echo "VIRTUAL_ENV=$HOME/.local/share/venv" >> "$GITHUB_ENV"
- name: Install Python dependencies
run: python3 -m pip install -r python-requirements.txt --require-hashes
shell: bash
run: |
uv pip install -r python-requirements.txt --require-hashes
# We installed uv from setup-uv action, so uninstall from venv to prevent conflict
uv pip uninstall uv
- name: Install Verilator
run: |
Expand Down

0 comments on commit 43e48cf

Please sign in to comment.