Skip to content

cleanup(bootstrapper): expose DEFAULT_BG_THREADS as public class constant#1261

Merged
LalatenduMohanty merged 1 commit into
python-wheel-build:mainfrom
rd4398:issue-1246
Jul 23, 2026
Merged

cleanup(bootstrapper): expose DEFAULT_BG_THREADS as public class constant#1261
LalatenduMohanty merged 1 commit into
python-wheel-build:mainfrom
rd4398:issue-1246

Conversation

@rd4398

@rd4398 rd4398 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Make DEFAULT_BG_THREADS a public class constant on Bootstrapper
instead of a private module-level _DEFAULT_BG_THREADS in _types.py.
The CLI layer now references Bootstrapper.DEFAULT_BG_THREADS for the
--bg-threads default, keeping the thread-count knowledge with the
bootstrapper while giving it a clean public API surface.

Closes: #1246

@rd4398
rd4398 requested a review from a team as a code owner July 22, 2026 14:52
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 50 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: 1776cbbd-5ab9-481f-bdb4-bf39027fd7f6

📥 Commits

Reviewing files that changed from the base of the PR and between 182e0e1 and 39d29be.

📒 Files selected for processing (4)
  • src/fromager/bootstrapper/__init__.py
  • src/fromager/bootstrapper/_bootstrapper.py
  • src/fromager/bootstrapper/_types.py
  • src/fromager/commands/bootstrap.py
📝 Walkthrough

Walkthrough

The bootstrapper package now exports only Bootstrapper. Bootstrapper computes its default background thread count from the CPU count and accepts an optional override. Both bootstrap CLI commands use Bootstrapper.DEFAULT_BG_THREADS for their --bg-threads defaults.

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

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR addresses [#1246] by removing _DEFAULT_BG_THREADS from the package export surface and keeping the CLI default working.
Out of Scope Changes check ✅ Passed The changes are confined to the bootstrapper default-thread cleanup and the CLI consumer update.
Title check ✅ Passed The title clearly describes the main change: moving DEFAULT_BG_THREADS to a public Bootstrapper class constant.
Description check ✅ Passed The description matches the changeset and explains the API and CLI default updates.

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.

Comment thread src/fromager/commands/bootstrap.py Outdated

@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 `@src/fromager/bootstrapper/_bootstrapper.py`:
- Line 81: Update the _num_bg_threads assignment in the bootstrapper initializer
to distinguish an explicit num_bg_threads value of 0 from None or other absent
values, so 0 continues to normalize to one worker while omitted values use
DEFAULT_BG_THREADS. Preserve the existing max(1, ...) lower-bound behavior.
🪄 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

Run ID: 672a3a07-8548-4585-ac7e-f3d445ff22af

📥 Commits

Reviewing files that changed from the base of the PR and between 5c92caa and 182e0e1.

📒 Files selected for processing (4)
  • src/fromager/bootstrapper/__init__.py
  • src/fromager/bootstrapper/_bootstrapper.py
  • src/fromager/bootstrapper/_types.py
  • src/fromager/commands/bootstrap.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/fromager/bootstrapper/init.py

Comment thread src/fromager/bootstrapper/_bootstrapper.py Outdated

@LalatenduMohanty LalatenduMohanty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The PR looks good to me. Once you fix the PR description we should be able to merge it.

@smoparth smoparth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Making DEFAULT_BG_THREADS as public is good choice. I just mentioned small nitpick above.

Comment thread src/fromager/bootstrapper/_bootstrapper.py Outdated
@rd4398 rd4398 changed the title cleanup(bootstrapper): remove _DEFAULT_BG_THREADS from __all__ cleanup(bootstrapper): Remove _DEFAULT_BG_THREADS from the public API Jul 23, 2026
@rd4398 rd4398 changed the title cleanup(bootstrapper): Remove _DEFAULT_BG_THREADS from the public API cleanup(bootstrapper): expose DEFAULT_BG_THREADS as public class constant Jul 23, 2026
…nstant

Make `DEFAULT_BG_THREADS` a public class constant on `Bootstrapper`
instead of a private module-level `_DEFAULT_BG_THREADS` in `_types.py`.
The CLI layer now references `Bootstrapper.DEFAULT_BG_THREADS` for the
`--bg-threads` default, keeping the thread-count knowledge with the
bootstrapper while giving it a clean public API surface.

Co-Authored-By: Claude <claude@anthropic.com>
Closes: python-wheel-build#1246
Signed-off-by: Rohan Devasthale <rdevasth@redhat.com>
@LalatenduMohanty
LalatenduMohanty merged commit 3f11933 into python-wheel-build:main Jul 23, 2026
39 checks passed
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.

cleanup(bootstrapper): clarify public/private status of _DEFAULT_BG_THREADS

3 participants