Fix egg_info.writers entry point module path - #829
Merged
danieldk merged 1 commit intoSep 16, 2026
Merged
Conversation
The entry point points at `kernels.lockfile`, but `write_egg_lockfile` lives in
`kernels.locking`; no `lockfile` module is shipped in the wheel.
setuptools loads every registered `egg_info.writers` entry point when it runs
`egg_info`, so 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:
pip install kernels
printf 'from setuptools import setup\nsetup(name="smoke", version="0.1")\n' > setup.py
python setup.py egg_info
PEP 517 isolated builds are unaffected, since kernels is absent from the isolated
build environment. Builds using --no-build-isolation reuse the ambient setuptools
and always hit it.
Add a regression test that loads the entry point the way setuptools does.
Contributor
Author
|
Hi @danieldk. Would you please review this PR? Thanks! |
danieldk
approved these changes
Sep 16, 2026
danieldk
pushed a commit
that referenced
this pull request
Sep 16, 2026
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
added a commit
that referenced
this pull request
Sep 16, 2026
Backport of #829 to 0.17. ## Problem 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 ``` ## Cause `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. ## 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. - The reproducer above succeeds. - The new test passes, and fails when reverted to `kernels.lockfile`. Co-authored-by: jiqing-feng <jiqing.feng@intel.com>
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.
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.