Your IP : 216.73.217.17


Current Path : /usr/lib/python2.7/site-packages/pip/_internal/cli/
Upload File :
Current File : //usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyc

�
��Eac@@s*
dZddlmZddlZddlZddlZddlmZddlm	Z	ddl
mZmZm
Z
ddlmZddlmZdd	lmZdd
lmZddlmZmZddlmZdd
lmZddlmZddlmZddl m!Z!e!rsddl
m"Z"m#Z#ddl$m%Z%m&Z&m'Z'm(Z(m)Z)ddl*m+Z+nd�Z,d�Z-dd�Z/e0d�Z1d�Z2d�Z3defd��YZ4e	eddddd ddd!�Z5e	ed"dd#d d$d%e0dd&�Z6e	ed'd(dd)d d$d%e0de�Z7e	ed*d+dd,d d-d%ddd.�Z8e	ed/dd0d d$d%e0dd1�Z9e	ed2d3dd4d d$dd5�Z:e	ed6d7dd8d d-d%ddd9�Z;e	ed:dd;d<d=d>e<ej=��d%d?dd@dAj>ej=��dB�Z?e	e4dCdDdEddFdGdHd<dHddI�Z@e	edJddKd d$d%e0ddL�ZAe	edMddNd<dOd%dPddQ�ZBe	edRddSd<dTd%dUddV�ZCe	edWdXdGdYddZd<d[d%d\dd]�ZDd^�ZEe	e4d_dd`d<dHdGdHdda�ZFe	e4dbddcd<dHd%ddGdHddd�ZGe	ededfdgddhdGdid%ejHddj�ZIdk�ZJe	edlddmd d$d%e0ddn�ZKdo�ZLdp�ZMdq�ZNdr�ZOds�ZPdt�ZQe	e4dudvdwdxddyd<dHdGdzd%e�d d{d{eQdd|�ZRd}�ZSd~�ZTd�ZUd��ZVd��ZWe	ed�dd�dGd�d d�d%ddd��ZXd��ZYd��ZZe	ed�dd�dGd�d d{d{eZd<dOd%dded���Z[e	ed�dd�dGd�d%ddd��Z\e	ed�dd�dGd�d d�d%ddd��Z]d��Z^d��Z_d��Z`e	e4d�dd�d%edGdzd<dHdd��Zad��Zbe	ed�dd�d d{d{ebdd��Zce	ed�d�dd�d d$d%e0dd��Zde	e4d�d�d�d�dd�d<dHdGdzde�Zee	ed�dd�d d$dd��Zfe	ed�dd�d d�d%egdd��Zhd��Zie	ed�dd�d d$d%ddd��Zje	ed�dd�d d{d{eid%dde�Zke	ed�dd�d d�dGd�dd��Zle	ed�dd�d d�dGd�dd��Zme	ed�d d$d%e0dd��Zne	ed�d d$d%e0dd��Zoe	ed�dd�d d$d%e0dd��Zpd��Zqe	ed�dd�d d{d{eqd<d�dd��Zre	ed�dd�d d$d%e0dd��Zse	e4d�ddHd<dHd d�dd��Ztd��Zue	e4d�dd�d d�dGd�d<d�dd��Zve	ed�dd�d d$d%e0dd��Zwe	ed�dd�dGd�d d�d%gd>d�d�gdd��Zxe	ed�dd�dGd�d d�d%gd>d�gdd��Zyid�d�6e5e6e7e8e:e;e@eAeBeCeDeEeMeFeGeaecepe9ewexeygd�6Zzid�d�6eIeJeKeLgd�6Z{dS(�sC
shared options and groups

