Skip to content

docs(proposals): global hook for build-system dependency post-processing - #1272

Open
vshawrh wants to merge 1 commit into
python-wheel-build:mainfrom
vshawrh:docs/global-build-deps-hook-proposal
Open

docs(proposals): global hook for build-system dependency post-processing#1272
vshawrh wants to merge 1 commit into
python-wheel-build:mainfrom
vshawrh:docs/global-build-deps-hook-proposal

Conversation

@vshawrh

@vshawrh vshawrh commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a proposal document for extending fromager.hooks with a get_build_system_dependencies global hook point, allowing downstream projects to post-process build-system dependencies for all packages without per-package plugins.

The implementation is in a separate PR: #1271

Related issue: #1263

@vshawrh
vshawrh requested a review from a team as a code owner July 24, 2026 16:01
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@vshawrh, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2e1023f5-07d9-4bb1-babc-dbb2cf9da632

📥 Commits

Reviewing files that changed from the base of the PR and between 2e8b635 and 89eee4c.

📒 Files selected for processing (1)
  • docs/proposals/global-build-system-dependencies-hook.md
📝 Walkthrough

Walkthrough

Adds a proposal for a fromager.hooks global get_build_system_dependencies hook. The document describes its purpose, execution order, caching behavior, signature, stevedore registration, chaining semantics, example implementation, and interactions with YAML settings, per-package plugins, and cached requirements.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the proposal for a global hook that post-processes build-system dependencies.
Description check ✅ Passed The description accurately explains the proposed global hook and its purpose for downstream projects.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@rd4398

rd4398 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

@vshawrh CI is failing here

@vshawrh
vshawrh force-pushed the docs/global-build-deps-hook-proposal branch from 8c0b285 to 21c93a4 Compare July 30, 2026 17:40

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/proposals/global-build-system-dependencies-hook.md`:
- Line 7: Update the GitHub PR reference in the proposal metadata to point to PR
`#1272`, replacing the current `#1271` link while preserving the existing link
format.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 79113956-8103-4ccd-aad0-004c6a8a5c2e

📥 Commits

Reviewing files that changed from the base of the PR and between d3e21a6 and 21c93a4.

📒 Files selected for processing (1)
  • docs/proposals/global-build-system-dependencies-hook.md

