Repository navigation
Add '--no-pip-upgrade' flag to 'venv create' command - #42
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The opt-out behavior is inverted, and the identified test and Python-version compatibility issues remain unresolved.
3 open issues
What changed in this PR
This pull request makes pip upgrades the default for venv create and adds a --no-pip-upgrade opt-out, with supporting documentation, shell completions, and test updates.
Changes:
- Adds parsing, help text, and Bash/Zsh completion for
--no-pip-upgrade. - Updates creation, installation, and lock tests for pip upgrades and dependency versions.
- Documents the new default behavior and opt-out flag.
| File | Reviewed changes |
|---|---|
tests/test_venv_lock.py |
Updates requirement filename construction to use enum values. |
tests/test_venv_lock_cases.py |
Updates NumPy dependency fixtures. |
tests/test_venv_install.py |
Filters pip upgrade output and updates package test data. |
tests/test_venv_install_cases.py |
Updates dependency versions, package data, and parameter naming. |
tests/test_venv_create.py |
Adds mocked creation, flag, and help tests. Moderate issue (2 votes): coverage does not verify the new flag semantics or the default upgrade path. |
tests/helpers.py |
Selects NumPy versions based on the Python runtime. Moderate issue (4 votes): the sys.version_info comparison incorrectly handles exactly Python 3.10. |
src/venv-cli/venv.sh |
Adds create-option parsing and pip upgrade handling. Critical issue (4 votes): --no-pip-upgrade currently enables --upgrade-deps instead of disabling it; the same issue appears at lines 120, 165, and 166. |
src/venv-cli/completions/zsh/venv_completion.sh |
Adds Zsh completion for --no-pip-upgrade. |
src/venv-cli/completions/bash/venv_completion.sh |
Adds Bash completion for --no-pip-upgrade. |
README.md |
Documents automatic pip upgrades and the opt-out flag. |
Review effort: Lite
connesy
force-pushed
the
auto-upgrade-pip
branch
from
October 22, 2026 10:56
42c2a5b to
f613e55
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The create command can pass an unintended empty environment path and can report success when environment creation or pip upgrading fails; the default upgrade and failure paths also need test coverage.
4 open issues
2 resolved since last review
Review effort: Lite
… behavior' Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
connesy
force-pushed
the
auto-upgrade-pip
branch
from
October 22, 2026 11:21
ea8851c to
9b0a578
Compare
oliverpetersen
approved these changes
Oct 22, 2026
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 new default behavior of
venv createis to automatically runpip install --upgrade pipafter creating the virtual environment.This decision was made after GHSA-6q48-6c7w-9gw2, which compromises all versions of pip before
26.2.2. When using e.g.python3.10 -m venv .venvto create a virtual environment, the default behavior is to use the version ofpipthat ships with the distribution, e.g.:Since these are compromised, the safe behavior is to pass
--upgrade-depswhen creating the virtual environment, so that is whatvenv createnow does per default.This can be disabled by passing
--no-pip-upgrade, but this is not advised.