CI: rely on setup-uv for Python and tighten group install
This commit is contained in:
28
.github/workflows/build-reusable.yml
vendored
28
.github/workflows/build-reusable.yml
vendored
@@ -19,14 +19,11 @@ jobs:
|
|||||||
ref: ${{ inputs.ref }}
|
ref: ${{ inputs.ref }}
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Install uv and Python
|
||||||
uses: actions/setup-python@v5
|
uses: astral-sh/setup-uv@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@v4
|
|
||||||
|
|
||||||
- name: Run pre-commit with only lint group (no project deps)
|
- name: Run pre-commit with only lint group (no project deps)
|
||||||
run: |
|
run: |
|
||||||
uv run --only-group lint pre-commit run --all-files --show-diff-on-failure
|
uv run --only-group lint pre-commit run --all-files --show-diff-on-failure
|
||||||
@@ -97,14 +94,11 @@ jobs:
|
|||||||
ref: ${{ inputs.ref }}
|
ref: ${{ inputs.ref }}
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Install uv and Python
|
||||||
uses: actions/setup-python@v5
|
uses: astral-sh/setup-uv@v6
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@v6
|
|
||||||
|
|
||||||
- name: Install system dependencies (Ubuntu)
|
- name: Install system dependencies (Ubuntu)
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
run: |
|
run: |
|
||||||
@@ -302,12 +296,16 @@ jobs:
|
|||||||
|
|
||||||
- name: Install built packages for testing
|
- name: Install built packages for testing
|
||||||
run: |
|
run: |
|
||||||
# Create uv-managed virtual environment with the matrix interpreter
|
# Create uv-managed virtual environment with the requested interpreter
|
||||||
PYTHON_BIN=$(which python)
|
uv python install ${{ matrix.python }}
|
||||||
uv venv --python "$PYTHON_BIN"
|
uv venv --python ${{ matrix.python }}
|
||||||
source .venv/bin/activate || source .venv/Scripts/activate
|
source .venv/bin/activate || source .venv/Scripts/activate
|
||||||
|
|
||||||
UV_PY=$(python -c "import sys; print(sys.executable)")
|
if [[ "$RUNNER_OS" == "Windows" ]]; then
|
||||||
|
UV_PY=".venv\\Scripts\\python.exe"
|
||||||
|
else
|
||||||
|
UV_PY=".venv/bin/python"
|
||||||
|
fi
|
||||||
|
|
||||||
# Install test dependency group only (avoids reinstalling project package)
|
# Install test dependency group only (avoids reinstalling project package)
|
||||||
uv pip install --python "$UV_PY" --group test
|
uv pip install --python "$UV_PY" --group test
|
||||||
@@ -320,7 +318,7 @@ jobs:
|
|||||||
uv pip install --python "$UV_PY" packages/leann-core/dist/*.tar.gz
|
uv pip install --python "$UV_PY" packages/leann-core/dist/*.tar.gz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PY_TAG=$(python -c "import sys; print(f'cp{sys.version_info[0]}{sys.version_info[1]}')")
|
PY_TAG=$($UV_PY -c "import sys; print(f'cp{sys.version_info[0]}{sys.version_info[1]}')")
|
||||||
|
|
||||||
if [[ "$RUNNER_OS" == "macOS" ]]; then
|
if [[ "$RUNNER_OS" == "macOS" ]]; then
|
||||||
if [[ "${{ matrix.os }}" == "macos-13" ]]; then
|
if [[ "${{ matrix.os }}" == "macos-13" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user