Fix egg_info.writers entry point module path (#829) - #830
Merged
Merged
Conversation
With `kernels` installed, any setuptools source build in the same
environment fails, including builds of unrelated packages:
```
File "setuptools/command/egg_info.py", line 304, in run
writer = ep.load()
ModuleNotFoundError: No module named 'kernels.lockfile'
```
Reproducer:
```bash
pip install kernels==0.17.0
printf 'from setuptools import setup\nsetup(name="smoke", version="0.1")\n' > setup.py
python setup.py egg_info
```
`kernels/pyproject.toml` registers a setuptools entry point pointing at
a module that is not shipped:
```toml
[project.entry-points."egg_info.writers"]
"kernels.lock" = "kernels.lockfile:write_egg_lockfile"
```
`write_egg_lockfile` lives in `kernels/locking.py`; there is no
`kernels/lockfile.py` in the wheel. The entry point was not updated when
`lockfile.py` was renamed to `locking.py`.
setuptools loads **all** registered `egg_info.writers` on every
`egg_info` run, so a broken writer from any installed distribution takes
down unrelated builds. PEP 517 isolated builds are unaffected;
`--no-build-isolation` builds reuse the ambient setuptools and always
hit it.
Present in 0.17.0 and on `main`; 0.16.2 is the last good release.
Point the entry point at `kernels.locking`, and add a regression test
that loads it the way setuptools does — nothing covered this path, which
is why the rename regressed silently.
Built a wheel from this branch and installed it:
- `ep.load()` resolves to the real function.
- The reproducer above succeeds.
- The new test passes, and fails when reverted to `kernels.lockfile`.
danieldk
force-pushed
the
fix-entrypoint-backport
branch
from
September 16, 2026 06:38
9433a44 to
6c71eb2
Compare
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #829 to 0.17.
Problem
With
kernelsinstalled, any setuptools source build in the same environment fails, including builds of unrelated packages:Reproducer:
Cause
kernels/pyproject.tomlregisters a setuptools entry point pointing at a module that is not shipped:write_egg_lockfilelives inkernels/locking.py; there is nokernels/lockfile.pyin the wheel. The entry point was not updated whenlockfile.pywas renamed tolocking.py.setuptools loads all registered
egg_info.writerson everyegg_inforun, so a broken writer from any installed distribution takes down unrelated builds. PEP 517 isolated builds are unaffected;--no-build-isolationbuilds reuse the ambient setuptools and always hit it.Present in 0.17.0 and on
main; 0.16.2 is the last good release.Fix
Point the entry point at
kernels.locking, and add a regression test that loads it the way setuptools does — nothing covered this path, which is why the rename regressed silently.Validation
Built a wheel from this branch and installed it:
ep.load()resolves to the real function.kernels.lockfile.