fix(packaging): Don't ship ensurepip in the embedded Python #61637
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.35) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 172 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.308
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #61637"
general
weight: 0.35
chouquette
What does this PR do?
Exclude
ensurepipfrom the CPython build: the Unix stdlib globs skipLib/ensurepip/, and the Windows build removes it after the layout step (the layout script only ships it together withvenv). The omnibus finalize step, which deleted it, no longer has anything to delete, so that cleanup is dropped.<details>
<summary>Functional changes</summary>
| Before | After |
| --- | --- |
| Bazel-built agent packages: ship
embedded/lib/python3.13/ensurepip(Unix) andembedded3/Lib/ensurepip(Windows), with its ~1.8 MB bundled pip wheel |ensurepipis no longer shipped || Omnibus packages:
ensurepipis installed, then deleted in finalize | It is never installed |Unchanged: the omnibus packages' contents and the separately installed
pip.venvremains available with--without-pip.</details>
Motivation
ensurepipis unused at runtime since pip is installed as a separate target. Omnibus already deletes it (#52526), but the Bazel packages don't go through finalize.--with-ensurepip=no, dropped with the move to a native Bazel build (#58179), never removed the module either: it only stoppedmake installfrom running it.Describe how you validated your changes
Checked that
ensurepipis absent from the@cpython//:python_pkgand@cpython//:python_unixoutputs. The Windows step is only exercised by CI.