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3e5d<ee dd7d!dZ{d3e5d<ee dd7d!dZ|d3e5d<ee ddd7d!d9Z}d3e5d<ee d d d d d gd Z~d3e5d <dEdZee dddeddZd3e5d<ee ddd7d!d9Zd3e5d<ee3dddddddZd3e5d<dAdZee3dddd d!d"#Zd3e5d$<ee d%d&d7d!e 9Zd3e5d&<d'd(gZee d)d*d+dggd,ezd-.Zd3e5d/<ee d0d1d+dgd2d3gd4.Zd3e5d5<d6e4e6e7e8e:e;e=e>e@eAeBeCeDeFeGeQeHeIemeoe}e > *; ''' ;;; :e : : : : : 6&c:::::::::: ;s6> A.A))A.c 8tddddtddS)Nz--uploaded-prior-tordatetimecallbackrzOnly consider packages uploaded prior to the given date time. Accepts ISO 8601 strings (e.g., '2023-01-01T00:00:00Z'). Uses local timezone if none specified. Only effective when installing from indexes that provide upload-time metadata.)rerrfrr|rd)rrrcr)r'rrs1  *  I    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.)rerfrrkrdrrcr)r' trusted_hostrs-  ,    r)c .tddddgddS)Nz-cz --constraint constraintsrfilez\Constrain versions using the given constraints file. This option can be used multiple times.rrrcr)r'rrs0   2    r)c .tddddgddS)Nz--build-constraintrErrrzfConstrain build dependencies using the given constraints file. This option can be used multiple times.)rerfr|rkrrdrrcr)r'rErEs0    6    r)c .tddddgddS)Nz-rz --requirement requirementsrrzQInstall from the given requirements file. This option can be used multiple times.rrrcr)r'rrs0   2    r)c,tddgdddS)Nz--requirements-from-scriptrrequirements_from_scriptsrzTInstall dependencies of the given script fileas defined by PEP 723 inline metadata. )rfrkrerrdrrcr)r'rrs- $ (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.rrrcr)r'editabler s1    F    r)opt_strcztj|}t|j|j|dSrR)rSrTabspathsetattrrre)rrrPrs r' _handle_srcr/s1 GOOE " "E FM6;.....r)z--srcz--sourcez --source-dirz--source-directorysrc_dirdirrzDirectory to check out editable projects into. The default in a virtualenv is "/src". The default for global installs is "/src".)rer|rrkrfrrdsrcrr c,t||jS)zGet a format_control object.getattrrerrs r'_get_format_controlrF 66; ' ''r)cpt|j|}tj||j|jdSrR)rrrhandle_mutual_excludes no_binary only_binaryrrrPrexistings r'_handle_no_binaryrKsC#6=&99H( r)cpt|j|}tj||j|jdSrR)rrrrrrrs r'_handle_only_binaryrVsC#6=&99H( r)c ttt}tdddtd|dS)Nz --no-binaryr<rravDo 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.rerfrr|rkrd)rr;rrr<s r'rrasH"355#%%00N  " D    r)c ttt}tdddtd|dS)Nz --only-binaryr<rraKDo 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)rr;rrrs r'rrssG"355#%%00N  $ "    r)c,t||jS)zGet a release_control object.rrs r'_get_release_controlrrr)ctt|j|}|||j|jddS)N all_releases)rrrr only_finalrs r'_handle_all_releasesrsI$FM6::H ##  r)ctt|j|}|||j|jddS)Nr)rrrrrrs r'_handle_only_finalrsI$FM6::H ##  r)c ttt}tdddtd|dS)Nz--all-releasesrelease_controlrraUAllow all release types (including pre-releases) for a package. Can be supplied multiple times, and each time adds to the existing value. Accepts either ":all:" to allow pre-releases for all packages, ":none:" to empty the set (notice the colons), or one or more package names with commas between them (no colons). Cannot be used with --pre.r)rr;rrrs r'rrsG$SUUCEE22O  %     r)c ttt}tdddtd|dS)Nz --only-finalrrra2Only allow final releases (no pre-releases) for a package. Can be supplied multiple times, and each time adds to the existing value. Accepts either ":all:" to disable pre-releases for all packages, ":none:" to empty the set, or one or more package names with commas between them. Cannot be used with --pre.r)rr;rrrs r'rrsG$SUUCEE22O  # 3    r)ct|dr|jsdS|j}|js|jrt d|jddS)z Raise an error if --pre is used with --all-releases or --only-final, and transform --pre into --all-releases :all: if used alone. preNz9--pre cannot be used with --all-releases or --only-final.r5)rHrrrrradd)r.rs r'check_release_control_exclusiversq 7E " "'+-O#X'AXVWWW $$W-----r)z --platformr8platformrzOnly 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.r"tuple[tuple[int, ...], str | None]c>|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.)rcz'at most three version parts are allowedrNc34K|]}t|VdSrR)r).0parts r' z*_convert_python_version..s(994SYY999999r))rcz$each version part must be an integer)r%lentupler)rPparts version_infos r'_convert_python_versionrs | 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: rr)rr(rr7)rrrPrr error_msgrs r'_handle_python_versionrsV 6e<<L)GGGIGG6&c::::#/FM   r)z--python-versionr7a 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). )rerrfrr|rkrdz--implementationr:zOnly 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--abir9abiaLOnly 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 dSrR)r/r8r7r:r9)rs r'add_target_python_optionsrGsl  $$$ (())) (())) r)rcTt|j|j|j|j}|S)N)r8py_version_infor9r:)rr8r7r9r:)r. target_pythons r'make_target_pythonrNs5 #. \- M r)c*tdddddS)Nz--prefer-binary prefer_binaryriFzSPrefer binary packages over source packages, even if the source packages are newer.rjrrcr)r'rrYs*   )    r)z --cache-dir cache_dirzStore the cache data in .)rerkrr|rdc|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(rrr)rrOrPrrs r'_handle_no_cache_dirr qs  D e     D D D vf#c(( C C C C C C C C C D$FMs AAAz--no-cache-dirzDisable the cache.)rerfrrdno_cachez --no-depsz--no-dependenciesr=z#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)rrOrPrrTsep 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.)rerkr|rfrrrdz--ignore-requires-pythonignore_requires_pythonz'Ignore the Requires-Python information.z--no-build-isolationrI 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_depszCheck the build dependencies.z --use-pep517 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&rrrer isinstancelistr)rrrPrkeyrvalres r'_handle_config_settingsr#sOOC((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 build backend. Settings take the form KEY=VALUE. Use multiple --config-settings options to pass multiple keys to the backend.)rer|rfrrrdz --no-cleanz!Don't clean up build directories.)rfrkrdno_cleanz--prezYInclude pre-release and development versions. By default, pip only finds stable versions.rz--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))rerkr}rdc|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)rrrPralgodigests r'_handle_merge_hashr2?s = "!  {{3** ff      G          =   4 ; ;=11      M##D"--44V<<<<ALWAYS_ENABLED_FEATURESrBrDrErFrGrcr)r'r^sZ#""""" MMMMMMMMMMMMMM 999999777777111111BBBBBBBB======++++++??????;;;;;;;;;;;;444444......  8 $ $        %%%%%P;;;;.%%%%$$$$........ 'w        %,G     - % % %    (/w      ( ( (    -4G    W - - -    6=W  &  H 666!(   9 !!!")    O"""#*'     # ###")    ! """ 'w            '.g    ( ( (  0 ' ' '    %W      +       #*'     '###+2'   8 8 8   + + +     'w     P    ")    S """)0      )))")      = " " "        &g            &-W      5 & & &    $+7    O  $ $ $        #*'     L ###     ;;;;>"                        //// %W      N     >$(((( $$((((        $" . . . . $+7      J $ $ $         : 0 0 0 0)0     #      )))*)0     * ) ) )     &g      $        $+7      )$$$ $$$$:#*'    !  ###")     .""">>>>2,37     %  C , , ,    18  !  2 111-4G      - - -    +2'     ( +++'       &*1    $  , * * *    #*'    , ###%W    & &g    9 4;7 ! $   A 444+2'    X  M +++====0&g       ?       )0     - ) ) )    $+7     - $$$ QQQQ '.g      4''' 4;7 ! $    444" *1            H*** 18  &     Q 1 1 1    &      !!5!! B $        (   + +      r)