kgh|UdZddlZddlZddlZddlZddlZddlmZddl m Z m Z m Z m Z mZddlmZddlmZmZmZmZmZddlmZddlmZdd lmZdd lmZmZdd lm Z dd l!m"Z"dd l#m$Z$ddl%m&Z&ddl'm(Z(ej)e*Z+de de de,ddfdZ-dee,efdede fdZ.d0dede/ddfdZ0de de,de,de,fdZ1de de,de,de,fdZ2Gdd e Z3ee d!d"d#d#d$%Z4ed&e fe5d'<ee d(d)d*dd+,Z6ed&e fe5d)<ee d-d.d*dd/,Z7ed&e fe5d.<ee d0d1d2d*dd3,Z8ed&e fe5d4<ee d5d6d*d7%Z9ed&e fe5d6<ee d8d9d:;Z:ed&e fe5d9<ee dd?dd@,Z;ed&e fe5d><ee dAdBd*ddC,Zed&e fe5dJ<ee dLdMdNgdOdPdQRZ?ed&e fe5dM<ee3dSdTdUdVdWdWdXYZ@ed&e fe5dV<ee dZd[d*dd\,ZAed&e fe5d[<ee d]d^gd_d`dabZBed&e fe5d^<ee dcdddedfdghZCed&e fe5dd<ee didjdkdldmhZDed&e fe5dj<ee dndodkddphZEed&e fe5do<ee dqdrdsdtdudvdwxZFed&e fe5dt<de fdyZGee3dzd{dWdWd|}ZHed&e fe5d{<ee3d~ddWddWdZIed&e fe5d<ee ddddde"jJdZKed&e fe5d<de fdZLee ddd*dd,ZMed&e fe5d<de fdZNde fdZOde fdZPde fdZQde fdZRde de,de,de ddf dZSee3ddddddWdedeSd ZTed&e fe5d<dede defdZUde de,de,de ddf dZVde de,de,de ddf dZWde fdZXde fdZYee ddddddZZed&e fe5d<de,deee[d&fee,ffdZ\de de,de,de ddf dZ]ee dddde]deded Z^ed&e fe5d<ee dddddZ_ed&e fe5d<ee ddddddZ`ed&e fe5d<de ddfdZadede$fdZbde fdZcee3ddeddWdZded&e fe5d<de de,de,de ddf dZeee dddeed¦Zfed&e fe5d<ee dddd*ddǬ,Zged&e fe5d<de de,de,de ddf dɄZhee ddge,dehddͬΦ Zied&e fe5d<ee ddd*dѬ%Zjed&e fe5d<ee ddddd֬,Zked&e fe5d<ee ddd*ddڬ,Zled&e fe5d<de de,de,de ddf dۄZmee ddd*ddެ,Znee5d<ee dddemde Zoee5d<de de,de,de ddf dZpee ddde,depdd Zqed&e fe5d<ee dddddZred&e fe5d<ee dddddZsed&e fe5d<ee dd*ddZted&e fe5d<ee dd*ddZued&e fe5d<ee dd*ddZved&e fe5d<ee ddd*dd,Zwed&e fe5d<ee dddddgdZxed&e fe5d<de de,de,de ddf dZyee dddeydd Zzed&e fe5d <ee d d d*dd ,Z{ed&e fe5d <ee3ddWdWddZ|ed&e fe5d<deddfdZ}ee3ddddddZ~ed&e fe5d<ee ddd*de ,Zed&e fe5d<ddgZee ddd dgd!gezd"#Zed&e fe5d$<ee d%d&d dgd'd(gd)#Zed&e fe5d*<d+e4e6e7e8e:e;e=e>e@eAeBeCeDeFeGeOeHeIedefewe?s   "   L  "   y11K+-Qg6Q2Q :      #7 @R A       r'optvaluec@tj|SN)ospath expanduserrr?r@s r%_path_option_checkrGgs 7  e $ $$r'c t|SrBrrFs r%_package_name_option_checkrIks U # ##r'cheZdZejdzZejZeed<eed<dS) PipOption)rD package_namerLrDN) __name__ __module__ __qualname__rTYPES TYPE_CHECKERcopyrIrGr'r%rKrKosE 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 [auto, disabled, import, subprocess]. (default: %default))rUrlr[rTz--proxyproxystrzESpecify a proxy in the form scheme://[user:passwd@]proxy.server:port.)rUrkr[rTz --retriesretriesintzHMaximum attempts to establish a new HTTP connection. (default: %default)z--resume-retriesresume_retrieszQMaximum attempts to resume or restart an incomplete download. (default: %default)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%rr5s9   )))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_urlrls-      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%rrs0   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%rr sG"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..Ds(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_versionrKsV 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_depsc|d\}}}|sd}n1tj|jdkrd}t ||||jj||fdS)a Process a value provided for the --group option. Splits on the rightmost ":", and validates that the path (if present) ends in `pyproject.toml`. Defaults the path to `pyproject.toml` when one is not given. `:` cannot appear in dependency group names, so this is a safe and simple parse. This is an optparse.Option callback for the dependency_groups option. :zpyproject.tomlz*group paths use 'pyproject.toml' filenamesrN) rpartitionpathlibPurePathr*r&rdependency_groupsr)rr?r@rrDsep groupnamers r%_handle_dependency_grouprs!++C00D#y ?  D ! ! &*: : :>C vf# > > > > M#**D)+<=====r'z--grouprz [path:]groupzInstall a named dependency-group from a "pyproject.toml" file. If a path is given, the name of the file must be "pyproject.toml". Defaults to using "pyproject.toml" in the current directory.)rUr[rkrVrrnrTz--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) setuptoolsc3TK|]#}tj|V$dSrB) importlibutil find_spec)rpackages r%rz(_handle_no_use_pep517..Gs2IIWy~''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_pep517r/s   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@rkeyrvalrUs r%_handle_config_settingsrgsOOC((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--jsonz.Output data in a machine-readable JSON format.jsonz--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.rrrzE 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_hashrs = "!  {{3** ff      G          =   4 ; ;=11      M##D"--44V<<<<rGrIrKrW__annotations__rXr\r^r_r`rarcrdrerfrmrorprurxr{r}rrr simple_urlrrrrrrrrrrrrrrrr3ryrrr2r5r4rrrrrrrrrrrrrrrrrrrrrrr r rrrrrrrALWAYS_ENABLED_FEATURESr"r$r%r&rSr'r%r<s 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 ")    S """#v+ )0      )))f%")      = " " "#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+ > >>%(>2>> >>>>2,37     %  C , , ,8CK(   18  !  2 111f--4G      - - -HS&[)   +2'     < +++(3;' %  % %%( %2> %  % % % %F'     7  CW    "   s  ),6B &*1    $  , * * *#v+&   (/w     D ((( xV $)0     6 )))f%#*'    , ###(3; %W    & Xc6k&g    9 hsF{4;7 ! $   A 4448CK0+2'    X  M +++(3;'= = =),=6B= ====0&g       ?   hsF{   )0     - ) ) )f%   $+7     - $$$ 8CK QFQtQQQQ '.g      4''' hsF{#4;7 ! $    4448CK0" *1        H * * *#v+&   18  &     Q 1 1 1f-   &      !!5!! tCH~B $  T#s(^r'