Skip to content

fix(dependencies): use the sdist requirements hook - #1352

Open
mikedep333 wants to merge 1 commit into
python-wheel-build:mainfrom
mikedep333:issue-1351-sdist-deps
Open

mikedep333 wants to merge 1 commit into
python-wheel-build:mainfrom
mikedep333:issue-1351-sdist-deps

Conversation

@mikedep333

Copy link
Copy Markdown
Member

Pull Request Description

What

Use get_requires_for_build_sdist() when discovering sdist dependencies,
and correct the associated docstring.

Add regression tests using real backend subprocess calls covering distinct
wheel and sdist requirements, an absent optional sdist hook, and a failing
wheel hook. All three cases fail before the fix and pass afterward.

Existing cached sdist requirements are not invalidated.

Why

Sdist dependency discovery currently calls the wheel requirements hook.
This can omit sdist-only dependencies, record wheel dependencies as sdist
requirements, and unnecessarily execute wheel-specific backend logic.

Closes #1351.

Call get_requires_for_build_sdist when discovering sdist dependencies instead
of invoking the wheel requirements hook. Correct the matching docstring.

Cover distinct wheel and sdist requirements, the empty default for an absent
sdist hook, and a failing wheel hook using real backend subprocess calls.

Closes: python-wheel-build#1351
Co-Authored-By: OpenAI Codex <noreply@openai.com>
Signed-off-by: Mike DePaulo <mikedep333@redhat.com>
@mikedep333
mikedep333 requested a review from a team as a code owner September 29, 2026 23:05
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: python-wheel-build/fromager/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 43871afd-4bd7-4c60-9e0f-2a0dc62ea23b

📥 Commits

Reviewing files that changed from the base of the PR and between 27db2d6 and c729f36.

📒 Files selected for processing (2)
  • src/fromager/dependencies.py
  • tests/test_dependencies.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.


📝 Walkthrough

Walkthrough

default_get_build_sdist_dependencies now calls get_requires_for_build_sdist instead of the wheel requirements hook. Tests cover distinct hook results, a failing wheel hook, and an absent sdist hook.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to c729f

The change aligns source-build dependency discovery with the sdist hook while preserving existing cache behavior. No actionable merge-blocking risk is identified; merge after normal checks pass.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: using the sdist requirements hook for dependency discovery.
Description check ✅ Passed The description directly explains the hook change, affected behavior, regression tests, rationale, and linked issue.
Linked Issues check ✅ Passed Issue #1351 requires default_get_build_sdist_dependencies() to use get_requires_for_build_sdist(), return its requirements, return an empty list when the optional hook is absent, and avoid the whe…
Out of Scope Changes check ✅ Passed The changes stay within Issue #1351. The production change fixes the hook selection. The added tests verify the required behavior through pyproject_hooks subprocess calls. No unrelated source or tes…

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

Comment @coderabbitai help to get the list of available commands.

@mikedep333

Copy link
Copy Markdown
Member Author

@dhellmann I talked to tiran at the meeting, and he suggested asking you if there was an intentional reason why default_get_build_sdist_dependencies originally called get_requires_for_build_wheel

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.

[Bug]: Sdist dependency discovery calls the wheel requirements hook

1 participant