-
-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #735 from atugushev/help-default-index-url
Show default index url provided by pip
- Loading branch information
Showing
7 changed files
with
52 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import optparse | ||
|
||
from ._compat import Command, cmdoptions | ||
|
||
|
||
class PipCommand(Command): | ||
name = 'PipCommand' | ||
|
||
|
||
def get_pip_command(): | ||
# Use pip's parser for pip.conf management and defaults. | ||
# General options (find_links, index_url, extra_index_url, trusted_host, | ||
# and pre) are defered to pip. | ||
pip_command = PipCommand() | ||
pip_command.parser.add_option(cmdoptions.no_binary()) | ||
pip_command.parser.add_option(cmdoptions.only_binary()) | ||
index_opts = cmdoptions.make_option_group( | ||
cmdoptions.index_group, | ||
pip_command.parser, | ||
) | ||
pip_command.parser.insert_option_group(0, index_opts) | ||
pip_command.parser.add_option(optparse.Option('--pre', action='store_true', default=False)) | ||
|
||
return pip_command | ||
|
||
|
||
pip_command = get_pip_command() | ||
|
||
# Get default values of the pip's options (including options from pip.conf). | ||
pip_defaults = pip_command.parser.get_default_values() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters