* add site_config_dirs() to appdirs to determine locations across OSes
* add system_config_files to locations.py
* add system_config_files to get_config_files() and re-order files entries to correct precedence
* document changes to configuration files in user guide
Closes#309
Using sys.exc_info()[1] is a hack that was used to use a shared
source approach to Python 3.x support that also included versions
of Python that didn't include the except ... as exc: construction.
Pip no longer supports any of these versions of Python so we can
remove it.
2) have `create_main_parser` mark the parser as the 'main' parser.
3) remove an extraneus block that's never called. thanks @netspyer.
4) move 'create_main_parser` to __init__ to avoid circular or embedded imports.
Previously, we used `convert_value' in all cases, which seems
to try to detect lists based on the value of nargs, but that fails
with lists of one item. This "worked" for 'str' options, because
the values don't get checked, but was failing for choice types
(see Issue #772), and would fail for other types like int.
Add a new base parser class 'CustomOptionParser' that provides the
'insert_option_group(idx, *, **)' method for inserting an option group
at a specific position.
* Prevents excessive wrapping (respects $COLUMNS if set)
* More control over the look of pip's option handling
* '-d DIR, --download=DIR' becomes '-d, --download <DIR>'
Config keys should be normalized (i.e., have underscores replaced with
dashes) *before* the config dictionaries are merged.
Otherwise, if you set a value in a config file and via an environment
variable both the dash separated key (from the config file) and the
underscore separated key (from the environment variable) end up in the
config dictionary. Usually this doesn't matter because the latter key
comes after the former when the dictionary is iterated over. But in
cases where the two config keys hash to the same value module the size
of the dictionary, the order is reversed and the wrong value takes
precedance.
For instance with 'index-url' there's no problem:
>>> repr({'index-url': 1, 'index_url': 2})
"{'index-url': 1, 'index_url': 2}"
But with 'no-index', the value from the config file overwrites the
value from the environment variable:
>>> repr({'no-index': 1, 'no_index': 2})
"{'no_index': 2, 'no-index': 1}"