YZ@@sdZddlmZddlmZddlmZmZmZddl Z ddl m Z m Z m Z mZddlmZddlmZmZdd lmZd d Zd d ZdddZeeddddddddZeedddddddddZeedddddddddeZeedd dd!dd"dddd#Zeed$d%dd&dddd'Zeed(d)dd*dd"dddd+Zeed,d-d.dd/d0d1dd2Zeed3dd4dddddeZ eed5dd6d7d8dd9dd:Z!eed;dd<d7d=dd>dd?Z"eed@dAd0dBddCd7dDddEddFZ#eedGddHd7d8dd9deZ$eedIddJd7d8dd9deZ%dKdLZ&eedMddNd7d8d0d1ddOZ'eedPddQd7d8ddd0d1ddRZ(eedSdTdUddVd0dWdej)ddXZ*dYdZZ+eed[dd\dddddd]Z,d^d_Z-d`daZ.eedbddcdddddeZ/dddeZ0eedfddcddgdddeZ1dhdiZ2eedjddkddgdddeZ3eedlddmddddddnZ4dodpZ5dqdrZ6dsdtZ7eedudvdwdxddyd0dzdedd{Z8eed|dd}dddd~deZ9eeddd}ddgdd~ddZ:ddZ;ddZ<ddZ=ddZ>ddZ?eedddded0dzddZ@eedddddgddZAeeddddddddddZBeeddddddd0dzddZCeedddddddZDeedddddd0dddZEeedddddd0dddZFeedddddddZGeedddddddZHeedddddddddZIeedddddddeZJddZKeeddddddeKd7dddZLeedddddddddZMdddeeeeeeee e!e"e#e$e%e&e0e'e(e@eAeIgiZNddde*e+e,e-e4giZOdddeOde.e/e1e2e3giZPdS)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_HELPOptionN) FormatControlfmt_ctl_handle_mutual_excludefmt_ctl_no_binaryfmt_ctl_no_use_wheel)PyPI)USER_CACHE_DIR src_prefix) STRONG_HASHEScCs<t||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 nameoptions)r add_option)groupparser option_groupoptionr-/tmp/pip-build-3puug3g5/pip/pip/cmdoptions.pymake_option_groupsrcCs |js|j}t|dS)N) use_wheelformat_controlr )rcontrolrrrresolve_wheel_no_use_binary$s  rcsrdkr|fdd}dddg}tt||rn|j}t|tjddd dS) zDisable 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. Ncst|dS)N)getattr)n) check_optionsrrgetname4sz+check_install_build_global..getname build_optionsglobal_optionsinstall_optionszeDisabling all use of wheels due to the use of --build-options / --global-options / --install-options. stacklevel)anymaprr warningswarn)rrr namesrr)rrcheck_install_build_global*s   r+z-hz--helpdesthelpactionz Show help.z --isolated isolated_mode store_truedefaultFzSRun pip in an isolated mode, ignoring environment variables and user configuration.z--require-virtualenvz--require-venv require_venvz-vz --verboseverbosecountzDGive more output. Option is additive, and can be used up to 3 times.z-Vz --versionversionzShow version and exit.z-qz--quietquietzGive 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-loglogmetavarpathz Path to a verbose appending log.z --no-inputno_inputz--proxyproxytypestrz/src". The default for global installs is "/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.cCst||jS)zGet a format_control object.)rr,)valuesrrrr_get_format_controlsrmcCs/t|j|j}t||j|jdS)N)rrlr,r no_binary only_binary)ropt_strvaluerexistingrrr_handle_no_binarysrscCs/t|j|j}t||j|jdS)N)rrlr,rrorn)rrprqrrrrrr_handle_only_binarysrtcCs=tddddddtdddtttd d S) Nz --no-binaryr,rr.callbackr<r=r1r-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.)rrsrsetrrrrrns  rncCs=tddddddtdddtttd d S) Nz --only-binaryr,rr.rur<r=r1r-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.)rrtrrvrrrrros  roz --cache-dir cache_dirzStore the cache data in .z--no-cache-dirzDisable the cache.z --no-depsz--no-dependenciesignore_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-pythonignore_requires_pythonz'Ignore the Requires-Python information.z--install-optionr#rPra"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.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.z--prezYInclude pre-release and development versions. By default, pip only finds stable versions.z--disable-pip-version-checkdisable_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 rY|jd|YnX|tkr|jd|djtf|jjj|gj|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) rlhashessplit ValueErrorerrorrjoin setdefaultrP)rrprqralgodigestrrr _merge_hashs       rz--hashrrustringzgVerify that the package's archive matches this hash before installing. Example: --hash=sha256:abcdef...z--require-hashesrequire_hasheszRequire 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.rzGeneral OptionszPackage Index Optionsz4Package Index Options (including deprecated options))Q__doc__ __future__r functoolsroptparserrrr( pip.indexrrr r pip.modelsr pip.locationsr r pip.utils.hashesrrrr+help_r/require_virtualenvr3r5r6r7r:r;r?rCrFrGrHrQrR simple_urlrSrVrWrXrZr\r_no_allow_externalrbno_allow_unsaferdrergrisrcr no_use_wheelrmrsrtrnrorwno_cacheno_depsryrzr#r"no_cleanprer{r|rhashr general_groupnon_deprecated_index_group index_grouprrrr sv "