- Created: 2026-07-24
- Status: Proposed
- GitHub issue: [#1263](https://github.com/python-wheel-build/fromager/issues/1263)
- GitHub PR: [#1271](https://github.com/python-wheel-build/fromager/pull/1271)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Correct the PR metadata.

Line 7 points readers to implementation PR #1271, but this proposal is PR #1272; #1271 is the separate implementation change. (github.com)

Suggested fix
-- GitHub PR: [`#1271`](https://github.com/python-wheel-build/fromager/pull/1271)
+- Implementation PR: [`#1271`](https://github.com/python-wheel-build/fromager/pull/1271)
+- Proposal PR: [`#1272`](https://github.com/python-wheel-build/fromager/pull/1272)

As per path instructions, this is a factual metadata correction rather than a formatting suggestion.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- GitHub PR: [#1271](https://github.com/python-wheel-build/fromager/pull/1271)
- Implementation PR: [`#1271`](https://github.com/python-wheel-build/fromager/pull/1271)
- Proposal PR: [`#1272`](https://github.com/python-wheel-build/fromager/pull/1272)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/proposals/global-build-system-dependencies-hook.md` at line 7, Update
the GitHub PR reference in the proposal metadata to point to PR `#1272`, replacing
the current `#1271` link while preserving the existing link format.

Source: Path instructions

@vshawrh
vshawrh force-pushed the docs/global-build-deps-hook-proposal branch from 21c93a4 to 2e8b635 Compare August 3, 2026 01:52
Document the motivation, design, hook signature, chaining behavior,
execution order, and interaction with existing mechanisms for the new
get_build_system_dependencies global hook point.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Vikash Shaw <vshaw@redhat.com>
@vshawrh
vshawrh force-pushed the docs/global-build-deps-hook-proposal branch from 2e8b635 to 89eee4c Compare August 3, 2026 01:55

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/proposals/global-build-system-dependencies-hook.md`:
- Around line 139-146: Update the proposal documentation around
get_build_system_dependencies and its invocation examples to state that Fromager
materializes the Iterable[str] returned by overrides.find_and_invoke() into a
list before calling the global hook. Clarify that the hook receives list[str],
so expressions such as requirements + ["setuptools<82"] work for generator,
tuple, and set results from per-package plugins.
- Around line 124-134: Update the documented build-system dependency resolution
contract around the cache lookup and hook execution flow to define invalidation
when global hooks are installed or changed. Either require clearing existing
build-system-requirements.txt caches or specify how active hook
configuration/version data participates in the cache identity, ensuring stale
requirements cannot bypass run_get_build_system_dependencies_hooks().
- Around line 33-37: Update the Setuptools 81 description in the proposal to
state that it removed support for the setup.py --dry-run option and changed
related class/function signatures; remove the unsupported claim that
distutils.spawn(dry_run=...) and remove_tree(dry_run=...) were removed. Keep the
separate Setuptools 82 pkg_resources removal statement unchanged.
- Line 153: Define an explicit invocation-order contract for global
depends_on_requirement_hook handlers instead of relying on stevedore’s
HookManager discovery order. Either add a Fromager-controlled priority mechanism
or require hooks to be order-independent, and document and test behavior when
multiple global hooks modify build requirements.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f2b63f90-4cbe-484c-940a-272885cc7a66

📥 Commits

Reviewing files that changed from the base of the PR and between 21c93a4 and 2e8b635.

📒 Files selected for processing (1)
  • docs/proposals/global-build-system-dependencies-hook.md

Comment on lines +33 to +37
setuptools 81 removed `distutils.spawn(dry_run=...)` and
`remove_tree(dry_run=...)`. setuptools 82 removed `pkg_resources`
entirely. Many PyPI packages still reference these removed APIs in their
`setup.py`, causing build failures when Fromager resolves an uncapped
setuptools.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
curl -fsSL 'https://setuptools.pypa.io/en/latest/history.html' |
  rg -n -C3 'v81\.0\.0|dry-run|distutils\.spawn|remove_tree'

Repository: python-wheel-build/fromager

Length of output: 2918


Clarify what Setuptools 81 removed.

Setuptools 81 removed support for the setup.py --dry-run option and changed some related class/function signatures. It does not document removal of distutils.spawn(dry_run=...) or remove_tree(dry_run=...).

Suggested wording
- setuptools 81 removed `distutils.spawn(dry_run=...)` and
- `remove_tree(dry_run=...)`.
+ setuptools 81 removed support for the `setup.py --dry-run` option
+ and changed some related distutils/setuptools signatures.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
setuptools 81 removed `distutils.spawn(dry_run=...)` and
`remove_tree(dry_run=...)`. setuptools 82 removed `pkg_resources`
entirely. Many PyPI packages still reference these removed APIs in their
`setup.py`, causing build failures when Fromager resolves an uncapped
setuptools.
setuptools 81 removed support for the `setup.py --dry-run` option
and changed some related distutils/setuptools signatures. setuptools 82 removed `pkg_resources`
entirely. Many PyPI packages still reference these removed APIs in their
`setup.py`, causing build failures when Fromager resolves an uncapped
setuptools.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/proposals/global-build-system-dependencies-hook.md` around lines 33 -
37, Update the Setuptools 81 description in the proposal to state that it
removed support for the setup.py --dry-run option and changed related
class/function signatures; remove the unsupported claim that
distutils.spawn(dry_run=...) and remove_tree(dry_run=...) were removed. Keep the
separate Setuptools 82 pkg_resources removal statement unchanged.

Source: Path instructions

Comment on lines +124 to +134
1. Check for cached requirements file (early return if exists)
2. overrides.find_and_invoke() <-- per-package plugin or default
3. hooks.run_get_build_system_dependencies_hooks() <-- NEW
4. _filter_requirements() <-- marker evaluation
5. Write requirements cache file
```

This means per-package plugins still produce the initial dependency
list, global hooks can then augment it, and marker filtering happens
last so hooks do not need to handle markers themselves. The result is
cached, so hooks run only once per package per build.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Define cache invalidation for global hook changes.

The resolver returns build-system-requirements.txt before it invokes any hook. If the file was created before a global hook was installed or changed, the hook never applies and stale requirements remain cached.

Document a required cache clear, or include the active hook configuration/version in the cache identity.

As per path instructions, this comment addresses a concrete dependency-resolution contract issue.

Also applies to: 191-192

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/proposals/global-build-system-dependencies-hook.md` around lines 124 -
134, Update the documented build-system dependency resolution contract around
the cache lookup and hook execution flow to define invalidation when global
hooks are installed or changed. Either require clearing existing
build-system-requirements.txt caches or specify how active hook
configuration/version data participates in the cache identity, ensuring stale
requirements cannot bypass run_get_build_system_dependencies_hooks().

Source: Path instructions

Comment thread docs/proposals/global-build-system-dependencies-hook.md
Comment thread docs/proposals/global-build-system-dependencies-hook.md
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.

2 participants