Skip to content

feat(cli): add option for a single output-dir and hide options#1099

Merged
mergify[bot] merged 1 commit intopython-wheel-build:mainfrom
jlarkin09:feat/add-output-dir-cli-option
May 7, 2026
Merged

feat(cli): add option for a single output-dir and hide options#1099
mergify[bot] merged 1 commit intopython-wheel-build:mainfrom
jlarkin09:feat/add-output-dir-cli-option

Conversation

@jlarkin09
Copy link
Copy Markdown
Contributor

Add a new -O/--output-dir option that sets the base directory for sdists-repo, wheels-repo, and work-dir. The individual directory options are hidden but still functional for backwards compatibility. When --output-dir is "." (the default), behavior is identical to before.

Simplifies the CLI by consolidating three separate directory options into one. Addresses review feedback from #905.

Closes: #721

@jlarkin09 jlarkin09 requested a review from a team as a code owner April 30, 2026 14:15
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Warning

Rate limit exceeded

@tiran has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minute and 23 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d283f8c8-3371-4fa5-bb9e-9d549cfad288

📥 Commits

Reviewing files that changed from the base of the PR and between 215987c and 2a36e7f.

📒 Files selected for processing (2)
  • src/fromager/__main__.py
  • tests/test_cli.py
📝 Walkthrough

Walkthrough

This change consolidates output directory handling in the CLI by introducing a new --output-dir/-O option. The --sdists-repo, --wheels-repo, and --work-dir flags are converted to optional override-style options that default to None. The main function applies precedence logic: when these per-directory values are not provided, they are derived from the output directory by appending subdirectory names. The derived paths are then passed to context.WorkContext.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title accurately describes the main change: adding a new --output-dir CLI option and hiding existing directory options.
Description check ✅ Passed Description clearly relates to the changeset, explaining the new -O/--output-dir option, backwards compatibility, and issue references.
Linked Issues check ✅ Passed PR fully implements the requirement from #721 to simplify output directory handling with a single --output-dir flag while maintaining backwards compatibility.
Out of Scope Changes check ✅ Passed All changes are directly related to the --output-dir feature and CLI parameter updates specified in issue #721; no out-of-scope modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/fromager/__main__.py (1)

164-185: ⚡ Quick win

Add a docstring to main() after expanding its public CLI contract.

main() gained new behavior and parameters (output_dir + override precedence), so a short docstring here would improve maintainability and CLI intent clarity.

As per coding guidelines, "Add docstrings on all public functions and classes".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/fromager/__main__.py` around lines 164 - 185, Add a concise docstring to
the public function main() explaining its purpose as the CLI entrypoint,
summarizing the new behavior and parameter roles (notably output_dir and its
override precedence relative to settings_file/settings_dir), documenting key
parameters like output_dir, sdists_repo, wheels_repo, work_dir, patches_dir,
settings_file/settings_dir, constraints_file, cleanup, variant, jobs,
network_isolation, and min_release_age, and stating it returns None; place the
docstring directly after the def main(...) signature so future maintainers
understand the CLI contract and override rules.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/fromager/__main__.py`:
- Around line 164-185: Add a concise docstring to the public function main()
explaining its purpose as the CLI entrypoint, summarizing the new behavior and
parameter roles (notably output_dir and its override precedence relative to
settings_file/settings_dir), documenting key parameters like output_dir,
sdists_repo, wheels_repo, work_dir, patches_dir, settings_file/settings_dir,
constraints_file, cleanup, variant, jobs, network_isolation, and
min_release_age, and stating it returns None; place the docstring directly after
the def main(...) signature so future maintainers understand the CLI contract
and override rules.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bbdcde0a-dfa2-4165-9c30-073413d53171

📥 Commits

Reviewing files that changed from the base of the PR and between a19dea7 and 215987c.

📒 Files selected for processing (1)
  • src/fromager/__main__.py

Copy link
Copy Markdown
Contributor

@smoparth smoparth left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@rd4398 rd4398 left a comment

Choose a reason for hiding this comment

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

This looks good! Thanks

@shifa-khan
Copy link
Copy Markdown
Contributor

LGTM

@tiran
Copy link
Copy Markdown
Collaborator

tiran commented May 7, 2026

@Mergifyio rebase

Add a new -O/--output-dir option that sets the base directory for
sdists-repo, wheels-repo, and work-dir. The individual directory
options are hidden but still functional for backwards compatibility.
When --output-dir is "." (the default), behavior is identical to
before.

Closes: python-wheel-build#721
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Justin Larkin <jlarkin@redhat.com>
Made-with: Cursor
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 7, 2026

Deprecation notice: This pull request comes from a fork and was rebased using bot_account impersonation. This capability will be removed on July 1, 2026. After this date, the rebase action will no longer be able to rebase fork pull requests with this configuration. Please switch to the update action/command to ensure compatibility going forward.

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 7, 2026

rebase

✅ Branch has been successfully rebased

@tiran tiran force-pushed the feat/add-output-dir-cli-option branch from 7df9620 to 2a36e7f Compare May 7, 2026 11:31
@mergify mergify Bot merged commit 5fd5d20 into python-wheel-build:main May 7, 2026
39 checks passed
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.

Simplify output directory handling

5 participants