-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip config
should support add
and remove
commands
#8259
Comments
pip config
should have an add
commendpip config
should have an add
commend
pip config
should have an add
commendpip config
should support add
and remove
commands
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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
So in your case, doing
And with
But in your case, |
An empty section won't affect what the parsed contents are, so that's more "polish" than "correctness". :) |
@deveshks you summarized my thoughts to the point! A command like that would be super useful in a corporate world. @pradyunsg knows where I am coming from :D |
No worries, happy to help
I am not sure how useful will this option be for the general public. If the pip maintainers are okay with including such a feature, me or you can take a stab at this. |
@deveshks I'll give this a go. I would like to expand about this. Regarding the order of the inputs, I would like to preserve the order users put these in. This will definitely help a lot of organizations behind proxies. They don't know that it is possible to add multiple sources, but this will help them understand, I can also go ahead and edit the docs once I am done. I'll raise a PR soon. @pradyunsg I'll name the commands I will go ahead and send you a PR, we can discuss the nomenclature there, if that is alright. I know pip has an edit command, but that does not solve everything, especially where automation is concerned. |
BUMP. My company would also greatly benefit from this feature. |
Re your bump: @aamailhot As a person interested in funding open source (I am not 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" ? |
My mistake, i misunderstood how pip is maintianed. Thanks for the information i will take this back to my company and weigh our options. |
Life came in the way and I forgot about this issue. I've since left the company where I could have used this. However, I still think this is a feature that could be useful for pip to support. @pradyunsg do you think I should take a crack at this? Or do you think someone else would benefit from doing this, since this feels like a good first issue? |
Please do go ahead and have a crack! We have more easy issues people can choose from instead. One thing to note though is there’s recent effort to allow configs in TOML (#3809 (comment)) and these may need to be coordinated. cc @Shivansh-007 |
I stumbled upon this issue from google so hopefully this will be helpful for someone else. I'm not sure if this works in all situations but I was able to replicate an pip config set global.extra-index-url "$(pip config get global.extra-index-url) https://new-url.com/pip" |
What'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:
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
The text was updated successfully, but these errors were encountered: