You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
build_sdist plugin hooks can't be used with source: #1445
When a package uses source:, Fromager skips its custom build_sdist plugin hook and logs a warning. This also happens with provider: hook-sdist. Packages without source: still use the hook.
This prevents some packages from moving to source:. Their hooks do work that the available pep517 and tarball methods cannot replace, such as:
Including the whole repository while the wheel builds from a subdirectory.
Choosing a build directory based on the version.
Generating files before creating the source archive.
Steps to reproduce
This can be reproduced at the sdist build stage without downloading or compiling a package:
Create a prepared source tree:
pkg-1.0/
├── native.c
└── python/
└── setup.py
Set build_dir: python.
Provide a build_sdist plugin hook that archives the whole source tree, including native.c.
Call sources.build_sdist() without source: settings. The hook runs, and the archive includes native.c.
Repeat with these settings:
build_dir: pythonsource:
provider: pypi-sdist
pypi-sdist uses the tarball build method.
Actual result
Fromager skips the hook and archives only python/. The resulting sdist is missing native.c, but passes Fromager's output validation.
The same problem occurs with hook-sdist configured with build_sdist: tarball. A focused unit test confirms both cases, with the legacy path as a comparison.
A successful wheel build may hide the missing file because Fromager builds the wheel from the prepared source tree rather than from the new sdist.
Expected behavior
Provide an explicit way to use a custom build_sdist hook with source:. Keep the current precedence when users select pep517 or tarball.
Also document this limitation in the build_sdist hook reference.
This is a migration gap introduced by #1385. Existing packages that keep their legacy settings continue to use their hooks.
Activity
fix(sources): allow sdist hooks with source config
fix(sources): allow sdist hooks with source config
fix(sources): allow sdist hooks with source config
fix(sources): allow sdist hooks with source config