`pip config` should support `add` and `remove` commands
See original GitHub issueWhat’s the problem this feature will solve?
I use the pip config command quite a lot, but it does not allow me to add multiple entries to trusted-hosts or to remove a value from the config. This would greatly improve usability for me.
Describe the solution you’d like
Being able to add a value to trusted hosts or index-url with:
pip config add global.trusted-host artifactory.mycompany.com
pip config remove global.trusted-host artifactory.mycompany.com
Alternative Solutions
Currently I just use preexisting configs and keep swapping them out. However, this is an interim solution that is really not helping. Our company has a tight lockdown on the network, and when we switch to external networks, we need to remove the index-urls and add external ones to trusted hosts. We would rather not directly download from pypi or files.pythonhosted.org on company VPN.
Additionally, this is very different from pip config set
which sets and unsets absolute values. In this scenario, I could engineer a mix of values from separate configs. This would allow me to swap out registries and add them back without macguyvering solutions like I do today.
Additional context
This is why I had originally created the following issues: #7803 and #7804
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:13 (6 by maintainers)
If I understand the use-case correctly, You want to be able to set multiple values in pip config for a key, or add to existing values.
With
set
, you can only provide one value, and that either creates a new value, or replaces the existing one, as seen below.So in your case, doing
pip config add global.trusted-host artifactory1.mycompany1.com
andpip config add global.trusted-host artifactory2.mycompany1.com
will give you.And with
unset
, we get rid of the all option presents.But in your case,
pip config remove global.trusted-host artifactory1.mycompany1.com
andpip config remove global.trusted-host artifactory2.mycompany1.com
will get rid of options one by one if present (perhaps if there is only one remaining, we should get rid of[global]
section itself)Re your bump: @aamailhot
As a person interested in funding open source (I am not
pip
maintainer). Since your company would “greatly benefit” I wonder how much your company would like to pay the maintainers for their voluntary work ?I am currently discussing in the open-source communities ways of funding the OSS efffort and I am interested in hearing what is possible.
Did you consider for example Github Sponsorship? Would that be an option for your company? How much of a regular sponsorship wouldl you see as worth the “great benefit” ?