henryiii · GitHub

@henryiii

LecrisUT

….15+
On Python 3.15+, the redirect-mode editable finder is now installed via a
PEP 829 `.start` file (the structured replacement for the deprecated `import`
line in `.pth` files) instead of a `.pth` `import` line. The `.pth` keeps only
the `sys.path` entries, and the `.start` file carries a zero-argument
`entrypoint()` callable, encoded UTF-8-sig as the PEP requires. Selection is
automatic based on the running interpreter; pre-3.15 output is unchanged and
inplace mode (no code execution) is unaffected.
`install()` is now idempotent, since a `.start` entry point can be invoked more
than once (CPython 3.15.0b1 processes a venv's site-packages twice at startup),
unlike a `.pth` `import` line whose side effects run once via the module cache.
Assisted-by: ClaudeCode:claude-opus-4.8

@henryiii

@henryiii

…tput
Address PR review: read the first non-empty .pth line instead of stripping the
whole content (so the assertion stays correct if the fixture grows multiple
packages), and capture .start contents alongside the other zip reads so the
branches assert exactly what is emitted.
Assisted-by: ClaudeCode:claude-opus-4.8

@henryiii

The `.start` idempotency guard rejected any `install()` call as soon as a
single `ScikitBuildRedirectingFinder` was on `sys.meta_path`, regardless of
which package it belonged to. With multiple scikit-build-core editable packages
in one environment, every package emits its own `.start` whose `entrypoint()`
calls `install()` with that package's module maps; the package whose `.start`
ran second (and any after) silently skipped registering its finder, so imports
of its redirected wheel modules no longer resolved.
Key the duplicate check to this package by comparing the candidate's
`known_source_files`/`known_wheel_files` against existing finders, so re-running
the same entry point stays idempotent while distinct packages each register.
Assisted-by: ClaudeCode:claude-opus-4.8

@henryiii

@henryiii

henryiii deleted the henryiii/feat/pep829 branch

June 1, 2026 13:21

Closed

5 tasks

Read the original on github.com ↗