Improve pip config --help text by wimglenn · Pull Request #11074 · pypa/pip (original) (raw)

The https://pip.pypa.io/en/stable/cli/pip_config/ page and corresponding pip config --help output is not very useful, I've lost count of the number of times I've seen this kind of error message:

$ pip config set index-url http://localhost:8080/
ERROR: Key does not contain dot separated section and key. Perhaps you wanted to use 'global.index-url' instead?

It's also pretty confusing that there is a --global option for the command and a global.option prefix for config keys with the word "global" here meaning quite different things, unless you've visit another section of the documentation which explains that the prefix is for per-command configuration.

Today I saw a user struggling to configure pip in a venv and reported:

Ah! I kept using site.extra-index-url thinking I was meant to replace global with site rather than adding it as an option.

This change hopefully makes the pip config --help clearer.