Custom pip args used during install are not reused when checking for upgrades.
Additionally, even an unsuccessful upgrade overwrites the pip args in pipx metadata (with an empty list, in case the required custom pip args are not explicitly repeated on the pipx upgrade command line).
However, they are completely ignored and then promptly overwritten with an empty list after running pipx upgrade foo (which usually does not find a newer version due to missing custom index URL, incorrect CA certificate bundle used, etc.).
I would expect pipx upgrade foo to always reuse the remembered pip_args from installation.
Notably, pipx upgrade-all already correctly reuses the install-time pip args when looking for upgrades, so things like custom index URLs and associated CA certificates work there. All hell breaks loose when I try to pipx upgrade just a single package though. :)
Describe the bug
Custom pip args used during install are not reused when checking for upgrades.
Additionally, even an unsuccessful upgrade overwrites the pip args in pipx metadata (with an empty list, in case the required custom pip args are not explicitly repeated on the pipx upgrade command line).
How to reproduce
pipx install --index-url https://custom-index.example.com --pip-args=--cert=/path/to/custom/ca.pem foo
pipx upgrade --verbose foo
Expected behavior
Pipx clearly remembers the original pip args from installation, as can be seen in
~/.local/pipx/venvs/foo/pipx_metadata.json
(edited for brevity):However, they are completely ignored and then promptly overwritten with an empty list after running
pipx upgrade foo
(which usually does not find a newer version due to missing custom index URL, incorrect CA certificate bundle used, etc.).I would expect
pipx upgrade foo
to always reuse the rememberedpip_args
from installation.Notably,
pipx upgrade-all
already correctly reuses the install-time pip args when looking for upgrades, so things like custom index URLs and associated CA certificates work there. All hell breaks loose when I try topipx upgrade
just a single package though. :)