[None][build] Add --yes flag to build_wheel.py to skip interactive prompt#16015
Conversation
…ompt When running inside a pseudo-TTY (e.g. via script(1) or CI), the PyTorch compatibility warning in build_wheel.py blocks indefinitely waiting for a keypress. Add --yes / -y to suppress the prompt while still printing the warning text. Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
📝 WalkthroughWalkthroughAdds a ChangesNon-interactive Build Flag
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
scripts/build_wheel.py (1)
138-176: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocstring not updated for new
yesparameter.The
yesparameter is added to the signature but the docstring's Args section still only documentsproject_dir,requirements_file, andno_venv(and evenno_venvwas already undocumented). As per coding guidelines, "Externally called functions should have docstrings, and their arguments should be documented."📝 Suggested docstring update
Args: project_dir: The root directory of the project. requirements_file: Path to the requirements file. + no_venv: Use current Python environment as is. + yes: Skip interactive confirmation prompts.🤖 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 `@scripts/build_wheel.py` around lines 138 - 176, Update the setup_venv docstring to document all callable arguments, including the new yes parameter and the existing no_venv flag, so the Args section matches the function signature. Locate setup_venv in build_wheel.py and add a brief description for each parameter, keeping the wording consistent with the rest of the file’s docstrings.Source: Coding guidelines
🤖 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.
Nitpick comments:
In `@scripts/build_wheel.py`:
- Around line 138-176: Update the setup_venv docstring to document all callable
arguments, including the new yes parameter and the existing no_venv flag, so the
Args section matches the function signature. Locate setup_venv in build_wheel.py
and add a brief description for each parameter, keeping the wording consistent
with the rest of the file’s docstrings.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 188e9989-40c5-4c59-ae7b-bd2988f7409b
📒 Files selected for processing (1)
scripts/build_wheel.py
|
/bot run |
|
PR_Github #57877 [ run ] triggered by Bot. Commit: |
|
PR_Github #57877 [ run ] completed with state
|
|
/bot skip --comment "build stages passed" |
|
PR_Github #58067 [ skip ] triggered by Bot. Commit: |
|
PR_Github #58067 [ skip ] completed with state |
…ompt (NVIDIA#16015) Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
…ompt (NVIDIA#16015) Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
Summary
build_wheel.pyblocks indefinitely on an interactiveinput()prompt when it detects PyPI PyTorch inside an NVIDIA container venv. This blocks non-interactive builds that run inside a pseudo-TTY (e.g. viascript(1)), sinceisatty()returns True in that case.--yes/-yflag tobuild_wheel.py(and thread it throughsetup_venv) to skip the prompt while still printing the warning.Test plan
build_wheel.py --yes --install ...in a container with an existing.venvthat has PyPI PyTorch — confirm it prints the warning but does not block.--yesin an interactive shell — confirm the prompt still appears.Summary by CodeRabbit
--yes/-yoption to run builds without interactive confirmation prompts.