3 PfZ@@sndZddlmZddlmZddlmZmZmZddl Z ddl m Z m Z m Z mZddlmZddlmZmZdd lmZd d Zd d ZdddZeeddddddZeeddddddZeedddddedZeeddd d!dd"dZeed#d$d%dd&dZeed'd(d)d!dd*dZeed+d,d-d.d/d0d1Zeed2d3ddedZ eed4d5d6d7d8d9Z!eed:d;dd9Z"eed?d@dAdBdCdDdEdFZ#eedGdHd6d7ed9Z$eedIdJd6d7ed9Z%dKdLZ&eedMdNd6d/dOdPZ'eedQdRd6dd/dSdTZ(eedUdVdWdXdYej)dZd[Z*d\d]Z+eed^d_ddd`dZ,dadbZ-dcddZ.eededfddedZ/dgdhZ0eedidfdjdedZ1dkdlZ2eedmdndjdedZ3eedodpdddqdZ4drdsZ5dtduZ6dvdwZ7eedxdydzd{d|d}ed~d[ Z8eeddddedZ9eedddjdddZ:ddZ;ddZddZ?eedded}ddZ@eedddjddZAeedddddddZBeedddddd}dd1ZCeedddddZDeeddddddZEeeddddddZFeedddddZGeedddddZHeeddddddZIeeddddedZJddZKeedddeKdddZLeeddddddZMdeeeeeeee e!e"e#e$e%e&e0e'e(e@eAeIgdZNde*e+e,e-e4gdZOdeOde.e/e1e2e3gdZPdS)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_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 nameoptions)rZ add_option)groupparserZ option_groupoptionr /usr/lib/python3.6/cmdoptions.pymake_option_groupsrcCs|js|j}t|dS)N) use_wheelformat_controlr )rcontrolrrrresolve_wheel_no_use_binary$srcsPdkr |fdd}dddg}tt||rL|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. Ncs t|dS)N)getattr)n) check_optionsrrgetname4sz+check_install_build_global..getnameZ build_optionsglobal_optionsinstall_optionszeDisabling all use of wheels due to the use of --build-options / --global-options / --install-options.) stacklevel)anymaprr warningswarn)rrrnamesrr)rrcheck_install_build_global*s  r(z-hz--helphelpz Show help.)destactionr)z --isolated isolated_mode store_trueFzSRun pip in an isolated mode, ignoring environment variables and user configuration.)r*r+defaultr)z--require-virtualenvz--require-venvZ 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-loglogpathz Path to a verbose appending log.)r*metavarr)z --no-inputno_inputz--proxyproxystrz/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.cCs t||jS)zGet a format_control object.)rr*)valuesrrrr_get_format_controlsr^cCs"t|j|j}t||j|jdS)N)rr]r*r no_binary only_binary)ropt_strvaluerexistingrrr_handle_no_binarysrdcCs"t|j|j}t||j|jdS)N)rr]r*rr`r_)rrarbrrcrrr_handle_only_binarysrec Cs tdddtdtttddS)Nz --no-binaryrcallbackr8aRDo 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+rfr:r.r))rrdrsetrrrrr_s  r_c Cs tdddtdtttddS)Nz --only-binaryrrfr8aGDo 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+rfr:r.r))rrerrgrrrrr`s  r`z --cache-dir cache_dirzStore the cache data in .)r*r.r5r)z--no-cache-dirzDisable the cache.z --no-depsz--no-dependenciesZignore_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 rIra"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+r5r)z--global-optionrzTExtra global options to be supplied to the setup.py call before the install command.z --no-cleanz!Don't clean up build directories.)r+r.r)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 rF|jd|YnX|tkrh|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) r]hashessplit ValueErrorerrorrjoin setdefaultrI)rrarbrZalgoZdigestrrr _merge_hashsruz--hashrorfstringzgVerify that the package's archive matches this hash before installing. Example: --hash=sha256:abcdef...)r*r+rfr:r)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.zGeneral Options)rrzPackage Index Optionsz4Package Index Options (including deprecated options))N)Q__doc__Z __future__r functoolsrZoptparserrrr%Z pip.indexrrr r Z pip.modelsr Z pip.locationsr r Zpip.utils.hashesrrrr(Zhelp_r,Zrequire_virtualenvr/r1r2r3r6r7r;r>rArBrCrKrLZ simple_urlrMrOrPrQrRrTrUZno_allow_externalrVZno_allow_unsaferWrXrZr[srcrZ no_use_wheelr^rdrer_r`rhZno_cacheZno_depsrirjr rZno_cleanZprerkrlruhashrwZ general_groupZnon_deprecated_index_groupZ index_grouprrrr sr