Skip to content

Fix egg_info.writers entry point module path (#829) - #830

Merged
danieldk merged 1 commit into
release-0.17from
fix-entrypoint-backport
Sep 16, 2026
Merged

danieldk merged 1 commit into
release-0.17from
fix-entrypoint-backport

Conversation

@danieldk

Copy link
Copy Markdown
Member

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:

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:

[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.

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
danieldk force-pushed the fix-entrypoint-backport branch from 9433a44 to 6c71eb2 Compare September 16, 2026 06:38
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

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.

@danieldk
danieldk merged commit 9ea00b7 into release-0.17 Sep 16, 2026
34 of 36 checks passed
@danieldk
danieldk deleted the fix-entrypoint-backport branch September 16, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants