o
    6‘ðiÀ  ã                   @  sú   d dl mZ d dlZd dlZd dlZd dlZd dlmZmZm	Z	m
Z
 d dlmZ d dlmZ ddlmZmZmZmZmZ erDd dlmZ g d	¢Zd,dd„Zd-dd„ZG dd„ de	ƒZejd.dd„ƒZd/dd„Zd0dd„Zd1dd „Zd2d%d&„Z d3d*d+„Z!dS )4é    )ÚannotationsN)ÚTYPE_CHECKINGÚLiteralÚProtocolÚcast)Ú
deprecated)Ú	strtoboolé   )ÚBaseDistributionÚBaseEnvironmentÚFilesystemWheelÚMemoryWheelÚWheel)ÚNormalizedName)	r
   r   r   r   r   Úget_default_environmentÚget_environmentÚget_wheel_distributionÚselect_backendÚreturnÚboolc                  C  st   t jdkrdS t tt¡� tttj	d ƒƒW  d  ƒ S 1 s!w   Y  t jdk r-dS ddl
} tt| jddƒƒS )aï  Whether 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_METADATAN©r   é   Fr   )ÚsysÚversion_infoÚ
contextlibÚsuppressÚKeyErrorÚ
ValueErrorr   r   ÚosÚenvironÚimportlib.metadataÚgetattrÚmetadata©Ú	importlib© r(   ú^/root/parts/websockify/install/lib/python3.10/site-packages/pip/_internal/metadata/__init__.pyÚ_should_use_importlib_metadata   s   
 þ
r*   ÚNonec                  C  s:   t jdk rd S dd l} t| jdƒrd S tddddd� d S )	Nr   r   r   z7Using the pkg_resources metadata backend is deprecated.zpto use the default importlib.metadata backend, by unsetting the _PIP_USE_IMPORTLIB_METADATA environment variablez26.3i4  )ÚreasonÚreplacementÚgone_inÚissue)r   r   r#   Úhasattrr%   r   r&   r(   r(   r)   Ú)_emit_pkg_resources_deprecation_if_needed?   s   

ùr1   c                   @  s&   e Zd ZU ded< ded< ded< dS )ÚBackendz%Literal['importlib', 'pkg_resources']ÚNAMEztype[BaseDistribution]ÚDistributionztype[BaseEnvironment]ÚEnvironmentN)Ú__name__Ú
__module__Ú__qualname__Ú__annotations__r(   r(   r(   r)   r2   X   s   
 r2   c                  C  s8   t ƒ rddlm}  tt| ƒS tƒ  ddlm} tt|ƒS )Nr	   r&   )Úpkg_resources)r*   Ú r'   r   r2   r1   r:   )r'   r:   r(   r(   r)   r   ^   s   

r   r   c                   C  s   t ƒ j ¡ S )a  Get 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.
    )r   r5   Údefaultr(   r(   r(   r)   r   l   s   r   Úpathsúlist[str] | Nonec                 C  ó   t ƒ j | ¡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.
    )r   r5   Ú
from_paths)r=   r(   r(   r)   r   v   s   r   Ú	directoryÚstrr
   c                 C  r?   )zÈGet 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.
    )r   r4   Úfrom_directory)rA   r(   r(   r)   Úget_directory_distribution€   s   rD   Úwheelr   Úcanonical_namer   c                 C  s   t ƒ j | |¡S )a  Get 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.
    )r   r4   Ú
from_wheel)rE   rF   r(   r(   r)   r   ‰   s   
r   Úmetadata_contentsÚbytesÚfilenamec                 C  s   t ƒ j | ||¡S )aË  Get 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.
    )r   r4   Úfrom_metadata_file_contents)rH   rJ   rF   r(   r(   r)   Úget_metadata_distribution–   s
   ýrL   )r   r   )r   r+   )r   r2   )r   r   )r=   r>   r   r   )rA   rB   r   r
   )rE   r   rF   r   r   r
   )rH   rI   rJ   rB   rF   rB   r   r
   )"Ú
__future__r   r   Ú	functoolsr!   r   Útypingr   r   r   r   Úpip._internal.utils.deprecationr   Úpip._internal.utils.miscr   Úbaser
   r   r   r   r   Úpip._vendor.packaging.utilsr   Ú__all__r*   r1   r2   Úcacher   r   r   rD   r   rL   r(   r(   r(   r)   Ú<module>   s,    

!





	