Skip to content

Commit efd215d

Browse files
authored
Merge pull request #1537 from codeflash-ai/cf-crosshair-optional-3.15
feat: make crosshair-tool optional for Python 3.15+
2 parents 20c956c + 5aa115a commit efd215d

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

codeflash/verification/concolic_testing.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import ast
4+
import importlib.util
45
import subprocess
56
import tempfile
67
import time
@@ -18,6 +19,8 @@
1819
from codeflash.telemetry.posthog_cf import ph
1920
from codeflash.verification.verification_utils import TestConfig
2021

22+
CROSSHAIR_AVAILABLE = importlib.util.find_spec("crosshair") is not None
23+
2124
if TYPE_CHECKING:
2225
from argparse import Namespace
2326

@@ -52,6 +55,10 @@ def generate_concolic_tests(
5255
logger.debug("Skipping concolic test generation for non-Python languages (CrossHair is Python-only)")
5356
return function_to_concolic_tests, concolic_test_suite_code
5457

58+
if not CROSSHAIR_AVAILABLE:
59+
logger.debug("Skipping concolic test generation (crosshair-tool is not installed)")
60+
return function_to_concolic_tests, concolic_test_suite_code
61+
5562
if is_LSP_enabled():
5663
logger.debug("Skipping concolic test generation in LSP mode")
5764
return function_to_concolic_tests, concolic_test_suite_code

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dependencies = [
3939
"dill>=0.3.8",
4040
"rich>=13.8.1",
4141
"lxml>=5.3.0",
42-
"crosshair-tool>=0.0.78",
42+
"crosshair-tool>=0.0.78; python_version < '3.15'",
4343
"coverage>=7.6.4",
4444
"line_profiler>=4.2.0",
4545
"platformdirs>=4.3.7",

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)