Files
Strata/tests
Niko1221 1b87d4d6ac packaging: the Terminal bundle ships without pip and ensurepip's spare wheel (#5303)
The bundled interpreter's pip (26.2.1 in 0.1.61) carries its own old
copies under pip/_vendor (certifi 2026.6.17, urllib3 2.7.0, msgpack
1.1.2, setuptools 70.3.0 as pkg_resources, ...) that scanners flag, and
ensurepip/_bundled holds a pip 25.0.1 wheel with older ones still. Only
the build runs that pip (install_locked: pip install --require-hashes,
pip check, pip list). At user time the bundle never does: setup.run
refuses `python -m ...` in the app's install mode, pip_install returns
before pip there (also for the CUDA wheels), the FP4 conversion stops
with its own message first, the ROCm wheels are only reached from source
builds, strata_mcp uses the bundled Python with no venv in that mode, the
Docker scripts run no pip, and the start / serve side may not import pip
(test_no_acquisition).

drop_pip() now removes, right after the locked install: site-packages/pip
and its dist-info, any pip / pip3 / pip3.12 launcher left in the
interpreter's bin or Scripts, and ensurepip/_bundled/*.whl (the ensurepip
module stays). The import probe then runs on the bundle without pip, and
the manifest records "pip_removed" (version and paths). --skip-deps is
unchanged. Nothing changes for users.

Reported with a scan and a vendored-copy swap in PR #5303 by Chris
(dc-consulting.pro); that PR's code is not taken (it patched pip's
internals and installed unlocked versions after the lock check).

Test: tests/terminal/test_packaging_drop_pip.py: the removal on fake
Windows and Linux / Mac layouts (fails on the base: no drop step) and
that the app's install mode never starts pip (3 guard tests, pass on the
base too); test_packaging_pins and test_no_acquisition pass (28/28).
2026-11-16 17:57:41 +01:00
..
…