← Back to Pull requests

Fix a couple of tests when no “python” in path #2399

Open
musicinmybrain opened this pull request with 13 lines diff across 1 files
View on GitHub
musicinmybrain musicinmybrain commented on Aug 19, 2026 06:08 UTC
Author

These CLI tests assume a “python” executable is available outside of a virtualenv, which is not necessarily true (e.g. Fedora has only “python3” if the python-unversioned-command package is not installed). Use the value of sys.executable in the script configs for these tests instead.

I found this while working on Hatch 1.18.0 for Fedora because the new test test_interrupt_signal_not_inherited failed; I hadn’t noticed that it already affected test_scripts_no_environment because our builds are offline and test_scripts_no_environment has @pytest.mark.requires_internet.

Diff: 13 lines (+11 / -2) across 1 files Reviewer: cjames23 Review duration: 88048m
All Vouch review confidence checks passed
Residual risk 0.08 = Change Risk (0.26) × (1 − Review Confidence (0.68)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.26 · 13 lines diff across 1 files
0.26
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.53 · 4 substantive comment(s)
0.53
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
67%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.158
Real PR Conversation Timeline
6 items
musicinmybrain musicinmybrain commented on Aug 19, 2026 08:04 UTC
Author

On MacOS: /bin/sh: /Users/runner/Library/Application: No such file or directory

This is because sys.executable is something like /Users/runner/Library/Application Support/hatch/env/virtual/hatch/h61Cbry8/hatch-test.py3.14/bin/python3, the construction of the test config doesn’t do shell quoting, and there is whitespace in the path.

I suppose one option would be to assume that just having the correct executable name from sys.executable suffices, and that the executable name itself doesn’t have whitespace. These aren’t necessarily bulletproof assumptions, but they are probably good enough for testing, and still an improvement over a hard-coded python.

Another option would be to map sys.executable through shlex.quote, but this is only guaranteed to work properly for POSIXy shells.

musicinmybrain musicinmybrain commented on Aug 19, 2026 09:03 UTC
Author

I suppose one option would be to assume that just having the correct executable _name_ from sys.executable suffices, and that the executable name itself doesn’t have whitespace. These aren’t necessarily bulletproof assumptions, but they are probably good enough for testing, and still an improvement over a hard-coded python.

I implemented this for now. Let’s see how it goes.

cjames23 cjames23 commented on Sep 11, 2026 03:47 UTC
Contributor

Thanks for this, I wonder if we can make the comments any less verbose while still getting the same message across?

musicinmybrain musicinmybrain commented on Sep 11, 2026 09:12 UTC
Author

OK, I’ve proposed a comment that is half as long and still gets the core point across, if not all the details. How does that look?

cjames23 cjames23 approved these changes on Sep 11, 2026 16:24 UTC
Approved Reviewer

Approved these changes.

Reviewers
Assignees
musicinmybrain musicinmybrain
Labels
risk: low confidence: 67.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 25.8% (LOW) · Higher = larger blast radius
25.8%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 67.7% · Lower = rushed or shallow review
67.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 8.3% · Safe to merge
8.3%
Repository