Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] use uv to manage Python and pip dependencies #24779

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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