Skip to content
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

Create a command to make it easy to access the configuration file #1736

Closed
dstufft opened this issue Apr 20, 2014 · 13 comments
Closed

Create a command to make it easy to access the configuration file #1736

dstufft opened this issue Apr 20, 2014 · 13 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@dstufft
Copy link
Member

dstufft commented Apr 20, 2014

@glyph said in #1733

$ emacs `pip conf`
$ pip conf edit # runs $EDITOR
$ pip conf set foo=bar

I like this idea and I think we should add it.

@dstufft dstufft added this to the Improve our User Experience milestone Apr 20, 2014
@glyph
Copy link

glyph commented Apr 20, 2014

All 3? :)

@dstufft
Copy link
Member Author

dstufft commented Apr 20, 2014

Dunno! I just didn't want to forget it :] Perhaps all 3, perhaps only one of them.

@pfmoore pfmoore closed this as completed Apr 20, 2014
@pfmoore
Copy link
Member

pfmoore commented Apr 20, 2014

Sorry, misclick

@pfmoore pfmoore reopened this Apr 20, 2014
@pradyunsg
Copy link
Member

pradyunsg commented Jun 23, 2016

(edited twice; the actual command is a little different from this)

Here's a proposal:

$ pip config --help

Usage:
    pip config --list
    pip config --edit

    pip config --set name value
    pip config --unset name

Config Options:
  -l, --list        List all values set in the configuration
  -e, --edit        Open the configuration file in $EDITOR
  -s, --show name   Show the value set for name in the configuration
  --set name value  Set name=value in the configuration
  --unset name      Unset name in the configuration
  --global          Make changes in the global configuration file instead of 
                    the user level configuration file

It provides all three behaviours from OP in a manner that is consistent with our current commands. It also provides, what I think is, all of the required operations for the user in a sensible easy-to-understand manner.

@pradyunsg
Copy link
Member

If the proposal looks fine, I'll go ahead and make a PR for this...

@pfmoore
Copy link
Member

pfmoore commented Jun 23, 2016

Windows perspective - $EDITOR is typically not used. We should default not notepad on Windows, and allow easy configuration of a better alternative (in pip.ini).

We could leverage the standard option support and allow pip config --edit --editor gvim.exe (then people cal set PIP_EDITOR or set a value in [config]editor. But that may be overkill.

@pradyunsg
Copy link
Member

Windows perspective - $EDITOR is typically not used.

True. For Windows, just open it in whatever is their default text editor should suffice. I don't mind the some option based support for changing the editor.

@pradyunsg
Copy link
Member

Offshoot idea: #3809.

@pfmoore
Copy link
Member

pfmoore commented Jun 23, 2016

For Windows, just open it in whatever is their default text editor should suffice.

But that's the point - there is no concept of a "default text editor". If you mean the editor associated with ".txt" files, that's not always appropriate (as well as being way too hard to determine correctly). So we need an option in pip, to control the editor *pip uses (independent of system-level choices).

Ideally, Python would have an "open a file in the default text editor" function, much like it has an "open a webpage in a browser" function in the webbrowser module. But sadly, it doesn't.

@pradyunsg
Copy link
Member

pradyunsg commented Jun 23, 2016

Ooh. Okay. In that case, it seems to me that providing an --editor option should suffice. It's not an overkill IMO.

@pradyunsg
Copy link
Member

Update: #4192 refactors out the code for configuration. I'll follow up with the config command if that's accepted.

@pradyunsg
Copy link
Member

I'm working on this.

@pradyunsg
Copy link
Member

This can be closed. #4240 has merged. ^.^

@dstufft dstufft closed this as completed Jun 13, 2017
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

4 participants