RenUdZddlZddlZddlZddlmZddlmZmZm Z m Z m Z ddlm Z ddl mZmZmZmZmZddlmZddlmZdd lmZdd lmZdd lmZmZdd lmZdd l m!Z!ddl"m#Z#ddl$m%Z%ddl&m'Z'de dede(ddfdZ)dee(efdede fdZ* d de dee ddfdZ+d de de,ddfdZ-dede(de(de(fd Z.dede(de(de(fd!Z/Gd"d#eZ0eed$d%d&d&d'(Z1ed)efe2d*<eed+d,d-dd./Z3ed)efe2d,<eed0d1d-dd2/Z4ed)efe2d1<eed3d4d5d-de/Z5ed)efe2d6<eed7d8d9d:dd;/Z6ed)efe2d9<eed/Z7ed)efe2d=<eed?d@dAd-dB(Z8ed)efe2dA<eedCdDdEd:ddF/Z9ed)efe2dE<eedGdHdIe:ej;dJdKdL<ej;zdMzNZ=ed)efe2dH<ee0dOdPdQdRdSdSdTUZ>ed)efe2dR<eedVdWd-ddX/Z?ed)efe2dW<eedYdZd[d\d]^Z@ed)efe2dZ<eed_d`dadbdc^ZAed)efe2d`<eedddedfdgdhdidjkZBed)efe2dg<defdlZCee0dmdndSdSdopZDed)efe2dn<ee0dqdrdSddSdstZEed)efe2dr<eedudvdwdxdye!jFdz{ZGed)efe2dx<defd|ZHeed}d~d-dd/ZIed)efe2d~<defdZJdefdZKdefdZLdefdZMdefdZNdede(de(de ddf dZOee0ddddddSdedeOd ZPed)efe2d<de dedefdZQdede(de(de ddf dZRdede(de(de ddf dZSdefdZTdefdZUeeddddddZVed)efe2d<de(deeeWd)fee(ffdZXdede(de(de ddf dZYeeddddeYd[de d ZZed)efe2d<eeddddd{Z[ed)efe2d<eeddddddZ\ed)efe2d<de ddfdZ]de de#fdZ^defdZ_ee0ddeddSdZ`ed)efe2d<dede(de(de ddf dZaeedddeadZbed)efe2d<eedddd-dd/Zced)efe2d<eeddd-d(Zded)efe2d<eedddddì/Zeed)efe2d<dede(de(de ddf dńZfeeddd-ddȬ/Zgee2d<eedddefdeʦZhee2d<eedddddάϦZied)efe2d<eedddddҬӦZjed)efe2d<eeddddd֬ϦZked)efe2d<eedd-ddج٦Zled)efe2d<eedd-ddܬ٦Zmed)efe2d<eeddd-dd/Zned)efe2d<dede(de(de ddf dZoeedddeoddZped)efe2d<eeddd-dd/Zqed)efe2d<ee0ddSdSddZred)efe2d<de ddfdZsee0ddddddZted)efe2d<eeddd-dd/Zued)efe2d<eeddddggddZved)efe2d<eeddddgddgdZwed)efe2d<de1e3e4e5e6e8e9e>e?e@eAeBeCeKeDeEe`ebene7euevewgdZxee(efe2d <d eGeHeIeJgdZyee(efe2d <dS(aC 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. N)partial) SUPPRESS_HELPOption OptionGroup OptionParserValues)dedent)AnyCallableDictOptionalTuplecanonicalize_name)ConfigOptionParser) BAR_TYPES) CommandError)USER_CACHE_DIRget_src_prefix) FormatControl)PyPI) TargetPython) STRONG_HASHES) strtoboolparseroptionmsgreturnc|d|}tjd|}||dS)z Raise an option parsing error using parser.error(). Args: parser: an OptionParser instance. option: an Option instance. msg: the error text. z error:  N)textwrapfilljoinspliterror)rrrs /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/cli/cmdoptions.pyraise_option_errorr'"sR " "S " "C --- . .C LLgroupct||d}|dD]}|| |S)z Return an OptionGroup object group -- assumed to be dict with 'name' and 'options' keys parser -- an optparse Parser nameoptions)r add_option)r)r option_grouprs r&make_option_groupr/0sN vuV}55L "**)))) r(r, check_optionsc|dtdttffd }gd}tt ||r3|j}|tjdddSdS) 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. Nnrc&t|dSN)getattr)r2r0s r&getnamez+check_install_build_global..getnameHs}a...r() build_optionsglobal_optionsinstall_optionszbDisabling all use of wheels due to the use of --build-option / --global-option / --install-option.) stacklevel) strr r anymapformat_controldisallow_binarieswarningswarn)r,r0r6namescontrols ` r&check_install_build_globalrE<s /3/8C=////// C B BE 3w   (!!###  4        r(F check_targetct|j|j|j|jg}t t dh}|j|ko|j }|r|rtd|r|r|j stddSdSdS)zFunction for determining if custom platform options are allowed. :param options: The OptionParser options. :param check_target: Whether or not to check if --target is being used. z:all:zWhen restricting platform and interpreter constraints using --python-version, --platform, --abi, or --implementation, either --no-deps must be set, or --only-binary=:all: must be set and --no-binary must not be set (or must be set to :none:).zQCan not use any platform or abi specific options unless installing via '--target'N) r=python_version platformsabisimplementationrsetr?ignore_dependenciesr target_dir)r,rFdist_restriction_set binary_onlysdist_dependencies_alloweds r&check_dist_restrictionrRVs   "   L  "   y11K+-Qg6Q2Q :       (: ,     r(optvaluec@tj|Sr4)ospath expanduserrrSrTs r&_path_option_checkrZ~s 7  e $ $$r(c t|Sr4rrYs r&_package_name_option_checkr\s U # ##r(cheZdZejdzZejZeed<eed<dS) PipOption)rW package_namer_rWN) __name__ __module__ __qualname__rTYPES TYPE_CHECKERcopyr\rZr(r&r^r^sE L3 3E&++--L#=L -Lr(r^z-hz--helphelpz Show help.)destactionrg.help_z--debug debug_mode store_truezbLet unhandled exceptions propagate outside the main subroutine, instead of logging them to stderr.rhridefaultrgz --isolated isolated_modezSRun pip in an isolated mode, ignoring environment variables and user configuration.z--require-virtualenvz--require-venv require_venvrequire_virtualenvz-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_barchoiceonz*Specify type of progress to be displayed [|z] (default: %default))rhtypechoicesrnrgz--logz --log-filez --local-loglogrWz Path to a verbose appending log.)rhmetavarr{rgz --no-inputno_inputzDisable prompting for input.z--proxyproxyr<z/src". The default for global installs is "/src".)rhr{r~rnrirrgsrcrc,t||jS)zGet a format_control object.)r5rh)rrs r&_get_format_controlrs 66; ' ''r(cpt|j|}tj||j|jdSr4)rrrhandle_mutual_excludes no_binary only_binaryrrrTrexistings r&_handle_no_binaryrsC#6=&99H( r(cpt|j|}tj||j|jdSr4)rrrrrrrs r&_handle_only_binaryrsC#6=&99H( r(c ttt}tdddtd|dS)Nz --no-binaryr?rr<avDo 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.rhrirr{rnrg)rrLrrr?s r&rrsH"355#%%00N  " D    r(c ttt}tdddtd|dS)Nz --only-binaryr?rr<aKDo 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)rrLrrrs r&rrsG"355#%%00N  $ "    r(z --platformrIplatformrzOnly 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.)rfz'at most three version parts are allowedrNc34K|]}t|VdSr4)r).0parts r& z*_convert_python_version..8s(994SYY999999r()rfz$each version part must be an integer)r$lentuple ValueError)rTparts version_infos r&_convert_python_versionr"s | KK  E 5zzA~~>> 5zzQa u::>>1XuQRRy)E<99599999 <<<;;;< $ s0B BBct|\}}|(d||}t|||||j_dS)z3 Handle a provided --python-version value. Nz(invalid --python-version value: {!r}: {}rr)rformatr'rrH)rrrTrr error_msgrs r&_handle_python_versionr?s^ 6e<<L)8??     6&c::::#/FM   r(z--python-versionrHa 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). )rhr~rirr{rnrgz--implementationrKzOnly 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--abirJabiaLOnly 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 dSr4)r-rIrHrKrJ)rs r&add_target_python_optionsrsl  $$$ (())) (())) r(cTt|j|j|j|j}|S)N)rIpy_version_inforJrK)rrIrHrJrK)r, target_pythons r&make_target_pythonrs5 #. \- M r(c*tdddddS)Nz--prefer-binary prefer_binaryrlFz8Prefer older binary packages over newer source packages.rmrrfr(r&rrs(   G    r(z --cache-dir cache_dirzStore the cache data in .)rhrnr~r{rgc|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'r<rr)rrSrTrexcs 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.)rhrirrgno_cachez --no-depsz--no-dependenciesrMz#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_isolationcJ|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. rF)r'r use_pep517)rrSrTrrs r&_handle_no_use_pep517rs:   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)rhrirrnrg no_use_pep517z--install-optionr9a"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.)rhrir~rgz--build-optionr7z9Extra arguments to be supplied to 'setup.py bdist_wheel'.)rhr~rirgz--global-optionr8zcExtra global options to be supplied to the setup.py call before the install or bdist_wheel command.z --no-cleanz!Don't clean up build directories.)rirnrgno_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.c|jjs i|j_ |dd\}}n8#t$r+|d|YnwxYw|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.:rzTArguments to {} must be a hash name followed by a value, like --hash=sha256:abcde...z&Allowed hash algorithms for {} are {}.z, N) rhashesr$rr%rrr# setdefaultr)rrrTralgodigests r&_handle_merge_hashr[s = "!  {{3** ff      vg       =   4 ; ;=11      M##D"--44V<<<<Silence deprecation warnings for upcoming unsupported Pythons.z --use-featurefeatures_enabledfeature)z 2020-resolverz fast-depsz in-tree-buildzr s. MMMMMMMMMMMMMM77777777777777999999777777555555111111BBBBBBBB======++++++;;;;;;444444...... | V # $     T#s(^ 5G K    8<   $,V$4      4%%F%$%4%%%%P%v%C%%%%%%$v$C$$$$$$........ 'w        xV %,G     - % % % HS&[ !   (/w      ( ( ( xV $   -4G      - - -HS&[)   ")    O"""#v+ #*'     # ###(3; ")    ! """#v+  'w        xV    '.g    D!! " " 4 ((>9>## $ $ % ! " ' ' ' hsF{#   %W      +   Xc6k   #*'     '###(3;  'w     G    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),06B0 0000")0     #      )))f%*)0     * ) ) )f%    &g      hsF{$      <v$+7      )$$$ 8CK $ $$%($2>$ $$$$:#*'    !  ###(3; ")     ."""#v+ 18  !  2 111f--4G      - - -HS&[)   % %%%(%2>% %%%%2'     7  CW    "   s*1     4 * * *#v+&   (/w     D ((( xV $)0     6 )))f%#*'    , ###(3; %W    & Xc6k4;7 ! $   A 4448CK0= = =),=6B= ====0&g       ?   hsF{   )0     - ) ) )f%   $+7     - $$$ 8CK QFQtQQQQ '.g      4''' hsF{#4;7 ! $   I 4448CK0*1      ; ; ; G * * *#v+&   18  &     3 4 P 1 1 1f-   "      !!/!! tCH~< $  T#s(^r(