Skip to content

feat: make crosshair-tool optional for Python 3.15+#1537

Merged
KRRT7 merged 1 commit intomainfrom
cf-crosshair-optional-3.15
Feb 18, 2026
Merged

feat: make crosshair-tool optional for Python 3.15+#1537
KRRT7 merged 1 commit intomainfrom
cf-crosshair-optional-3.15

Conversation

@KRRT7
Copy link
Collaborator

@KRRT7 KRRT7 commented Feb 18, 2026

Summary

  • Makes crosshair-tool dependency conditional on python_version < '3.15' in pyproject.toml
  • Adds a module-level CROSSHAIR_AVAILABLE guard in concolic_testing.py that skips concolic test generation when the package is absent

crosshair-tool doesn't support Python 3.15 yet. The dependency is now
conditional on python_version < 3.15, with a runtime guard that skips
concolic test generation when the package is absent.
@KRRT7
Copy link
Collaborator Author

KRRT7 commented Feb 18, 2026

currently crosshair-tool gets built from source on 3.15+

@claude
Copy link
Contributor

claude bot commented Feb 18, 2026

PR Review Summary

Prek Checks

✅ All checks passed — ruff check and ruff format both clean.

Mypy

✅ No new type errors introduced. Two pre-existing errors in concolic_testing.py (line 50 var-annotated, line 110 no-redef) exist on main as well and are unrelated to this PR.

Code Review

✅ No critical issues found. The changes are clean and well-scoped:

  • crosshair-tool dependency correctly gated with python_version < '3.15' in pyproject.toml
  • Runtime guard uses importlib.util.find_spec("crosshair") at module level — appropriate since crosshair is invoked via subprocess, never directly imported
  • Guard placement in generate_concolic_tests() is logically ordered (after is_python() check, before is_LSP_enabled() check)
  • No other files import crosshair directly, so no unguarded import errors can occur

Test Coverage

File Main PR Change
codeflash/verification/concolic_testing.py 32% (56 stmts) 33% (61 stmts) +1%
Overall 79% 79% No change
  • ✅ No coverage regression
  • ℹ️ The new guard lines (module-level CROSSHAIR_AVAILABLE and the early return) add 5 new statements. Coverage slightly improved since crosshair is installed in the test environment, meaning the CROSSHAIR_AVAILABLE constant is True and the early-return branch is not taken — consistent with expected behavior.
  • ℹ️ The untaken branch (if not CROSSHAIR_AVAILABLE) would only activate on Python 3.15+ where crosshair-tool is not installed. Testing this path would require mocking importlib.util.find_spec.

Last updated: 2026-02-18

@KRRT7 KRRT7 merged commit efd215d into main Feb 18, 2026
25 of 28 checks passed
@KRRT7 KRRT7 deleted the cf-crosshair-optional-3.15 branch February 18, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant