Skip to content

feat(sources): add explicit tarball sdist-base strategies - #1479

Open
tiran wants to merge 1 commit into
python-wheel-build:mainfrom
tiran:issue-1478-sdist-base-strategies
Open

tiran wants to merge 1 commit into
python-wheel-build:mainfrom
tiran:issue-1478-sdist-base-strategies

Conversation

@tiran

@tiran tiran commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Pull Request Description

What

Replace the ambiguous build_sdist: tarball with tarball-build-dir (pack the wheel build directory) and tarball-root-dir (pack the whole source tree). Keep tarball as a deprecated alias of tarball-build-dir, normalized with a warning during settings validation.

Why

Fixes: #1478

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The settings add tarball-build-dir and tarball-root-dir. The deprecated tarball value maps to tarball-build-dir with a warning. PyPI sdist and download resolvers now default to tarball-build-dir. The source-distribution builder can archive the wheel build directory or the full prepared source tree. Tests and documentation cover the strategies, alias, and defaults.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 59311

This change adds explicit tarball strategies and keeps the deprecated alias working with a warning. Existing behavior is preserved, and no merge-blocking risk has been identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: new explicit tarball sdist-base strategies for build_sdist. The changeset adds tarball-build-dir and tarball-root-dir strategies and marks tarball as a deprecated alia…
Description check Passed The description states what changes (replacing the ambiguous tarball setting with tarball-build-dir and tarball-root-dir, keeping tarball as a deprecated alias with a warning) and links the issue it f…
Linked Issues check Passed Directly linked issue #1478 has these coding requirements: (1) add tarball-build-dir (pack the build directory, existing behavior); (2) add tarball-root-dir (pack the whole source tree); (3) keep …
Out of Scope Changes check Passed All changed areas map to the #1478 objective. Source changes: _resolver.py (new enum values, alias normalization, default changes) and _models.py (passes package name and has_config to validatio…
Full details: Title check

Explanation

The title names the main change: new explicit tarball sdist-base strategies for build_sdist. The changeset adds tarball-build-dir and tarball-root-dir strategies and marks tarball as a deprecated alias, so the title matches the primary change. The conventional-commit prefix is acceptable.

Full details: Description check

Explanation

The description states what changes (replacing the ambiguous tarball setting with tarball-build-dir and tarball-root-dir, keeping tarball as a deprecated alias with a warning) and links the issue it fixes. This matches the changeset in the settings, sources, docs, and tests.

Full details: Linked Issues check

Explanation

Directly linked issue #1478 has these coding requirements: (1) add tarball-build-dir (pack the build directory, existing behavior); (2) add tarball-root-dir (pack the whole source tree); (3) keep tarball as a deprecated alias of tarball-build-dir with a warning; (4) no existing setting changes behavior; (5) no pep517 counterpart. Evidence in the reviewed changes: src/fromager/packagesettings/_resolver.py adds BuildSDist.tarball_build_dir and BuildSDist.tarball_root_dir, marks tarball as a deprecated alias, and adds a field validator (_normalize_deprecated_tarball) that maps tarball to tarball-build-dir and logs a warning. src/fromager/sources.py adds the tarball-root-dir dispatch and an optional sdist_base_dir (default build_dir) used as the archive base. PyPISDistResolver and PyPIDownloadResolver default to tarball-build-dir, which keeps prior behavior. pep517 is not changed. Tests in tests/test_packagesettings.py, tests/test_packagesettings_resolver.py, and tests/test_sources.py cover the alias warning, the new strategies, and root-directory archiving with build_dir kept for the wheel build. Limits: the build_sdist dispatch section of src/fromager/sources.py was past the 16000-byte read limit, and the diff tool was unavailable. The dispatch behavior rests on the change summary and test descriptions, not on a direct read of that section.

Full details: Out of Scope Changes check

Explanation

All changed areas map to the #1478 objective. Source changes: _resolver.py (new enum values, alias normalization, default changes) and _models.py (passes package name and has_config to validation context for the warning message), and sources.py (tarball dispatch and sdist_base_dir). Documentation changes: docs/concepts/resolver-architecture.rst, docs/reference/config-reference.rst, and docs/reference/hooks.rst describe the new strategies and the alias. Config and test changes: e2e/source_settings_hook_sdist/stevedore.yaml and tests/test_commands.py move from tarball to tarball-build-dir, and the test files cover the new behavior. The default_build_sdist signature gains only an optional keyword argument. No unrelated change was identified in the available evidence.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 93023a9 and 59311c1.

Files selected for processing: 11

  • docs/concepts/resolver-architecture.rst
  • docs/reference/config-reference.rst
  • docs/reference/hooks.rst
  • e2e/source_settings_hook_sdist/stevedore.yaml
  • src/fromager/packagesettings/_models.py
  • src/fromager/packagesettings/_resolver.py
  • src/fromager/sources.py
  • tests/test_commands.py
  • tests/test_packagesettings.py
  • tests/test_packagesettings_resolver.py
  • tests/test_sources.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@mergify mergify Bot added the ci label Nov 20, 2026
Replace the ambiguous `build_sdist: tarball` with `tarball-build-dir`
(pack the wheel build directory) and `tarball-root-dir` (pack the whole
source tree). Keep `tarball` as a deprecated alias of
`tarball-build-dir`, normalized with a warning during settings
validation.

Fixes: python-wheel-build#1478
Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Christian Heimes <cheimes@redhat.com>
@tiran
tiran force-pushed the issue-1478-sdist-base-strategies branch from cb2c9a5 to 59311c1 Compare November 20, 2026 13:55
@tiran
tiran marked this pull request as ready for review November 20, 2026 13:55
@tiran
tiran requested a review from a team as a code owner November 20, 2026 13:55

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add explicit sdist-base strategies: tarball-build-dir and tarball-root-dir

1 participant