Oe[ ddlmZddlZddlZddlZddlZddlmZmZm Z m Z ddl m Z ddl mZddlmZmZmZmZmZerddlmZgd Zd$d Zd%dZGdde Zejd&dZd'dZd(dZd)dZd*dZ d+d#Z!dS),) annotationsN) TYPE_CHECKINGLiteralProtocolcast) deprecated) strtobool)BaseDistributionBaseEnvironmentFilesystemWheel MemoryWheelWheel)NormalizedName) r r r rrget_default_environmentget_environmentget_wheel_distributionselect_backendreturnboolc^tjdkrdStjtt 5t ttj dcdddS#1swxYwYtjdkrdSddl }t t|j ddS)aWhether to use the ``importlib.metadata`` or ``pkg_resources`` backend. By default, pip uses ``importlib.metadata`` on Python 3.11+, and ``pkg_resources`` otherwise. Up to Python 3.13, This can be overridden by a couple of ways: * If environment variable ``_PIP_USE_IMPORTLIB_METADATA`` is set, it dictates whether ``importlib.metadata`` is used, for Python <3.14. * On Python 3.11, 3.12 and 3.13, Python distributors can patch ``importlib.metadata`` to add a global constant ``_PIP_USE_IMPORTLIB_METADATA = False``. This makes pip use ``pkg_resources`` (unless the user set the aforementioned environment variable to *True*). On Python 3.14+, the ``pkg_resources`` backend cannot be used. )T_PIP_USE_IMPORTLIB_METADATANr Fr) sys version_info contextlibsuppressKeyError ValueErrorrr osenvironimportlib.metadatagetattrmetadata importlibs q/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pip/_internal/metadata/__init__.py_should_use_importlib_metadatar+s" 7""t  Xz 2 2JJIbj)FGHHIIJJJJJJJJJJJJJJJJ '!!u  *,I4PP Q QQs,A++A/2A/NonectjdkrdSddl}t|jdrdSt dddddS) Nrrrz7Using the pkg_resources metadata backend is deprecated.zpto use the default importlib.metadata backend, by unsetting the _PIP_USE_IMPORTLIB_METADATA environment variablez26.3i4)reason replacementgone_inissue)rrr%hasattrr'rr(s r*)_emit_pkg_resources_deprecation_if_neededr3?st '!! y!#@AA H Pc.eZdZUded<ded<ded<dS)Backendz%Literal['importlib', 'pkg_resources']NAMEztype[BaseDistribution] Distributionztype[BaseEnvironment] EnvironmentN)__name__ __module__ __qualname____annotations__r4r*r6r6Xs6////((((&&&&&&r4r6ctrddlm}tt|St ddlm}tt|S)Nr r() pkg_resources)r+r)rr6r3r@)r)r@s r*rr^s`%''(GY'''-///  ' ''r4r cLtjS)aGet the default representation for the current environment. This returns an Environment instance from the chosen backend. The default Environment instance should be built from ``sys.path`` and may use caching to share instance state across calls. )rr9defaultr>r4r*rrls    ' / / 1 11r4pathslist[str] | NonecNtj|S)a'Get a representation of the environment specified by ``paths``. This returns an Environment instance from the chosen backend based on the given import paths. The backend must build a fresh instance representing the state of installed distributions when this function is called. )rr9 from_paths)rDs r*rrvs!    ' 2 25 9 99r4 directorystrr cNtj|S)zGet the distribution metadata representation in the specified directory. This returns a Distribution instance from the chosen backend based on the given on-disk ``.dist-info`` directory. )rr8from_directory)rHs r*get_directory_distributionrLs!    ( 7 7 B BBr4wheelrcanonical_namercPtj||S)aGet the representation of the specified wheel's distribution metadata. This returns a Distribution instance from the chosen backend based on the given wheel's ``.dist-info`` directory. :param canonical_name: Normalized project name of the given wheel. )rr8 from_wheel)rMrNs r*rrs#    ( 3 3E> J JJr4metadata_contentsbytesfilenamecRtj|||S)aGet the dist representation of the specified METADATA file contents. This returns a Distribution instance from the chosen backend sourced from the data in `metadata_contents`. :param metadata_contents: Contents of a METADATA file within a dist, or one served via PEP 658. :param filename: Filename for the dist this metadata represents. :param canonical_name: Normalized project name of the given dist. )rr8from_metadata_file_contents)rQrSrNs r*get_metadata_distributionrVs.    ( D D  r4)rr)rr,)rr6)rr )rDrErr )rHrIrr )rMrrNrrr )rQrRrSrIrNrIrr )" __future__rr functoolsr#rtypingrrrrpip._internal.utils.deprecationrpip._internal.utils.miscr baser r r rrpip._vendor.packaging.utilsr__all__r+r3r6cacherrrrLrrVr>r4r*r`s"""""" 999999999999666666......XXXXXXXXXXXXXX;::::::   RRRRB2'''''h'''   ( ( ( (2222::::CCCC K K K Kr4