Repository navigation
Conversation
The invocations of `pip` in `./scripts/generate_requirements.sh` where not as well isolated from the environment as the Bazel rules in `WORKSPACE`. This could lead to the host environment unexpectedly affecting the `requirements.txt` files generated by the script. This PR changes `generate_requirements.sh` to (1) set the PyPI index:(like `WORKSPACE` does), (2) prevent any `trusted-host` settings in `/etc/pip.conf from leaking into `requirements.txt`, and (3) ignore PIP variable settings. This makes the script produce more predictable requirements files.
mhucka
marked this pull request as ready for review
November 20, 2026 03:27
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the generate_requirements.sh script to ensure deterministic dependency resolution by unsetting local PIP_* environment variables, setting PIP_CONFIG_FILE=/dev/null, and explicitly configuring PyPI as the index URL. The review feedback recommends replacing the use of compgen with native Bash parameter expansion (${!PIP_@}) to unset the variables, which improves robustness and compatibility in minimal environments.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The invocations of
pipin./scripts/generate_requirements.shwhere not as well isolated from the environment as the Bazel rules inWORKSPACE. This could lead to the host environment unexpectedly affecting therequirements.txtfiles generated by the script, as well as baffling run-time failures to get the expected versions of some transitive dependencies.This PR changes
generate_requirements.shto (1) set the PyPI index:(likeWORKSPACEdoes), (2) prevent anytrusted-hostsettings in/etc/pip.conf from leaking intorequirements.txt`, and (3) ignore PIP variable settings. This makes the script produce more predictable requirements files.