Repository navigation
v0.4.5
Fixed
-
The
.pthfile was installed into the base interpreter instead of the virtual environment.install_pth_file()askedsite.getsitepackages()where to write. It runs during Python's site initialization — the.pthfile imports this package — and.pthfiles are processed from insidesite.venv(), which reads them before it rewritessite.PREFIXESfor the virtual environment. Captured at the moment of the copy:sys.prefix = <venv> # correct site.PREFIXES = ['/…/uv/python/cpython-3.11.16-…'] # base interpreter dst = <base>/lib/python3.11/site-packages/provide_testkit_init.pthTwo consequences. The file landed in the shared interpreter, where no
providepackage exists, so it did nothing but persist — surviving uninstallation from every project. And because the copy never reached the venv, a.pthalready there was never refreshed: upgrading the package left the old file in place, which is what kept 0.4.4's fix from reaching existing environments.The destination is now the directory that contains
provide/testkit/, which is correct by construction and reads no interpreter state.sys.prefixis the fallback for an editable install; unlikesite.PREFIXESit already points at the venv this early.Verified from a built wheel: planting a stale
.pthin a fresh environment and running Python once replaces it (395 → 408 bytes) and the C locale works again, while the base interpreter is never written to.If an earlier version left a
provide_testkit_init.pthin your base interpreter'ssite-packages, it is inert and safe to delete;uninstalltargets the environment it runs in and will not find it.
Upgrade note: this is the release that makes 0.4.4's ASCII .pth fix actually reach an environment that already had testkit installed. On 0.4.4 alone, the stale file stayed put.