3 ”Renpã@sdZddlmZddlZddlZddlZddlmZddlm Z ddl m Z m Z m Z ddlmZddlmZdd lmZdd lmZmZdd lmZdd lmZdd lmZddlmZddlmZe�rddl m!Z!m"Z"m#Z#m$Z$m%Z%ddl m&Z&m'Z'ddl(m)Z)dd„Z*dd„Z+�ddd„Z,�ddd„Z-dd„Z.Gdd„de ƒZ/e e d d!d"d"d#d$�Z0e e d%d&d'dd(d)�Z1e e d*d+d,d'de d)�Z2e e d-d.d/d0dd1d)�Z3e e d2d3d'dd4d)�Z4e e d5d6d7d'd8d$�Z5e e d9d:d;d0ddd?e7ej8ƒƒd@dAdBj9ej8ƒƒdCdD�Z:e e/dEdFdGdHdIdIdJdK�Z;e e dLdMd'ddNd)�Ze e dZd[d\d]d^d_d`da�Z?dbdc„Z@e e/dddedIdIdfdg�ZAe e/dhdidIddIdjdk�ZBe e dldmdndodpejCdqdr�ZDdsdt„ZEe e dudvd'ddwd)�ZFdxdy„ZGdzd{„ZHd|d}„ZId~d„ZJd€d�„ZKd‚dƒ„ZLe e/d„d…d†d‡dˆdId‰eƒdŠeLd‹dŒ� ZMd�dŽ„ZNd�d�„ZOd‘d’„ZPd“d”„ZQd•d–„ZRe e d—d˜d˜dd™dr�ZSdšd›„ZTdœd�„ZUe e dždŸdŸdŠeUdQded ƒd¡� ZVe e d¢d£d£dd¤dr�ZWe e d¥d¦d¦dd§dr�ZXd¨d©„ZYdªd«„ZZd¬d­„Z[e e/d®d¯ed‰dId°d±�Z\d²d³„Z]e e d´d¯dŠe]dµd¶�Z^e e d·d¸d¹d'ddºd)�Z_d»d¼„Z`e e/d½d¾d¿dÀdÁdId‰dŠe`dÂdÃ� Zae e dÄdÅd'dÆd$�Zbe e dÇdÈdÉdÊdËd)�ZcdÌdÍ„Zde e dÎdÏd'ddÐd)�Zee e dÑdÏdŠedde dÒ�Zfe e dÓdÔdÕdÖd×dØ�Zge e dÙdÚdÕdÖdÛdØ�Zhe e dÜd'ddÝdÞ�Zie e dßd'ddàdÞ�Zje e dádâd'ddãd)�Zkdädå„Zle e dædçdŠeldèdédê�Zme e dëdìd'ddíd)�Zne e/dîdIdIdÕdïdð�Zodñdò„Zpe e dódôd'ddõd)�Zqe e död÷dødÕgdùge dú�Zre e dûdüdødÕgdýdþgdÿdú�Zse e �d�ddødÕgg�ddú�Zt�de0e1e2e3e5e6e;ee?e@eHeAeBe\e^eke4eqeresetg�dœZu�deDeEeFeGg�dœZvdS(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. é)Úabsolute_importN)Ú strtobool)Úpartial)Ú SUPPRESS_HELPÚOptionÚ OptionGroup)Údedent)Ú BAR_TYPES)Ú CommandError)ÚUSER_CACHE_DIRÚget_src_prefix)Ú FormatControl)ÚPyPI)Ú TargetPython)Ú STRONG_HASHES)ÚMYPY_CHECK_RUNNING)ÚAnyÚCallableÚDictÚOptionalÚTuple)Ú OptionParserÚValues)ÚConfigOptionParsercCs.dj||ƒ}tjdj|jƒƒƒ}|j|ƒ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)ÚformatÚtextwrapÚfillÚjoinÚsplitÚerror)ÚparserÚoptionÚmsg©r$ú‹/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cli/cmdoptions.pyÚraise_option_error&s r&cCs0t||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 ÚnameÚoptions)rÚ add_option)Úgroupr!Ú option_groupr"r$r$r%Úmake_option_group5sr,csPˆdkr |‰‡fdd„}dddg}tt||ƒƒrL|j}|jƒtjddd �dS) zÏDisable 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ˆ|dƒS)N)Úgetattr)Ún)Ú check_optionsr$r%ÚgetnameMsz+check_install_build_global..getnameÚ build_optionsÚglobal_optionsÚinstall_optionszbDisabling all use of wheels due to the use of --build-option / --global-option / --install-option.é)Ú stacklevel)ÚanyÚmapÚformat_controlÚdisallow_binariesÚwarningsÚwarn)r(r/r0ÚnamesÚcontrolr$)r/r%Úcheck_install_build_globalBs  r>FcCsdt|j|j|j|jgƒ}ttƒdhƒ}|j|ko6|j }|rH|rHt dƒ‚|r`|r`|j r`t dƒ‚dS)zÀFunction 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:zòWhen 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) r6Úpython_versionÚplatformÚabiÚimplementationr Úsetr8Úignore_dependenciesr Ú target_dir)r(Ú check_targetÚdist_restriction_setÚ binary_onlyÚsdist_dependencies_allowedr$r$r%Úcheck_dist_restrictionZs   rJcCs tjj|ƒS)N)ÚosÚpathÚ expanduser)r"ÚoptÚvaluer$r$r%Ú_path_option_check‚srPc@s(eZdZejdZejjƒZeed<dS)Ú PipOptionrLN)rL)Ú__name__Ú __module__Ú __qualname__rÚTYPESÚ TYPE_CHECKERÚcopyrPr$r$r$r%rQ‡s  rQz-hz--helpÚhelpz Show help.)ÚdestÚactionrXz --isolatedÚ isolated_modeÚ store_truezSRun pip in an isolated mode, ignoring environment variables and user configuration.)rYrZÚdefaultrXz--require-virtualenvz--require-venvÚ require_venvz-vz --verboseÚverboseÚcountzDGive more output. Option is additive, and can be used up to 3 times.z --no-colorÚno_colorzSuppress colored outputz-Vz --versionÚversionzShow version and exit.z-qz--quietÚquietzƒGive 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_barÚchoiceÚonz*Specify type of progress to be displayed [ú|z] (default: %default))rYÚtypeÚchoicesr]rXz--logz --log-filez --local-logÚlogrLz Path to a verbose appending log.)rYÚmetavarrhrXz --no-inputÚno_inputzDisable prompting for input.z--proxyÚproxyÚstrÚz/src". The default for global installs is "/src".)rYrhrkr]rZr–rXcCs t||jƒS)zGet a format_control object.)r-rY)r‘r"r$r$r%Ú_get_format_control¶sr—cCs"t|j|ƒ}tj||j|jƒdS)N)r—r‘r Úhandle_mutual_excludesÚ no_binaryÚ only_binary)r"r’rOr!Úexistingr$r$r%Ú_handle_no_binary¼s rœcCs"t|j|ƒ}tj||j|jƒdS)N)r—r‘r r˜ršr™)r"r’rOr!r›r$r$r%Ú_handle_only_binaryÄs r�c Cs$ttƒtƒƒ}tdddtd|dd�S)Nz --no-binaryr8r–rnavDo 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.)rYrZr–rhr]rX)r rCrrœ)r8r$r$r%r™Ìs r™c Cs$ttƒtƒƒ}tdddtd|dd�S)Nz --only-binaryr8r–rnaKDo 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.)rYrZr–rhr]rX)r rCrr�)r8r$r$r%ršÜs ršz --platformr@z[Only use wheels compatible with . Defaults to the platform of the running system.c Cs’|sd S|jdƒ}t|ƒdkr&fdfSt|ƒdkrZ|d}t|ƒdkrZ|d|dd…g}ytdd„|Dƒƒ}Wntk rˆfd fSX|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. NÚ.éz'at most three version parts are allowedércss|]}t|ƒVqdS)N)rq)Ú.0Úpartr$r$r%ú sz*_convert_python_version..z$each version part must be an integer)NN)rÚlenÚtupleÚ ValueError)rOÚpartsÚ version_infor$r$r%Ú_convert_python_versionøs     r©cCs:t|ƒ\}}|dk r.dj||ƒ}t|||d�||j_dS)z3 Handle a provided --python-version value. Nz(invalid --python-version value: {!r}: {})r"r#)r©rr&r‘r?)r"r’rOr!r¨Ú error_msgr#r$r$r%Ú_handle_python_versions  r«z--python-versionr?a� 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). )rYrkrZr–rhr]rXz--implementationrBzâOnly 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--abirAzñOnly use wheels compatible with Python abi , e.g. 'pypy_41'. If not specified, then the current interpreter abi tag is used. Generally you will need to specify --implementation, --platform, and --python-version when using this option.cCs4|jtƒƒ|jtƒƒ|jtƒƒ|jtƒƒdS)N)r)r@r?rBrA)Úcmd_optsr$r$r%Úadd_target_python_optionsVs   r­cCst|j|j|j|jd�}|S)N)r@Úpy_version_inforArB)rr@r?rArB)r(Ú target_pythonr$r$r%Úmake_target_python^s  r°cCstdddddd�S)Nz--prefer-binaryÚ prefer_binaryr\Fz8Prefer older binary packages over newer source packages.)rYrZr]rX)rr$r$r$r%r±js r±z --cache-dirÚ cache_dirzStore the cache data in .)rYr]rkrhrXcCsV|dk rJy t|ƒWn4tk rH}zt||t|ƒd�WYdd}~XnXd|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. N)r"r#F)rr¦r&rnr‘r²)r"rNrOr!Úexcr$r$r%Ú_handle_no_cache_dir€s  $ r´z--no-cache-dirzDisable the cache.)rYrZr–rXz --no-depsz--no-dependenciesrDz#Don't install package dependencies.cCs$|rtjj|ƒ}t|j|j|ƒdS)N)rKrLr�r�r‘rY)r"rNrOr!r$r$r%Ú_handle_build_dir¯s rµz-bz--buildz --build-dirz--build-directoryÚ build_diraK(DEPRECATED) Directory to unpack packages into and build in. Note that an initial build still takes place in a temporary directory. The location of temporary directories can be controlled by setting the TMPDIR environment variable (TEMP on Windows) appropriately. When passed, build directories are not cleaned in case of failures.)rYrhrkrZr–rXz--ignore-requires-pythonÚignore_requires_pythonz'Ignore the Requires-Python information.z--no-build-isolationÚbuild_isolationÚ store_falseTz—Disable isolation when building a modern source distribution. Build dependencies specified by PEP 518 must be already installed if this option is used.cCs&|dk rd}t|||d�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"r#F)r&r‘Ú use_pep517)r"rNrOr!r#r$r$r%Ú_handle_no_use_pep517Ús r»z --use-pep517rºz^Use PEP 517 for building source distributions (use --no-use-pep517 to force legacy behaviour).z--no-use-pep517)rYrZr–r]rXz--install-optionr3r}r(a"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.)rYrZrkrXz--global-optionr2zTExtra global options to be supplied to the setup.py call before the install command.z --no-cleanz!Don't clean up build directories.)rZr]rXz--prezYInclude pre-release and development versions. By default, pip only finds stable versions.z--disable-pip-version-checkÚdisable_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 Cs„|jjsi|j_y|jddƒ\}}Wn$tk rH|jdj|ƒƒYnX|tkrj|jdj|djtƒƒƒ|jjj|gƒj |ƒdS)zkGiven a value spelled "algo:digest", append the digest to a list pointed to in a dict by the algo name.ú:r zTArguments to {} must be a hash name followed by a value, like --hash=sha256:abcde...z&Allowed hash algorithms for {} are {}.z, N) r‘Úhashesrr¦r rrrÚ setdefaultr})r"r’rOr!ÚalgoÚdigestr$r$r%Ú_handle_merge_hash9srÂz--hashr¾ÚstringzgVerify that the package's archive matches this hash before installing. Example: --hash=sha256:abcdef...)rYrZr–rhrXz--require-hashesÚrequire_hasheszžRequire 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.z--pathz^Restrict to the specified installation path for listing packages (can be used multiple times).)rYrhrZrXcCs|jr|js|jrtdƒ‚dS)Nz2Cannot combine '--path' with '--user' or '--local')rLÚuserÚlocalr )r(r$r$r%Úcheck_list_path_optionpsrÇz--no-python-version-warningÚno_python_version_warningz>Silence deprecation warnings for upcoming unsupported Pythons.z--unstable-featureÚunstable_featuresÚfeatureÚresolver)rYrkrZr]rirXz --use-featureÚfeatures_enabledz 2020-resolverz fast-depszrJrPrQÚhelp_r[Úrequire_virtualenvr_rarbrcÚlistÚkeysrrdrjrlrmrprtrwr~rÚ simple_urlr€rƒr„r…r‰rŠrŒrŽr“Úsrcr—rœr�r™ršr@r©r«r?rBrAr­r°r±r²r´Úno_cacheÚno_depsrµr¶r·Úno_build_isolationr»rºÚ no_use_pep517r3r2Úno_cleanÚprer¼rÂÚhashrÄÚ list_pathrÇrÈÚunstable_featureÚuse_new_featureÚuse_deprecated_featureÚ general_groupÚ index_groupr$r$r$r%Ús              (