3

Q'ícY@ã@sndZddlmZddlmZddlmZmZmZddl	Z	ddl
mZmZm
Z
mZddlmZddlmZmZdd	lmZd
d„Zdd
„ZdÄdd„ZeeddddddZeeddddddZeedddddedZeeddd d!dd"dZeed#d$d%dd&dZeed'd(d)d!dd*dZeed+d,d-d.d/d0d1Zeed2d3ddedZ eed4d5d6d7d8d9Z!eed:d;d<d=d>d9Z"eed?d@dAdBdCdDdEdFZ#eedGdHd6d7ed9Z$eedIdJd6d7ed9Z%dKdL„Z&eedMdNd6d/dOdPZ'eedQdRd6dd/dSdTZ(eedUdVdWdXdYej)dZd[Z*d\d]„Z+eed^d_ddd`dZ,dadb„Z-dcdd„Z.eededfddedZ/dgdh„Z0eedidfdjdedZ1dkdl„Z2eedmdndjdedZ3eedodpdddqdZ4drds„Z5dtdu„Z6dvdw„Z7eedxdydzd{d|d}ed~d[	Z8eedd€ddedZ9eed‚d€djddƒdZ:d„d…„Z;d†d‡„Z<dˆd‰„Z=dŠd‹„Z>dŒd„Z?eedŽded}dd‘Z@eed’ddjd“dZAeed”d•d–ddd—dZBeed˜d™dšd›dœd}dd1ZCeedždŸdd dZDeed¡d¢d£d¤d¥d¦ZEeed§d¨d£d¤d©d¦ZFeedªddd«d¬ZGeed­ddd®d¬ZHeed¯d°ddd±dZIeed²d³d´dedZJdµd¶„ZKeed·d¸d¹eKdºd»d¼ZLeed½d¾ddd¿dZMdÀeeeeeeee e!e"e#e$e%e&e0e'e(e@eAeIgdÁœZNdÂe*e+e,e-e4gdÁœZOdÃeOd¤e.e/e1e2e3gdÁœZPdS)ÅaD
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.

é)Úabsolute_import)Úpartial)ÚOptionGroupÚ
SUPPRESS_HELPÚOptionN)Ú
FormatControlÚfmt_ctl_handle_mutual_excludeÚfmt_ctl_no_binaryÚfmt_ctl_no_use_wheel)ÚPyPI)ÚUSER_CACHE_DIRÚ
src_prefix)Ú
STRONG_HASHEScCs0t||dƒ}x|dD]}|j|ƒƒqW|S)z‡
    Return an OptionGroup object
    group  -- assumed to be dict with 'name' and 'options' keys
    parser -- an optparse Parser
    ÚnameÚoptions)rÚ
add_option)ÚgroupÚparserÚoption_groupÚoption©rú-/tmp/pip-build-l_bcah40/pip/pip/cmdoptions.pyÚmake_option_groupsrcCs|js|j}t|ƒdS)N)Ú	use_wheelÚformat_controlr
)rÚcontrolrrrÚresolve_wheel_no_use_binary$srcsPˆdkr|‰‡fdd„}dddg}tt||ƒƒrL|j}t|ƒtjddd	dS)
zÏ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.
    Ncstˆ|dƒS)N)Úgetattr)Ún)Ú
