Skip to content

Commit 87b1769

Browse files
committed
test: fix llama.cpp
1 parent f6f7d8e commit 87b1769

2 files changed

Lines changed: 13 additions & 19 deletions

File tree

.github/workflows/llama_cpp.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ concurrency:
2929
env:
3030
PYTHONUNBUFFERED: "1"
3131
FORCE_COLOR: "1"
32+
TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]'
33+
TEST_MATRIX_PYTHON: '["3.10", "3.14"]'
3234

3335
jobs:
3436
compute-test-matrix:
@@ -37,26 +39,13 @@ jobs:
3739
run:
3840
working-directory: .
3941
outputs:
40-
matrix: ${{ steps.set.outputs.matrix }}
42+
os: ${{ steps.set.outputs.os }}
43+
python-version: ${{ steps.set.outputs.python-version }}
4144
steps:
4245
- id: set
4346
run: |
44-
if [ "${{ github.event_name }}" = "push" ]; then
45-
echo 'matrix=[{"os":"ubuntu-latest","python-version":"3.10"}]' >> "$GITHUB_OUTPUT"
46-
else
47-
MATRIX='['
48-
MATRIX+='{"os":"ubuntu-latest","python-version":"3.10"},'
49-
MATRIX+='{"os":"ubuntu-latest","python-version":"3.14"},'
50-
MATRIX+='{"os":"windows-latest","python-version":"3.10"},'
51-
MATRIX+='{"os":"windows-latest","python-version":"3.14"},'
52-
# On macOS, pre-built wheels for 3.14 are not available and installing from source
53-
# might fail due to missing dependencies (CMake fails with "OpenMP not found").
54-
# We test with 3.12 instead because pre-built wheels are available for this version.
55-
MATRIX+='{"os":"macos-latest","python-version":"3.10"},'
56-
MATRIX+='{"os":"macos-latest","python-version":"3.12"}'
57-
MATRIX+=']'
58-
echo "matrix=$MATRIX" >> "$GITHUB_OUTPUT"
59-
fi
47+
echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> "$GITHUB_OUTPUT"
48+
echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> "$GITHUB_OUTPUT"
6049
6150
run:
6251
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
@@ -68,7 +57,8 @@ jobs:
6857
strategy:
6958
fail-fast: false
7059
matrix:
71-
include: ${{ fromJSON(needs.compute-test-matrix.outputs.matrix) }}
60+
os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }}
61+
python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }}
7262

7363
steps:
7464
- name: Support longpaths

integrations/llama_cpp/pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,16 @@ classifiers = [
2626
"Programming Language :: Python :: Implementation :: CPython",
2727
"Programming Language :: Python :: Implementation :: PyPy",
2828
]
29-
dependencies = ["haystack-ai>=2.22.0", "llama-cpp-python>=0.2.87"]
29+
dependencies = [
30+
"haystack-ai>=2.22.0",
31+
"llama-cpp-python>=0.2.87"
32+
]
3033

3134
# On macOS GitHub runners, we use a custom index to download pre-built wheels.
3235
# Installing from source might fail due to missing dependencies (CMake fails with "OpenMP not found")
3336
[tool.uv]
3437
index-strategy = "unsafe-best-match" # this ensures that packages are not only searched in the below index but also in PyPI
38+
override-dependencies = ["llama-cpp-python!=0.3.20"] # this version is broken on the additional index
3539
[[tool.uv.index]]
3640
name = "llama-cpp-python-macos"
3741
url = "https://abetlen.github.io/llama-cpp-python/whl/metal/"

0 commit comments

Comments
 (0)