diff --git a/.github/workflows/llama_cpp.yml b/.github/workflows/llama_cpp.yml index 345001a993..b41668844f 100644 --- a/.github/workflows/llama_cpp.yml +++ b/.github/workflows/llama_cpp.yml @@ -17,7 +17,6 @@ on: - "integrations/llama_cpp/**" - "!integrations/llama_cpp/*.md" - ".github/workflows/llama_cpp.yml" - defaults: run: working-directory: integrations/llama_cpp @@ -29,6 +28,8 @@ concurrency: env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: compute-test-matrix: @@ -37,26 +38,13 @@ jobs: run: working-directory: . outputs: - matrix: ${{ steps.set.outputs.matrix }} + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} steps: - id: set run: | - if [ "${{ github.event_name }}" = "push" ]; then - echo 'matrix=[{"os":"ubuntu-latest","python-version":"3.10"}]' >> "$GITHUB_OUTPUT" - else - MATRIX='[' - MATRIX+='{"os":"ubuntu-latest","python-version":"3.10"},' - MATRIX+='{"os":"ubuntu-latest","python-version":"3.14"},' - MATRIX+='{"os":"windows-latest","python-version":"3.10"},' - MATRIX+='{"os":"windows-latest","python-version":"3.14"},' - # On macOS, pre-built wheels for 3.14 are not available and installing from source - # might fail due to missing dependencies (CMake fails with "OpenMP not found"). - # We test with 3.12 instead because pre-built wheels are available for this version. - MATRIX+='{"os":"macos-latest","python-version":"3.10"},' - MATRIX+='{"os":"macos-latest","python-version":"3.12"}' - MATRIX+=']' - echo "matrix=$MATRIX" >> "$GITHUB_OUTPUT" - fi + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> "$GITHUB_OUTPUT" + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> "$GITHUB_OUTPUT" run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} @@ -68,7 +56,8 @@ jobs: strategy: fail-fast: false matrix: - include: ${{ fromJSON(needs.compute-test-matrix.outputs.matrix) }} + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths diff --git a/integrations/llama_cpp/pyproject.toml b/integrations/llama_cpp/pyproject.toml index 31d2d215b2..e99716db38 100644 --- a/integrations/llama_cpp/pyproject.toml +++ b/integrations/llama_cpp/pyproject.toml @@ -26,15 +26,9 @@ classifiers = [ "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dependencies = ["haystack-ai>=2.22.0", "llama-cpp-python>=0.2.87"] - -# On macOS GitHub runners, we use a custom index to download pre-built wheels. -# Installing from source might fail due to missing dependencies (CMake fails with "OpenMP not found") -[tool.uv] -index-strategy = "unsafe-best-match" # this ensures that packages are not only searched in the below index but also in PyPI -[[tool.uv.index]] -name = "llama-cpp-python-macos" -url = "https://abetlen.github.io/llama-cpp-python/whl/metal/" +dependencies = [ + "haystack-ai>=2.22.0", "llama-cpp-python>=0.2.87" +] [project.urls] Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/llama_cpp#readme"