7fuUdZddlZddlZddlZddlZddlmZddlm Z m Z m Z m Z m Z ddlmZddlmZmZmZmZmZddlmZddlmZdd lmZdd lmZmZdd lmZdd l m!Z!dd l"m#Z#ddl$m%Z%ddl&m'Z'ej(e)Z*de de de+ddfdZ,dee+efdede fdZ-d%de de.ddfdZ/de de+de+de+fdZ0de de+de+de+fdZ1Gdd e Z2ee d!d"d#d#d$%Z3ed&e fe4d'<ee d(d)d*dd+,Z5ed&e fe4d)<ee d-d.d*dd/,Z6ed&e fe4d.<ee d0d1d2d*dd3,Z7ed&e fe4d4<ee d5d6d*d7%Z8ed&e fe4d6<ee d8d9d:;Z9ed&e fe4d9<ee dd?dd@,Z:ed&e fe4d><ee dAdBd*ddC,Z;ed&e fe4dB<ee dDdEdFd*dG%Zed&e fe4dM<ee2dSdTdUdVdWdWdXYZ?ed&e fe4dV<ee dZd[d*dd\,Z@ed&e fe4d[<ee d]d^gd_d`dabZAed&e fe4d^<ee dcdddedfdghZBed&e fe4dd<ee didjdkdldmhZCed&e fe4dj<ee dndodpdqdrdsdtuZDed&e fe4dq<de fdvZEee2dwdxdWdWdyzZFed&e fe4dx<ee2d{d|dWddWd}~ZGed&e fe4d|<ee ddddde!jHdZIed&e fe4d<de fdZJee ddd*dd,ZKed&e fe4d<de fdZLde fdZMde fdZNde fdZOde fdZPde de+de+de ddf dZQee2ddddddWdedeQd ZRed&e fe4d<de de defdZSde de+de+de ddf dZTde de+de+de ddf dZUde fdZVde fdZWee ddddddZXed&e fe4d<de+deeeYd&fee+ffdZZde de+de+de ddf dZ[ee dddde[deded Z\ed&e fe4d<ee dddddZ]ed&e fe4d<ee ddddddZ^ed&e fe4d<de ddfdZ_de de#fdZ`de fdZaee2ddeddWdZbed&e fe4d<de de+de+de ddf dZcee dddecdZded&e fe4d<ee dddd*ddĬ,Zeed&e fe4d<ee ddd*dȬ%Zfed&e fe4d<ee dddddͬ,Zged&e fe4d<ee ddd*ddѬ,Zhed&e fe4d<de de+de+de ddf d҄Ziee ddd*ddլ,Zjee4d<ee dddeide צZkee4d<de de+de+de ddf dلZlee ddde+delddެߦ Zmed&e fe4d<ee dddddZned&e fe4d<ee dddddZoed&e fe4d<ee dd*ddZped&e fe4d<ee dd*ddZqed&e fe4d<ee ddd*dd,Zred&e fe4d<ee dddddgdZsed&e fe4d<de de+de+de ddf dZtee dddetddZued&e fe4d<ee ddd*dd,Zved&e fe4d<ee2ddWdWddZwed&e fe4d<de ddfdZxee2dddd d d  Zyed&e fe4d <ee ddd*dd,Zzed&e fe4d<ddgZ{ee ddddgdge{zdZ|ed&e fe4d<ee ddddgddgdZ}ed&e fe4d<d e3e5e6e7e9e:e>s   "   L  "   y11K+-Qg6Q2Q :      #7 @R A       r'optvaluec@tj|SN)ospath expanduserrr?r@s r%_path_option_checkrGfs 7  e $ $$r'c t|SrBrrFs r%_package_name_option_checkrIjs U # ##r'cheZdZejdzZejZeed<eed<dS) PipOption)rD package_namerLrDN) __name__ __module__ __qualname__rTYPES TYPE_CHECKERcopyrIrGr'r%rKrKnsE L3 3E&++--L#=L -Lr'rKz-hz--helphelpz Show help.)destactionrT.help_z--debug debug_mode store_truezbLet unhandled exceptions propagate outside the main subroutine, instead of logging them to stderr.rUrVdefaultrTz --isolated isolated_modezSRun pip in an isolated mode, ignoring environment variables and user configuration.z--require-virtualenvz--require-venv require_venvzMAllow pip to only run in a virtual environment; exit with an error otherwise.require_virtualenvz--break-system-packagesoverride_externally_managedz=Allow pip to modify an EXTERNALLY-MANAGED Python installationz--pythonpythonz.Run pip with the specified Python interpreter.)rUrTz-vz --verboseverbosecountzDGive more output. Option is additive, and can be used up to 3 times.z --no-colorno_colorzSuppress colored output.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--progress-bar progress_barchoice)onoffrawrhzLSpecify whether the progress bar should be used [on, off, raw] (default: on))rUtypechoicesr[rTz--logz --log-filez --local-loglogrDz Path to a verbose appending log.)rUmetavarrkrTz --no-inputno_inputzDisable prompting for input.z--keyring-providerkeyring_provider)autodisabledimport subprocessrqzEnable the credential lookup via the keyring library if user input is allowed. Specify which mechanism to use [disabled, import, subprocess]. (default: disabled))rUrlr[rTz--proxyproxystrzESpecify a proxy in the form scheme://[user:passwd@]proxy.server:port.)rUrkr[rTz --retriesretriesintzRMaximum number of retries each connection should attempt (default %default times).z --timeoutz--default-timeoutsectimeoutfloatz2Set the socket timeout (default %default seconds).)rnrUrkr[rTc 4tdddgdgdddS) Nz--exists-action exists_actionrg)siwbaappendrVzYDefault action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.)rUrkrlr[rVrnrTrrSr'r%rr+s9   )))9    r'z--certcertzPath to PEM-encoded CA certificate bundle. If provided, overrides the default. See 'SSL Certificate Verification' in pip documentation for more information.)rUrkrnrTz --client-cert client_certzkPath to SSL client certificate, a single file containing the private key and the certificate in PEM format.)rUrkr[rnrTz-iz --index-urlz --pypi-url index_urlURLzBase 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.)rUrnr[rTc,tddddgdS)Nz--extra-index-urlextra_index_urlsrrzmExtra URLs of package indexes to use in addition to --index-url. Should follow the same rules as --index-url.rUrnrVr[rTrrSr'r%extra_index_urlrbs-      r'z --no-indexno_indexzAIgnore package index (only looking at --find-links URLs instead).c .tddddgddS)Nz-fz --find-links find_linksrurlaIf 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.rUrVr[rnrTrrSr'r%rrys0   7    r'c,tddddgdS)Nz--trusted-host trusted_hostsrHOSTNAMEz]Mark this host or host:port pair as trusted, even though it does not have valid or any HTTPS.)rUrVrnr[rTrrSr'r% trusted_hostrs-  ,    r'c .tddddgddS)Nz-cz --constraint constraintsrfilez\Constrain versions using the given constraints file. This option can be used multiple times.rrrSr'r%rrs0   2    r'c .tddddgddS)Nz-rz --requirement requirementsrrzQInstall from the given requirements file. This option can be used multiple times.rrrSr'r%rrs0   2    r'c .tddddgddS)Nz-ez --editable editablesrzpath/urlzkInstall a project in editable mode (i.e. setuptools "develop mode") from a local project path or a VCS url.rrrSr'r%editablers1    F    r'opt_strcztj|}t|j|j|dSrB)rCrDabspathsetattrvaluesrU)rrr@rs r% _handle_srcrs1 GOOE " "E FM6;.....r'z--srcz--sourcez --source-dirz--source-directorysrc_dirdircallbackzDirectory to check out editable projects into. The default in a virtualenv is "/src". The default for global installs is "/src".)rUrkrnr[rVrrTsrcrc,t||jS)zGet a format_control object.)getattrrU)rrs r%_get_format_controlrs 66; ' ''r'cpt|j|}tj||j|jdSrB)rrrhandle_mutual_excludes no_binary only_binaryrrr@rexistings r%_handle_no_binaryrsC#6=&99H( r'cpt|j|}tj||j|jdSrB)rrrrrrrs r%_handle_only_binaryrsC#6=&99H( r'c ttt}tdddtd|dS)Nz --no-binaryr7rrvavDo 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.rUrVrrkr[rT)rr6rrr7s r%rrsH"355#%%00N  " D    r'c ttt}tdddtd|dS)Nz --only-binaryr7rrvaKDo 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)rr6rrrs r%rrsG"355#%%00N  $ "    r'z --platformr3platformrzOnly use wheels compatible with . Defaults to the platform of the running system. Use this option multiple times to specify multiple platforms supported by the target interpreter.rc>|sdS|d}t|dkrdSt|dkr-|d}t|dkr|d|ddg} td|D}n#t$rYd SwxYw|dfS) z 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. )NN.)rSz'at most three version parts are allowedrNc34K|]}t|VdSrB)ry).0parts r% z*_convert_python_version..:s(994SYY999999r')rSz$each version part must be an integer)r#lentuple ValueError)r@parts version_infos r%_convert_python_versionr$s | KK  E 5zzA~~>> 5zzQa u::>>1XuQRRy)E<99599999 <<<;;;< $ s0B BBczt|\}}|d|d|}t|||||j_dS)z3 Handle a provided --python-version value. Nz invalid --python-version value: z: rr)rr&rr2)rrr@rr error_msgrs r%_handle_python_versionrAsV 6e<<L)GGGIGG6&c::::#/FM   r'z--python-versionr2a 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). )rUrnrVrrkr[rTz--implementationr5zOnly use wheels compatible with Python 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.z--abir4abiaLOnly use wheels compatible with Python 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.cmd_optsc|t|t|t|t dSrB)r,r3r2r5r4)rs r%add_target_python_optionsrsl  $$$ (())) (())) r'cTt|j|j|j|j}|S)N)r3py_version_infor4r5)rr3r2r4r5)r+ target_pythons r%make_target_pythonrs5 #. \- M r'c*tdddddS)Nz--prefer-binary prefer_binaryrYFzSPrefer binary packages over source packages, even if the source packages are newer.rZrrSr'r%rrs*   )    r'z --cache-dir cache_dirzStore the cache data in .)rUr[rnrkrTc|G t|n6#t$r)}t||t|Yd}~nd}~wwxYwd|j_dS)z Process a value provided for the --no-cache-dir option. This is an optparse.Option callback for the --no-cache-dir option. NrF)rrr&rvrr)rr?r@rexcs r%_handle_no_cache_dirrs  D e     D D D vf#c(( C C C C C C C C C D$FMs AAAz--no-cache-dirzDisable the cache.)rUrVrrTno_cachez --no-depsz--no-dependenciesr8z#Don't install package dependencies.no_depsz--ignore-requires-pythonignore_requires_pythonz'Ignore the Requires-Python information.z--no-build-isolationbuild_isolation store_falseTzDisable isolation when building a modern source distribution. Build dependencies specified by PEP 518 must be already installed if this option is used.no_build_isolationz--check-build-dependenciescheck_build_depsz1Check the build dependencies when PEP517 is used.c|d}t|||d}td|Ds+dd|d}t|||d |j_dS) z Process a value provided for the --no-use-pep517 option. This is an optparse.Option callback for the no_use_pep517 option. Na0A 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) setuptoolswheelc3TK|]#}tj|V$dSrB) importlibutil find_spec)rpackages r%rz(_handle_no_use_pep517..s2IIWy~''00IIIIIIr'z2It is not possible to use --no-use-pep517 without z and z installed.F)r&allr"r use_pep517)rr?r@rrpackagess r%_handle_no_use_pep517rs   6&c::::'H IIIII I I; ;||H-- ; ; ;  6&c:::: %FMr'z --use-pep517rz^Use PEP 517 for building source distributions (use --no-use-pep517 to force legacy behaviour).z--no-use-pep517)rUrVrr[rT no_use_pep517c|d\}}}|dkr|d|dt|j|j}|i}t |j|j|||vrGt ||tr|||dS|||g||<dS|||<dS)N= Arguments to z must be of the form KEY=VAL) partitionr$rrrUr isinstancelistr)rrr@rkeysepvalrUs r%_handle_config_settingsr5sOOC((MCc czz JWJJJKKK 6=&+ . .D | v{D111 d{{ d3i & & ) I  S ! ! ! ! !cC(DIIIS r'z-Cz--config-settingsconfig_settingssettingszConfiguration settings to be passed to the PEP 517 build backend. Settings take the form KEY=VALUE. Use multiple --config-settings options to pass multiple keys to the backend.)rUrkrVrrnrTz--build-option build_optionsz9Extra arguments to be supplied to 'setup.py bdist_wheel'.)rUrnrVrTz--global-optionglobal_optionszcExtra global options to be supplied to the setup.py call before the install or bdist_wheel command.)rUrVrnrTz --no-cleanz!Don't clean up build directories.)rVr[rTno_cleanz--prezYInclude pre-release and development versions. By default, pip only finds stable versions.prez--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--root-user-actionroot_user_actionwarnignorezBAction if pip is run as a root user [warn, ignore] (default: warn))rUr[rlrTc|jjs i|j_ |dd\}}n)#t$r|d|dYnwxYw|t vrA|d|dt |jj|g |dS)zkGiven a value spelled "algo:digest", append the digest to a list pointed to in a dict by the algo name.:rrzE must be a hash name followed by a value, like --hash=sha256:abcde...z&Allowed hash algorithms for {} are {}.z, N) rhashesr#rr$rformatr" setdefaultr)rrr@ralgodigests r%_handle_merge_hashr s = "!  {{3** ff      G          =   4 ; ;=11      M##D"--44V<<<<Silence deprecation warnings for upcoming unsupported Pythons. truststorezno-binary-enable-wheel-cachez --use-featurefeatures_enabledfeaturez fast-depszrGrIrKrW__annotations__rXr\r^r_r`rarcrdrerfrmrorprurxr|rrr simple_urlrrrrrrrrrrrrrrrr3ryrrr2r5r4rrrrrrrrrrrrrrrrrrrrrr r rrrrrALWAYS_ENABLED_FEATURESrrrrrSr'r%r4s MMMMMMMMMMMMMM77777777777777999999777777111111BBBBBBBB======++++++;;;;;;444444......  8 $ $ | V # $     T#s(^ 5G K    %%F%$%4%%%%P%v%C%%%%%%$v$C$$$$$$........ 'w        xV %,G     - % % % HS&[ !   (/w      ( ( ( xV $   -4G     ( - - -HS&[)   6=W  &  H 666Xc6k2!(   9 !!!f")    O"""#v+ #*'     # ###(3; ")    ! """#v+  'w        xV    '.g     W''' hsF{#%W      +   Xc6k   #*'     '###(3; +2'   8 8 8   + + +(3;'    'w     P    xV ")     """#v+ ")      = " " "#v+     v    &g        hsF{   &-W      5 & & & Xc6k "   $+7    O  $ $ $ 8CK        #*'     L ###(3;  F     f     V     f     &    ///S/,/SW//// %W      N     >Xc6k$(((3((((   ),6B   ),6B 6$V$$+7      J $ $ $ 8CK     3 5sCx(3-1O+P    : 0  0  0), 06B 0  0 0 0 0)0     #      )))f%*)0     * ) ) )f%    &g      hsF{$      < v    $+7      )$$$ 8CK $ $$%($2>$ $$$$:#*'    !  ###(3; ")     ."""#v+ 18  !  2 111f--4G      - - -HS&[)   +2'     < +++(3;' %  % %%( %2> %  % % % %F'     7  CW    "   s  ),6B &*1    $  , * * *#v+&   (/w     D ((( xV $)0     6 )))f%#*'    , ###(3; %W    & Xc6k4;7 ! $   A 4448CK0+2'    X  M +++(3;'= = =),=6B= ====0&g       ?   hsF{   )0     - ) ) )f%   $+7     - $$$ 8CK QFQtQQQQ '.g      4''' hsF{#4;7 ! $   I 4448CK0" *1        H * * *#v+&   18  &     Q 1 1 1f-   (      !!3!! tCH~@ $  T#s(^r'