3 ]Y@@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)r add_option)groupparser option_groupoptionr-/tmp/pip-build-8jg9gmni/pip/pip/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..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--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-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-loglogpathz Path to a verbose appending log.)r-metavarr,z --no-inputno_inputz--proxyproxystrzr1r,z --default-vcs default_vcsz--skip-requirements-regexskip_requirements_regexc Cs"tddddddddggd d d d S) Nz--exists-action exists_actionchoicesiwbaappendr.zYDefault action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.)r-r>choicesr1r.r9r,)rrrrrrHs rHz--certcertzPath 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_urlURLzBase 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,cCstddddgddS)Nz--extra-index-urlextra_index_urlsrTrOzmExtra URLs of package indexes to use in addition to --index-url. Should follow the same rules as --index-url.)r-r9r.r1r,)rrrrrextra_index_urlsrVz --no-indexno_indexzAIgnore package index (only looking at --find-links URLs instead).c CstddddgdddS)Nz-fz --find-links find_linksrOurlzIf 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,)rrrrrrXsrXcCstdddgdtdS)Nz--allow-externalallow_externalrOPACKAGE)r-r.r1r9r,)rrrrrrrZsrZz--allow-all-externalallow_all_externalcCstddddgddS)Nz--trusted-host trusted_hostsrOHOSTNAMEzKMark 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 CstddddgdtdS)Nz--allow-unverifiedz--allow-insecureallow_unverifiedrOr[)r-r.r1r9r,)rrrrrr allow_unsafe3srbz--no-allow-insecureallow_all_insecurez--process-dependency-linksprocess_dependency_linksz*Enable the processing of dependency links.c CstddddgdddS)Nz-cz --constraint constraintsrOfilez\Constrain versions using the given constraints file. This option can be used multiple times.)r-r.r1r9r,)rrrrrreRsrec CstddddgdddS)Nz-rz --requirement requirementsrOrfzQInstall from the given requirements file. This option can be used multiple times.)r-r.r1r9r,)rrrrrrg]srgc CstddddgdddS)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,)rrrrreditablehsriz--srcz--sourcez --source-dirz--source-directorysrc_dirdirzDirectory to check out editable projects into. The default in a virtualenv is "/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_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_binarysrtc Cs tdddtdtttddS)Nz --no-binaryrcallbackr<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,)rrsrsetrrrrrns  rnc Cs tdddtdtttddS)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,)rrtrrvrrrrros  roz --cache-dir cache_dirzStore the cache data in .)r-r1r9r,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#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-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) rlhashessplit ValueErrorerrorrjoin setdefaultrO)rrprqralgodigestrrr _merge_hashsrz--hashrrustringzgVerify that the package's archive matches this hash before installing. Example: --hash=sha256:abcdef...)r-r.rur>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__ __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 sr