check_optionsrrÚgetname4sz+check_install_build_global.<locals>.getnameÚ
build_optionsÚglobal_optionsÚinstall_optionszeDisabling all use of wheels due to the use of --build-options / --global-options / --install-options.é)Ú
stacklevel)ÚanyÚmaprr	ÚwarningsÚwarn)rrr Únamesrr)rrÚcheck_install_build_global*s
r+z-hz--helpÚhelpz
Show help.)ÚdestÚactionr,z
--isolatedÚ
isolated_modeÚ
store_trueFzSRun pip in an isolated mode, ignoring environment variables and user configuration.)r-r.Údefaultr,z--require-virtualenvz--require-venvÚrequire_venvz-vz	--verboseÚverboseÚcountzDGive more output. Option is additive, and can be used up to 3 times.z-Vz	--versionÚversionzShow version and exit.z-qz--quietÚquietzƒGive less output. Option is additive, and can be used up to 3 times (corresponding to WARNING, ERROR, and CRITICAL logging levels).z--logz
--log-filez--local-logÚlogÚpathz Path to a verbose appending log.)r-Úmetavarr,z
--no-inputÚno_inputz--proxyÚproxyÚstrÚz<Specify a proxy in the form [user:passwd@]proxy.server:port.)r-Útyper1r,z	--retriesÚretriesÚintézRMaximum number of retries each connection should attempt (default %default times).z	--timeoutz--default-timeoutÚsecÚtimeoutÚfloatéz2Set the socket timeout (default %default seconds).)r9r-r>r1r,z
--default-vcsÚdefault_vcsz--skip-requirements-regexÚskip_requirements_regexc
Cs"tddddddddggd	d
ddS)
Nz--exists-actionÚ
exists_actionÚchoiceÚsÚiÚwÚbÚaÚappendr.zYDefault action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.)r-r>Úchoicesr1r.r9r,)rrrrrrH¸srHz--certÚcertzPath to alternate CA bundle.)r-r>r9r,z
--client-certÚclient_certzkPath to SSL client certificate, a single file containing the private key and the certificate in PEM format.)r-r>r1r9r,z-iz--index-urlz
--pypi-urlÚ	index_urlÚURLz»Base URL of 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.)r-r9r1r,cCstddddgddS)Nz--extra-index-urlÚextra_index_urlsrTrOzmExtra URLs of package indexes to use in addition to --index-url. Should follow the same rules as --index-url.)r-r9r.r1r,)rrrrrÚextra_index_urläsrVz
--no-indexÚno_indexzAIgnore package index (only looking at --find-links URLs instead).c	CstddddgdddS)Nz-fz--find-linksÚ
find_linksrOÚurlz§If a url or path to an html file, then parse for links to archives. If a local path or file:// url that's a directory, then look for archives in the directory listing.)r-r.r1r9r,)rrrrrrXúsrXcCstdddgdtdS)Nz--allow-externalÚallow_externalrOÚPACKAGE)r-r.r1r9r,)rrrrrrrZsrZz--allow-all-externalÚallow_all_externalcCstddddgddS)Nz--trusted-hostÚ
trusted_hostsrOÚHOSTNAMEzKMark this host as trusted, even though it does not have valid or any HTTPS.)r-r.r9r1r,)rrrrrÚtrusted_hostsr_z--no-allow-externalÚstore_falsec	CstddddgdtdS)Nz--allow-unverifiedz--allow-insecureÚallow_unverifiedrOr[)r-r.r1r9r,)rrrrrrÚallow_unsafe3srbz--no-allow-insecureÚallow_all_insecurez--process-dependency-linksÚprocess_dependency_linksz*Enable the processing of dependency links.c	CstddddgdddS)Nz-cz--constraintÚconstraintsrOÚfilez\Constrain versions using the given constraints file. This option can be used multiple times.)r-r.r1r9r,)rrrrrreRsrec	CstddddgdddS)Nz-rz
--requirementÚrequirementsrOrfzQInstall from the given requirements file. This option can be used multiple times.)r-r.r1r9r,)rrrrrrg]srgc	CstddddgdddS)Nz-ez
--editableÚ	editablesrOzpath/urlzkInstall a project in editable mode (i.e. setuptools "develop mode") from a local project path or a VCS url.)r-r.r1r9r,)rrrrrÚeditablehsriz--srcz--sourcez--source-dirz--source-directoryÚsrc_dirÚdirz˜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".z--use-wheelrTz--no-use-wheelz{Do not Find and prefer wheel archives when searching indexes and find-links locations. DEPRECATED in favour of --no-binary.cCst||jƒS)zGet a format_control object.)rr-)ÚvaluesrrrrÚ_get_format_control”srmcCs"t|j|jƒ}t||j|jƒdS)N)rrlr-rÚ	no_binaryÚonly_binary)rÚopt_strÚvaluerÚexistingrrrÚ_handle_no_binary™srscCs"t|j|jƒ}t||j|jƒdS)N)rrlr-rrorn)rrprqrrrrrrÚ_handle_only_binaryŸsrtc	Cs tdddtdttƒtƒƒddS)Nz--no-binaryrÚcallbackr<aRDo 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, or one or more package names with commas between them. Note that some packages are tricky to compile and may fail to install when this option is used on them.)r-r.rur>r1r,)rrsrÚsetrrrrrn¥s
rnc	Cs tdddtdttƒtƒƒddS)Nz
--only-binaryrrur<aGDo 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.rur>r1r,)rrtrrvrrrrro²s
roz--cache-dirÚ	cache_dirzStore the cache data in <dir>.)r-r1r9r,z--no-cache-dirzDisable the cache.z	--no-depsz--no-dependenciesÚignore_dependenciesz#Don't install package dependencies.z-bz--buildz--build-dirz--build-directoryÚ	build_dirz/Directory to unpack packages into and build in.z--ignore-requires-pythonÚignore_requires_pythonz'Ignore the Requires-Python information.z--install-optionr#rOra"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.)r-r.r9r,z--global-optionr"zTExtra global options to be supplied to the setup.py call before the install command.z
--no-cleanz!Don't clean up build directories.)r.r1r,z--prezYInclude pre-release and development versions. By default, pip only finds stable versions.z--disable-pip-version-checkÚdisable_pip_version_checkz{Don't periodically check PyPI to determine whether a new version of pip is available for download. Implied with --no-index.z-Zz--always-unzipÚalways_unzipc
Cs‚|jjsi|j_y|jddƒ\}}Wn"tk
rF|jd|ƒYnX|tkrh|jd|djtƒfƒ|jjj|gƒj|ƒdS)zkGiven a value spelled "algo:digest", append the digest to a list
    pointed to in a dict by the algo name.ú:ézTArguments to %s must be a hash name followed by a value, like --hash=sha256:abcde...z&Allowed hash algorithms for %s are %s.z, N)	rlÚhashesÚsplitÚ
ValueErrorÚerrorrÚjoinÚ
setdefaultrO)rrprqrÚalgoÚdigestrrrÚ_merge_hashsr‡z--hashrruÚstringzgVerify that the package's archive matches this hash before installing. Example: --hash=sha256:abcdef...)r-r.rur>r,z--require-hashesÚrequire_hasheszž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.zGeneral Options)rrzPackage Index Optionsz4Package Index Options (including deprecated options))N)QÚ__doc__Ú
__future__rÚ	functoolsrÚoptparserrrr(Ú	pip.indexrrr	r
Ú
pip.modelsrÚ
pip.locationsrr
Úpip.utils.hashesrrrr+Úhelp_r/Úrequire_virtualenvr3r5r6r7r:r;r?rCrFrGrHrQrRÚ
simple_urlrSrVrWrXrZr\r_Úno_allow_externalrbÚno_allow_unsaferdrergriÚsrcrÚno_use_wheelrmrsrtrnrorwÚno_cacheÚno_depsryrzr#r"Úno_cleanÚprer{r|r‡Úhashr‰Ú
general_groupÚnon_deprecated_index_groupÚindex_grouprrrrÚ<module>	sr