Skip to content

fix: quote nvidia-modelopt requirement in build_conda.sh#1927

Open
zhiminwei551 wants to merge 3 commits into
THUDM:mainfrom
zhiminwei551:fix/quote-modelopt-requirement
Open

fix: quote nvidia-modelopt requirement in build_conda.sh#1927
zhiminwei551 wants to merge 3 commits into
THUDM:mainfrom
zhiminwei551:fix/quote-modelopt-requirement

Conversation

@zhiminwei551
Copy link
Copy Markdown

@zhiminwei551 zhiminwei551 commented May 20, 2026

What

Quote the nvidia-modelopt[torch]>=0.37.0 requirement in build_conda.sh.

Why

Without quotes, the shell parses > as stdout redirection:

pip install nvidia-modelopt[torch]>=0.37.0 --no-build-isolation

As a result, the version constraint is not passed to pip as intended, and a file named =0.37.0 can be created/truncated in the working directory.

pip documentation recommends quoting requirement specifiers in the shell when using >, <, or environment markers:
https://pip.pypa.io/en/stable/reference/requirement-specifiers/#examples

Tested

bash -n build_conda.sh

I also verified the shell parsing behavior with:

tmpdir="$(mktemp -d)"
cd "$tmpdir"

echo nvidia-modelopt[torch]>=0.37.0 --no-build-isolation
ls -la  # creates '=0.37.0'

rm -f '=0.37.0'
echo "nvidia-modelopt[torch]>=0.37.0" --no-build-isolation
ls -la  # does not create '=0.37.0'

@zhiminwei551
Copy link
Copy Markdown
Author

I noticed that #1554 appears to address the same shell redirection issue. This PR includes a more detailed reproduction and testing notes, but I’m happy to close it if maintainers prefer to keep the older one.

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.

1 participant