Function needs_pip_provisioning

Source
fn needs_pip_provisioning() -> bool
Expand description

UV writes Windows console scripts as a trampoline with a zip archive appended. The trampoline runs python.exe <the .exe itself> and relies on the interpreter executing that archive. CPython’s old C zipimport, used up to and including 3.7, rejects it and falls back to parsing the executable as source, so every console script in such an environment is unusable – pytest, and origen itself. CPython 3.8 replaced zipimport with the pure-Python implementation, which reads it correctly.

pip’s launchers are built differently and do work there, which is how this combination behaved before O2 moved to UV. Retire this path when O2 drops Python 3.7, or when UV’s launcher becomes readable by it.