Skip to content

Unify PYTHONPATH setup for subprocesses#1477

Merged
KRRT7 merged 1 commit intomainfrom
unify-pythonpath-setup
Feb 13, 2026
Merged

Unify PYTHONPATH setup for subprocesses#1477
KRRT7 merged 1 commit intomainfrom
unify-pythonpath-setup

Conversation

@KRRT7
Copy link
Collaborator

@KRRT7 KRRT7 commented Feb 13, 2026

Summary

  • Extract duplicated PYTHONPATH-prepending boilerplate into make_env_with_project_root() in shell_utils.py
  • Replace inline PYTHONPATH setup across 6 call sites with the new helper
  • Add missing PYTHONPATH to the CrossHair subprocess.run call and the is_valid_concolic_test subprocess

Replace duplicated PYTHONPATH-prepending boilerplate across 6 call sites
with a single helper in shell_utils. Also adds the missing PYTHONPATH to
the concolic test validation subprocess.
@KRRT7 KRRT7 force-pushed the unify-pythonpath-setup branch from cb32a74 to b6b47ff Compare February 13, 2026 03:39
@claude
Copy link
Contributor

claude bot commented Feb 13, 2026

PR Review Summary

Prek Checks

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

Mypy

✅ No new mypy errors introduced by this PR. All 157 errors in the changed files are pre-existing (e.g., get_cross_platform_subprocess_run_args return type mismatch, self.args being Namespace | None).

Code Review

✅ No critical issues found. This is a clean refactoring that extracts the repeated PYTHONPATH setup pattern (5 call sites across 5 files) into a single make_env_with_project_root() helper in shell_utils.py.

Changes verified:

  • make_env_with_project_root correctly prepends project_root to PYTHONPATH (matching the prior inline logic)
  • All 5 call sites correctly replaced with the new helper
  • Unused os imports properly removed from tracer.py and concolic_testing.py
  • No behavioral changes, no new dependencies, no API breakage

Test Coverage

File Main PR Delta
codeflash/benchmarking/trace_benchmarks.py 50% 46% -4%
codeflash/code_utils/concolic_utils.py 88% 88% 0%
codeflash/code_utils/shell_utils.py 59% 61% +2%
codeflash/optimization/function_optimizer.py 18% 18% 0%
codeflash/tracer.py
codeflash/verification/concolic_testing.py 30% 32% +2%
Overall 78.54% 78.58% +0.04%
  • trace_benchmarks.py -4% is from statement count change (30→26 stmts) altering the ratio, not from uncovered new code.
  • shell_utils.py +2% reflects the new make_env_with_project_root being exercised via tests that call is_valid_concolic_test.
  • ✅ No coverage regression overall.
  • tracer.py excluded from report by coverage (not imported during tests).

Note: 8 pre-existing test failures in tests/test_tracer.py (same on main and PR branch).


Last updated: 2026-02-13

@KRRT7 KRRT7 merged commit 97c1249 into main Feb 13, 2026
27 of 28 checks passed
@KRRT7 KRRT7 deleted the unify-pythonpath-setup branch February 13, 2026 05:14
KRRT7 added a commit that referenced this pull request Feb 19, 2026
Unify PYTHONPATH setup for subprocesses
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

Comments