Skip to content

Commit 747bf0c

Browse files
committed
Only run llama_cpp tests on the latest Python
1 parent 1c3c31e commit 747bf0c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ jobs:
157157
env:
158158
CI: true
159159
COVERAGE_PROCESS_START: ./pyproject.toml
160+
# 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`:
161+
# https://github.com/pydantic/pydantic-ai/actions/runs/19547773220/job/55970947389
162+
RUN_LLAMA_CPP_TESTS: ${{ matrix.python-version == '3.13' && matrix.install.name == 'all-extras' }}
160163
steps:
161164
- uses: actions/checkout@v4
162165

tests/models/test_outlines.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from __future__ import annotations as _annotations
77

88
import json
9+
import os
910
from collections.abc import Callable
1011
from pathlib import Path
1112
from typing import Any
@@ -80,10 +81,11 @@
8081
not transformer_imports_successful(), reason='transformers not available'
8182
)
8283

83-
# Disabled because the llama_cpp tests have been regularly failing in CI with `Fatal Python error: Illegal instruction`:
84+
# 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`:
8485
# https://github.com/pydantic/pydantic-ai/actions/runs/19547773220/job/55970947389
8586
skip_if_llama_cpp_imports_unsuccessful = pytest.mark.skipif(
86-
not llama_cpp_imports_successful() or True, reason='llama_cpp not available'
87+
not llama_cpp_imports_successful() or os.getenv('RUN_LLAMA_CPP_TESTS', 'true').lower() == 'false',
88+
reason='llama_cpp not available',
8789
)
8890

8991
skip_if_vllm_imports_unsuccessful = pytest.mark.skipif(not vllm_imports_successful(), reason='vllm not available')

0 commit comments

Comments
 (0)