CI: use matrix python venv and set macOS deployment target
This commit is contained in:
20
.github/workflows/build-reusable.yml
vendored
20
.github/workflows/build-reusable.yml
vendored
@@ -302,11 +302,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Install built packages for testing
|
- name: Install built packages for testing
|
||||||
run: |
|
run: |
|
||||||
# Create a virtual environment using the exact interpreter configured by setup-python
|
# Create a virtual environment using the matrix interpreter
|
||||||
PYTHON_BIN=$(python -c "import sys; print(sys.executable)")
|
python -m venv .venv
|
||||||
uv venv --python "$PYTHON_BIN"
|
|
||||||
source .venv/bin/activate || source .venv/Scripts/activate
|
source .venv/bin/activate || source .venv/Scripts/activate
|
||||||
|
|
||||||
|
# Make sure pip tooling is up to date
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
|
||||||
# Install test tools only first, without including the project itself
|
# Install test tools only first, without including the project itself
|
||||||
uv sync --only-group test
|
uv sync --only-group test
|
||||||
|
|
||||||
@@ -318,8 +320,20 @@ jobs:
|
|||||||
uv pip install packages/leann-core/dist/*.tar.gz
|
uv pip install packages/leann-core/dist/*.tar.gz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Derive ABI tag for this interpreter
|
||||||
PY_TAG=$(python -c "import sys; print(f'cp{sys.version_info[0]}{sys.version_info[1]}')")
|
PY_TAG=$(python -c "import sys; print(f'cp{sys.version_info[0]}{sys.version_info[1]}')")
|
||||||
|
|
||||||
|
# Ensure macOS builds use a deployment target compatible with LAPACK symbols when compiling from source
|
||||||
|
if [[ "$RUNNER_OS" == "macOS" ]]; then
|
||||||
|
if [[ "${{ matrix.os }}" == "macos-13" ]]; then
|
||||||
|
export MACOSX_DEPLOYMENT_TARGET=13.3
|
||||||
|
elif [[ "${{ matrix.os }}" == "macos-14" ]]; then
|
||||||
|
export MACOSX_DEPLOYMENT_TARGET=14.0
|
||||||
|
elif [[ "${{ matrix.os }}" == "macos-15" ]]; then
|
||||||
|
export MACOSX_DEPLOYMENT_TARGET=15.0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
HNSW_WHL=$(find packages/leann-backend-hnsw/dist -maxdepth 1 -name "*-${PY_TAG}-*.whl" -print -quit)
|
HNSW_WHL=$(find packages/leann-backend-hnsw/dist -maxdepth 1 -name "*-${PY_TAG}-*.whl" -print -quit)
|
||||||
if [[ -z "$HNSW_WHL" ]]; then
|
if [[ -z "$HNSW_WHL" ]]; then
|
||||||
HNSW_WHL=$(find packages/leann-backend-hnsw/dist -maxdepth 1 -name "*-py3-*.whl" -print -quit)
|
HNSW_WHL=$(find packages/leann-backend-hnsw/dist -maxdepth 1 -name "*-py3-*.whl" -print -quit)
|
||||||
|
|||||||
Reference in New Issue
Block a user