diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3affb7e38c..b1467c2ac9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -157,6 +157,9 @@ jobs: env: CI: true COVERAGE_PROCESS_START: ./pyproject.toml + # We only run the llama_cpp tests on the latest Python as they have been regularly failing in CI with `Fatal Python error: Illegal instruction`: + # https://github.com/pydantic/pydantic-ai/actions/runs/19547773220/job/55970947389 + RUN_LLAMA_CPP_TESTS: ${{ matrix.python-version == '3.13' && matrix.install.name == 'all-extras' }} steps: - uses: actions/checkout@v4 @@ -207,6 +210,7 @@ jobs: env: CI: true COVERAGE_PROCESS_START: ./pyproject.toml + RUN_LLAMA_CPP_TESTS: false steps: - uses: actions/checkout@v4 diff --git a/tests/models/test_outlines.py b/tests/models/test_outlines.py index 3758e3c404..f6f11c36fc 100644 --- a/tests/models/test_outlines.py +++ b/tests/models/test_outlines.py @@ -6,6 +6,7 @@ from __future__ import annotations as _annotations import json +import os from collections.abc import Callable from pathlib import Path from typing import Any @@ -80,8 +81,11 @@ not transformer_imports_successful(), reason='transformers not available' ) +# We only run this on the latest Python as the llama_cpp tests have been regularly failing in CI with `Fatal Python error: Illegal instruction`: +# https://github.com/pydantic/pydantic-ai/actions/runs/19547773220/job/55970947389 skip_if_llama_cpp_imports_unsuccessful = pytest.mark.skipif( - not llama_cpp_imports_successful(), reason='llama_cpp not available' + not llama_cpp_imports_successful() or os.getenv('RUN_LLAMA_CPP_TESTS', 'true').lower() == 'false', + reason='llama_cpp not available', ) skip_if_vllm_imports_unsuccessful = pytest.mark.skipif(not vllm_imports_successful(), reason='vllm not available')