Skip to content

Conversation

ghost
Copy link

@ghost ghost commented Apr 26, 2024

Fix #1344

  • I have added a news fragment under changelog.d/ (if the patch affects the end users)

Summary of changes

The --system-site-package option currently doesn't do anything when used with upgrade --install.
This PR adds venv_args to the upgrade command so that it can be passed through to the install command, when the --install option is set.

Test plan

Tested by running

pipx upgrade --install --system-site-packages pycowsay
grep system $HOME/.local/share/pipx/venvs/pycowsay/pyvenv.cfg

Before the PR this returns:

include-system-site-packages = false

After applying the PR it returns:

include-system-site-packages = true
command = /usr/bin/python3.12 -m venv --without-pip --system-site-packages /home/sadamczyk/.local/share/pipx/venvs/pycowsay

Also successfully tested by installing https://github.com/essembeh/gnome-extensions-cli which requires the system site packages to work for the --dbus integration. Before this ran into an error because of the missing required
system dependencies.

pipx upgrade --install --system-site-packages gnome-extensions-cli
gext --dbus update --install -y nightthemeswitcher@romainvigier.fr

Co-authored-by: chrysle <fritzihab@posteo.de>
@chrysle chrysle changed the title Fix --system-site-package for upgrade --install Fix --system-site-packages for upgrade --install Apr 29, 2024
@chrysle chrysle enabled auto-merge (squash) April 30, 2024 14:00
@chrysle chrysle merged commit 9c655e0 into pypa:main Apr 30, 2024
@chrysle
Copy link
Contributor

chrysle commented Apr 30, 2024

Thanks!

@ghost ghost deleted the fix-upgrade-install-system-site-packages branch April 30, 2024 14:30
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.

pipx upgrade --install ignores --system-site-packages option
1 participant