The principle here is to define options once, but *not* instantiate them
globally. One reason being that options with action='append' can carry state
between parses. pip parses general options twice internally, and shouldn't
pass on state. To be consistent, all options will follow this design.
i(tabsolute_importN(t	strtobool(tpartial(t
SUPPRESS_HELPtOptiontOptionGroup(tdedent(tcanonicalize_name(t	BAR_TYPES(tCommandError(tUSER_CACHE_DIRtget_src_prefix(t
FormatControl(tPyPI(tTargetPython(t
STRONG_HASHES(tMYPY_CHECK_RUNNING(tOptionParsertValues(tAnytCallabletDicttOptionaltTuple(tConfigOptionParsercC@sAdj||�}tjdj|j���}|j|�dS(s�
    Raise an option parsing error using parser.error().

    Args:
      parser: an OptionParser instance.
      option: an Option instance.
      msg: the error text.
    s{} error: {}t N(tformatttextwraptfilltjointsplitterror(tparsertoptiontmsg((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pytraise_option_error)s
cC@s<t||d�}x"|dD]}|j|��qW|S(s�
    Return an OptionGroup object
    group  -- assumed to be dict with 'name' and 'options' keys
    parser -- an optparse Parser
    tnametoptions(Rt
add_option(tgroupR toption_groupR!((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pytmake_option_group8sc@su�dkr|�n�fd�}dddg}tt||��rq|j}|j�tjddd�ndS(	s�Disable wheels if per-setup.py call options are set.

    :param options: The OptionParser options to update.
    :param check_options: The options to check, if not supplied defaults to
        options.
    c@st�|d�S(N(tgetattrtNone(tn(t
check_options(s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pytgetnamePst
build_optionstglobal_optionstinstall_optionssbDisabling all use of wheels due to the use of --build-option / --global-option / --install-option.t
stackleveliN(R+tanytmaptformat_controltdisallow_binariestwarningstwarn(R%R-R.tnamestcontrol((R-s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pytcheck_install_build_globalEs		
cC@s�t|j|j|j|jg�}tt�dh�}|j|koO|j}|rm|rmt	d��n|r�|r�|j
r�t	d��q�ndS(s�Function for determining if custom platform options are allowed.

    :param options: The OptionParser options.
    :param check_target: Whether or not to check if --target is being used.
    s:all:s�When restricting platform and interpreter constraints using --python-version, --platform, --abi, or --implementation, either --no-deps must be set, or --only-binary=:all: must be set and --no-binary must not be set (or must be set to :none:).sQCan not use any platform or abi specific options unless installing via '--target'N(R3tpython_versiont	platformstabistimplementationRtsetR5tignore_dependenciesR	t
target_dir(R%tcheck_targettdist_restriction_settbinary_onlytsdist_dependencies_allowed((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pytcheck_dist_restriction]s
cC@stjj|�S(N(tostpatht
expanduser(R!topttvalue((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyt_path_option_check�scC@s
t|�S(N(R(R!RKRL((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyt_package_name_option_check�st	PipOptioncB@s8eZejdZejj�Zeed<eed<RS(RItpackage_name(spathspackage_name(t__name__t
__module__RtTYPEStTYPE_CHECKERtcopyRNRM(((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyRO�s

s-hs--helptdestthelptactions
Show help.s
--isolatedt
isolated_modet
store_truetdefaultsSRun pip in an isolated mode, ignoring environment variables and user configuration.s--require-virtualenvs--require-venvtrequire_venvs-vs	--verbosetverbosetcountsDGive more output. Option is additive, and can be used up to 3 times.s
--no-colortno_colorsSuppress colored output.s-Vs	--versiontversionsShow version and exit.s-qs--quiettquiets�Give less output. Option is additive, and can be used up to 3 times (corresponding to WARNING, ERROR, and CRITICAL logging levels).s--progress-bartprogress_barttypetchoicetchoicestons*Specify type of progress to be displayed [t|s] (default: %default)s--logs
--log-files--local-logtlogtmetavarRIs Path to a verbose appending log.s
--no-inputtno_inputsDisable prompting for input.s--proxytproxytstrts<Specify a proxy in the form [user:passwd@]proxy.server:port.s	--retriestretriestintisRMaximum number of retries each connection should attempt (default %default times).s	--timeouts--default-timeouttsecttimeouttfloatis2Set the socket timeout (default %default seconds).cC@sCtddddddddd	d
dgdgd
ddd
dd�S(Ns--exists-actionRVt
exists_actionRcRdRetstitwtbtaR[RXtappendRiRWsYDefault action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.(R(((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyRsss--certtcertsPath to alternate CA bundle.s
--client-certtclient_certskPath to SSL client certificate, a single file containing the private key and the certificate in PEM format.s-is--index-urls
--pypi-urlt	index_urltURLs�Base URL of the Python Package Index (default %default). This should point to a repository compliant with PEP 503 (the simple repository API) or a local directory laid out in the same format.cC@s(tddddddddgd	d
�S(Ns--extra-index-urlRVtextra_index_urlsRiR}RXRyR[RWsmExtra URLs of package indexes to use in addition to --index-url. Should follow the same rules as --index-url.(R(((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pytextra_index_urlNss
--no-indextno_indexsAIgnore package index (only looking at --find-links URLs instead).c
C@s+tdddddddgdd	d
d�S(Ns-fs--find-linksRVt
find_linksRXRyR[RiturlRWsIf a URL or path to an html file, then parse for links to archives such as sdist (.tar.gz) or wheel (.whl) files. If a local path or file:// URL that's a directory,  then look for archives in the directory listing. Links to VCS project URLs are not supported.(R(((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyR�fs	cC@s(tddddddddgd	d
�S(Ns--trusted-hostRVt
trusted_hostsRXRyRitHOSTNAMER[RWs]Mark this host or host:port pair as trusted, even though it does not have valid or any HTTPS.(R(((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyttrusted_hostvsc
C@s+tdddddddgdd	d
d�S(Ns-cs--constraintRVtconstraintsRXRyR[RitfileRWs\Constrain versions using the given constraints file. This option can be used multiple times.(R(((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyR��s	c
C@s+tdddddddgdd	d
d�S(Ns-rs
--requirementRVtrequirementsRXRyR[RiR�RWsQInstall from the given requirements file. This option can be used multiple times.(R(((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyR��s	c
C@s+tdddddddgdd	d
d�S(Ns-es
--editableRVt	editablesRXRyR[Rispath/urlRWskInstall a project in editable mode (i.e. setuptools "develop mode") from a local project path or a VCS url.(R(((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyteditable�s	cC@s,tjj|�}t|j|j|�dS(N(RHRItabspathtsetattrtvaluesRV(R!topt_strRLR ((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyt_handle_src�ss--srcs--sources--source-dirs--source-directorytsrc_dirtdirtcallbacks�Directory to check out editable projects into. The default in a virtualenv is "<venv path>/src". The default for global installs is "<current dir>/src".cC@st||j�S(sGet a format_control object.(R*RV(R�R!((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyt_get_format_control�scC@s/t|j|�}tj||j|j�dS(N(R�R�Rthandle_mutual_excludest	no_binarytonly_binary(R!R�RLR texisting((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyt_handle_no_binary�scC@s/t|j|�}tj||j|j�dS(N(R�R�RR�R�R�(R!R�RLR R�((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyt_handle_only_binary�scC@sCtt�t��}tddddddtddd|d	d
�S(Ns--no-binaryRVR5RXR�RcRlR[RWsvDo not use binary packages. Can be supplied multiple times, and each time adds to the existing value. Accepts either ":all:" to disable all binary packages, ":none:" to empty the set (notice the colons), or one or more package names with commas between them (no colons). Note that some packages are tricky to compile and may fail to install when this option is used on them.(RR@RR�(R5((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyR��scC@sCtt�t��}tddddddtddd|d	d
�S(Ns
--only-binaryRVR5RXR�RcRlR[RWsKDo not use source packages. Can be supplied multiple times, and each time adds to the existing value. Accepts either ":all:" to disable all source packages, ":none:" to empty the set, or one or more package names with commas between them. Packages without binary distributions will fail to install when this option is used on them.(RR@RR�(R5((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyR��ss
--platformR=tplatformRys�Only use wheels compatible with <platform>. Defaults to the platform of the running system. Use this option multiple times to specify multiple platforms supported by the target interpreter.cC@s�|s
d	S|jd�}t|�dkr/dSt|�dkrw|d}t|�dkrw|d|dg}qwnytd�|D��}Wntk
r�d
SX|dfS(s�
    Convert a version string like "3", "37", or "3.7.3" into a tuple of ints.

    :return: A 2-tuple (version_info, error_msg), where `error_msg` is
        non-None if and only if there was a parsing error.
    t.is'at most three version parts are allowediics@s|]}t|�VqdS(N(Ro(t.0tpart((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pys	<genexpr>ss$each version part must be an integerN(NN(((s'at most three version parts are allowed(((s$each version part must be an integer(R+Rtlenttuplet
ValueError(RLtpartstversion_info((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyt_convert_python_versions

cC@sYt|�\}}|dk	rIdj||�}t|d|d|�n||j_dS(s3
    Handle a provided --python-version value.
    s(invalid --python-version value: {!r}: {}R!R"N(R�R+RR#R�R<(R!R�RLR R�t	error_msgR"((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyt_handle_python_version!ss--python-versionR<s�    The Python interpreter version to use for wheel and "Requires-Python"
    compatibility checks. Defaults to a version derived from the running
    interpreter. The version can be specified using up to three dot-separated
    integers (e.g. "3" for 3.0.0, "3.7" for 3.7.0, or "3.7.3"). A major-minor
    version can also be given as a string without dots (e.g. "37" for 3.7.0).
    s--implementationR?s�Only use wheels compatible with Python implementation <implementation>, e.g. 'pp', 'jy', 'cp',  or 'ip'. If not specified, then the current interpreter implementation is used.  Use 'py' to force implementation-agnostic wheels.s--abiR>tabisLOnly use wheels compatible with Python abi <abi>, e.g. 'pypy_41'. If not specified, then the current interpreter abi tag is used. Use this option multiple times to specify multiple abis supported by the target interpreter. Generally you will need to specify --implementation, --platform, and --python-version when using this option.cC@sD|jt��|jt��|jt��|jt��dS(N(R&R=R<R?R>(tcmd_opts((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pytadd_target_python_optionsbsc	C@s1td|jd|jd|jd|j�}|S(NR=tpy_version_infoR>R?(RR=R<R>R?(R%t
target_python((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pytmake_target_pythonjs			c
C@s"tddddddtdd�S(	Ns--prefer-binaryRVt
prefer_binaryRXRZR[RWs8Prefer older binary packages over newer source packages.(RtFalse(((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyR�vss--cache-dirt	cache_dirsStore the cache data in <dir>.cC@s_|dk	rOyt|�WqOtk
rK}t|d|dt|��qOXnt|j_dS(s�
    Process a value provided for the --no-cache-dir option.

    This is an optparse.Option callback for the --no-cache-dir option.
    R!R"N(R+RR�R#RlR�R�R�(R!RKRLR texc((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyt_handle_no_cache_dir�s#	s--no-cache-dirsDisable the cache.s	--no-depss--no-dependenciesRAs#Don't install package dependencies.s-bs--builds--build-dirs--build-directoryt	build_dirs--ignore-requires-pythontignore_requires_pythons'Ignore the Requires-Python information.s--no-build-isolationtbuild_isolationtstore_falses�Disable isolation when building a modern source distribution. Build dependencies specified by PEP 518 must be already installed if this option is used.cC@s;|dk	r+d}t|d|d|�nt|j_dS(s�
    Process a value provided for the --no-use-pep517 option.

    This is an optparse.Option callback for the no_use_pep517 option.
    s0A value was passed for --no-use-pep517,
        probably using either the PIP_NO_USE_PEP517 environment variable
        or the "no-use-pep517" config file option. Use an appropriate value
        of the PIP_USE_PEP517 environment variable or the "use-pep517"
        config file option instead.
        R!R"N(R+R#R�R�t
use_pep517(R!RKRLR R"((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyt_handle_no_use_pep517�ss--use-pep517R�s^Use PEP 517 for building source distributions (use --no-use-pep517 to force legacy behaviour).s--no-use-pep517s--install-optionR1R%s"Extra arguments to be supplied to the setup.py install command (use like --install-option="--install-scripts=/usr/local/bin"). Use multiple --install-option options to pass multiple options to setup.py install. If you are using an option with a directory path, be sure to use absolute path.s--global-optionR0sTExtra global options to be supplied to the setup.py call before the install command.s
--no-cleans!Don't clean up build directories.s--presYInclude pre-release and development versions. By default, pip only finds stable versions.s--disable-pip-version-checktdisable_pip_version_checks{Don't periodically check PyPI to determine whether a new version of pip is available for download. Implied with --no-index.cC@s�|jjsi|j_ny|jdd�\}}Wn'tk
r`|jdj|��nX|tkr�|jdj|djt���n|jjj|g�j	|�dS(skGiven a value spelled "algo:digest", append the digest to a list
    pointed to in a dict by the algo name.t:isTArguments to {} must be a hash name followed by a value, like --hash=sha256:abcde...s&Allowed hash algorithms for {} are {}.s, N(
R�thashesRR�RRRRt
setdefaultRy(R!R�RLR talgotdigest((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyt_handle_merge_hash6s
s--hashR�tstringsgVerify that the package's archive matches this hash before installing. Example: --hash=sha256:abcdef...s--require-hashestrequire_hashess�Require a hash to check each requirement against, for repeatable installs. This option is implied when any package in a requirements file has a --hash option.s--paths^Restrict to the specified installation path for listing packages (can be used multiple times).cC@s.|jr*|js|jr*td��ndS(Ns2Cannot combine '--path' with '--user' or '--local'(RItusertlocalR	(R%((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pytcheck_list_path_optionmss	--excludetexcludestpackageRPs)Exclude specified package from the outputs--no-python-version-warningtno_python_version_warnings>Silence deprecation warnings for upcoming unsupported Pythons.s
--use-featuretfeatures_enabledtfeatures
2020-resolvers	fast-depss<Enable new functionality, that may be backward incompatible.s--use-deprecatedtdeprecated_features_enabledslegacy-resolversDEnable deprecated functionality, that will be removed in the future.sGeneral OptionsR$sPackage Index Options(|t__doc__t
__future__RRHRR7tdistutils.utilRt	functoolsRtoptparseRRRRtpip._vendor.packaging.utilsRtpip._internal.cli.progress_barsRtpip._internal.exceptionsR	tpip._internal.locationsR
Rt#pip._internal.models.format_controlRtpip._internal.models.indexR
t"pip._internal.models.target_pythonRtpip._internal.utils.hashesRtpip._internal.utils.typingRRRttypingRRRRRtpip._internal.cli.parserRR#R)R+R;R�RGRMRNROthelp_RYtrequire_virtualenvR]R_R`RatlisttkeysRRbRhRjRkRnRqRsRzR{t
simple_urlR|RR�R�R�R�R�R�R�tsrcR�R�R�R�R�R=R�R�R<R?R>R�R�R�R�R�tno_cachetno_depsR�R�tTruetno_build_isolationR�R�t
no_use_pep517R1R0tno_cleantpreR�R�thashR�t	list_pathR�tlist_excludeR�tuse_new_featuretuse_deprecated_featuret
general_grouptindex_group(((s@/usr/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.pyt<module>s(		
(