Use uv for Python management in CI and build script

- CI: install uv via astral-sh/setup-uv, use uv to install Python
  and run the build script (replaces setup-python which fails on
  self-hosted macOS runners)
- build_sidecar.py: auto-detects uv and uses it for venv creation
  and package installation (much faster), falls back to standard
  venv + pip when uv is not available

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude
2026-03-20 22:56:13 -07:00
parent d297540053
commit eb9ec687cb
2 changed files with 42 additions and 26 deletions

View File

@@ -32,24 +32,15 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up Python
if: matrix.platform != 'macos'
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Verify Python (macOS)
if: matrix.platform == 'macos'
run: |
python3 --version
python3 -m pip --version
- name: Install Python build tools
run: python3 -m pip install --upgrade pip setuptools wheel
run: uv python install ${{ env.PYTHON_VERSION }}
- name: Build sidecar
working-directory: python
run: python3 build_sidecar.py --cpu-only
run: uv run --python ${{ env.PYTHON_VERSION }} python build_sidecar.py --cpu-only
- name: Upload sidecar artifact
uses: actions/upload-artifact@v3