v_c@@s# dZddlmZddlZddlZddlZddlmZddlm Z ddl m Z m Z m Z ddlmZddlmZdd lmZdd lmZmZdd lmZdd lmZdd lmZddlmZddlmZercddl m!Z!m"Z"m#Z#m$Z$m%Z%ddl m&Z&m'Z'ddl(m)Z)ndZ*dZ+ddZ-e.dZ/dZ0de fdYZ1e e ddddddddZ2e e d dd!dd"d#e.dd$Z3e e d%d&dd'dd"d#e.de Z4e e d(d)dd*dd+d#ddd,Z5e e d-dd.dd"d#e.dd/Z6e e d0d1dd2dd"dd3Z7e e d4d5dd6dd+d#ddd7Z8e e d8dd9d:d;d<e9ej:d#d=dd>d?j;ej:d@Z<e e1dAdBdCddDdEdFd:dFddGZ=e e dHddIdd"d#e.ddJZ>e e dKddLd:dMd#dNddOZ?e e dPddQd:dRd#dSddTZ@e e dUdVdEdWddXd:dYd#dZdd[ZAd\ZBe e1d]dd^d:dFdEdFdd_ZCe e1d`ddad:dFd#ddEdFddbZDe e dcdddeddfdEdgd#ejEddhZFdiZGe e djddkdd"d#e.ddlZHdmZIdnZJdoZKdpZLdqZMdrZNe e1dsdtdudvddwd:dFdEdxd#eddydyeNddzZOd{ZPd|ZQd}ZRd~ZSdZTe e ddddEdd#dddZUdZVdZWe e ddddEdddydyeWd:dMd#ddedZXe e ddddEdd#dddZYe e ddddEdd#dddZZdZ[dZ\dZ]e e1dddd#edEdxd:dFddZ^dZ_e e dddddydye_ddZ`e e dddddd"d#e.ddZadZbe e1ddddddd:dFdEdxddydyebddZce e ddddd"ddZde e dddddd#eeddZfdZge e ddddd"d#dddZhe e dddddydyegd#dde Zie e ddddddEdddZje e ddddddEdddZke e ddd"d#e.ddZle e ddd"d#e.ddZme e ddddd"d#e.ddZndZoe e dddddydyeod:dddZpe e ddddd"d#e.ddZqe e1dddFd:dFddddZrdZse e ddddd"d#e.ddZte e ddddEdddd#gd<dgde Zue e ddddEdddd#gd<ddgddZve e ddddEdddd#gd<gddZwidd6e2e3e4e5e7e8e=e>e?e@eAeBeJeCeDe^e`ene6eteuevewgd6Zxidd6eFeGeHeIgd6ZydS(sC 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. i(tabsolute_importN(t strtobool(tpartial(t SUPPRESS_HELPtOptiont OptionGroup(tdedent(t BAR_TYPES(t CommandError(tUSER_CACHE_DIRtget_src_prefix(t FormatControl(tPyPI(t TargetPython(t STRONG_HASHES(tMYPY_CHECK_RUNNING(tAnytCallabletDicttOptionaltTuple(t OptionParsertValues(tConfigOptionParsercC@sAdj||}tjdj|j}|j|dS(s Raise an option parsing error using parser.error(). Args: parser: an OptionParser instance. option: an Option instance. msg: the error text. s {} error: {}t N(tformatttextwraptfilltjointsplitterror(tparsertoptiontmsg((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pytraise_option_error&s cC@s<t||d}x"|dD]}|j|qW|S(s Return an OptionGroup object group -- assumed to be dict with 'name' and 'options' keys parser -- an optparse Parser tnametoptions(Rt add_option(tgroupRt option_groupR ((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pytmake_option_group5sc@sudkr|nfd}dddg}tt||rq|j}|jtjdddndS( sDisable 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. c@st|dS(N(tgetattrtNone(tn(t check_options(sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pytgetnameMst build_optionstglobal_optionstinstall_optionssbDisabling all use of wheels due to the use of --build-option / --global-option / --install-option.t stackleveliN(R*tanytmaptformat_controltdisallow_binariestwarningstwarn(R$R,R-tnamestcontrol((R,sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pytcheck_install_build_globalBs    cC@st|j|j|j|jg}ttdh}|j|koO|j }|rm|rmt dn|r|r|j rt dqndS(sFunction 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. s:all:sWhen 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:).sQCan not use any platform or abi specific options unless installing via '--target'N( R2tpython_versiontplatformtabitimplementationR tsetR4tignore_dependenciesRt target_dir(R$t check_targettdist_restriction_sett binary_onlytsdist_dependencies_allowed((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pytcheck_dist_restrictionZs   cC@stjj|S(N(tostpatht expanduser(R topttvalue((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pyt_path_option_checkst PipOptioncB@s.eZejdZejjZeed/src". The default for global installs is "/src".cC@st||jS(sGet a format_control object.(R)RS(RR ((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pyt_get_format_controlscC@s/t|j|}tj||j|jdS(N(RRR thandle_mutual_excludest no_binaryt only_binary(R RRKRtexisting((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pyt_handle_no_binaryscC@s/t|j|}tj||j|jdS(N(RRR RRR(R RRKRR((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pyt_handle_only_binaryscC@sCttt}tddddddtddd|d d S( Ns --no-binaryRSR4RURR`RiRXRTsvDo 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.(R R?RR(R4((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pyRs  cC@sCttt}tddddddtddd|d d S( Ns --only-binaryRSR4RURR`RiRXRTsKDo 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 R?RR(R4((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pyRs  s --platformR<s[Only use wheels compatible with . Defaults to the platform of the running system.cC@s|s d S|jd}t|dkr/d St|dkrw|d}t|dkrw|d|dg}qwnytd|D}Wntk rd SX|dfS(s 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. t.is'at most three version parts are allowediics@s|]}t|VqdS(N(Rl(t.0tpart((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pys ss$each version part must be an integerN(NN(((s'at most three version parts are allowed(((s$each version part must be an integer(R*Rtlenttuplet ValueError(RKtpartst version_info((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pyt_convert_python_versions  cC@sYt|\}}|dk rIdj||}t|d|d|n||j_dS(s3 Handle a provided --python-version value. s(invalid --python-version value: {!r}: {}R R!N(RR*RR"RR;(R RRKRRt error_msgR!((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pyt_handle_python_versions   s--python-versionR;s 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). s--implementationR>sOnly 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.s--abiR=sOnly 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.cC@sD|jt|jt|jt|jtdS(N(R%R<R;R>R=(tcmd_opts((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pytadd_target_python_optionsVsc C@s1td|jd|jd|jd|j}|S(NR<tpy_version_infoR=R>(R R<R;R=R>(R$t target_python((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pytmake_target_python^s     c C@s"tddddddtddS( Ns--prefer-binaryRSt prefer_binaryRURWRXRTs8Prefer older binary packages over newer source packages.(RtFalse(((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pyRjs s --cache-dirt cache_dirsStore the cache data in .cC@s_|dk rOyt|WqOtk rK}t|d|dt|qOXnt|j_dS(s Process a value provided for the --no-cache-dir option. This is an optparse.Option callback for the --no-cache-dir option. R R!N(R*RRR"RiRRR(R RJRKRtexc((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pyt_handle_no_cache_dirs # s--no-cache-dirsDisable the cache.s --no-depss--no-dependenciesR@s#Don't install package dependencies.cC@s5|rtjj|}nt|j|j|dS(N(RGRHRRRRS(R RJRKR((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pyt_handle_build_dirss-bs--builds --build-dirs--build-directoryt build_dirsK(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.s--ignore-requires-pythontignore_requires_pythons'Ignore the Requires-Python information.s--no-build-isolationtbuild_isolationt store_falsesDisable isolation when building a modern source distribution. Build dependencies specified by PEP 518 must be already installed if this option is used.cC@s;|dk r+d}t|d|d|nt|j_dS(s Process a value provided for the --no-use-pep517 option. This is an optparse.Option callback for the no_use_pep517 option. s0A 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!N(R*R"RRt use_pep517(R RJRKRR!((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pyt_handle_no_use_pep517s s --use-pep517Rs^Use PEP 517 for building source distributions (use --no-use-pep517 to force legacy behaviour).s--no-use-pep517s--install-optionR0RvR$s"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.s--global-optionR/sTExtra global options to be supplied to the setup.py call before the install command.s --no-cleans!Don't clean up build directories.s--presYInclude pre-release and development versions. By default, pip only finds stable versions.s--disable-pip-version-checktdisable_pip_version_checks{Don't periodically check PyPI to determine whether a new version of pip is available for download. Implied with --no-index.cC@s|jjsi|j_ny|jdd\}}Wn'tk r`|jdj|nX|tkr|jdj|djtn|jjj|gj |dS(skGiven a value spelled "algo:digest", append the digest to a list pointed to in a dict by the algo name.t:isTArguments to {} must be a hash name followed by a value, like --hash=sha256:abcde...s&Allowed hash algorithms for {} are {}.s, N( RthashesRRRRRRt setdefaultRv(R RRKRtalgotdigest((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pyt_handle_merge_hash9s     s--hashRtstringsgVerify that the package's archive matches this hash before installing. Example: --hash=sha256:abcdef...s--require-hashestrequire_hashessRequire 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.s--paths^Restrict to the specified installation path for listing packages (can be used multiple times).cC@s.|jr*|js|jr*tdndS(Ns2Cannot combine '--path' with '--user' or '--local'(RHtusertlocalR(R$((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pytcheck_list_path_optionpss--no-python-version-warningtno_python_version_warnings>Silence deprecation warnings for upcoming unsupported Pythons.s--unstable-featuretunstable_featurestfeaturetresolvers --use-featuretfeatures_enableds 2020-resolvers fast-depss<Enable new functionality, that may be backward incompatible.s--use-deprecatedtdeprecated_features_enabledsDEnable deprecated functionality, that will be removed in the future.sGeneral OptionsR#sPackage Index Options(zt__doc__t __future__RRGRR6tdistutils.utilRt functoolsRtoptparseRRRRtpip._internal.cli.progress_barsRtpip._internal.exceptionsRtpip._internal.locationsR R t#pip._internal.models.format_controlR tpip._internal.models.indexR t"pip._internal.models.target_pythonR tpip._internal.utils.hashesRtpip._internal.utils.typingRttypingRRRRRRRtpip._internal.cli.parserRR"R(R*R:RRFRLRMthelp_RVtrequire_virtualenvRZR\R]R^tlisttkeysRR_ReRgRhRkRnRpRwRxt simple_urlRyR|R}R~RRRRRtsrcRRRRRR<RRR;R>R=RRRRRtno_cachetno_depsRRRtTruetno_build_isolationRRt no_use_pep517R0R/tno_cleantpreRRthashRt list_pathRRtunstable_featuretuse_new_featuretuse_deprecated_featuret general_groupt index_group(((sM/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.pyts    (   (