a
    |Ä#d¸  ã                   @   s  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m	Z	 d dl
mZ ddlmZmZmZmZmZ ervd dlmZ neZg d¢Zedœd	d
„ZG dd„ deƒZejdd�edœdd„ƒZedœdd„Zeee  edœdd„Zeedœdd„Zeeedœdd„Zeeeedœdd„Z dS )é    N)ÚTYPE_CHECKINGÚListÚOptionalÚTypeÚcast)Ú	strtoboolé   )ÚBaseDistributionÚBaseEnvironmentÚFilesystemWheelÚMemoryWheelÚWheel)ÚProtocol)	r	   r
   r   r   r   Úget_default_environmentÚget_environmentÚget_wheel_distributionÚselect_backend)Úreturnc                  C   sf   t  tt¡�" tttjd ƒƒW  d  ƒ S 1 s40    Y  tj	dk rLd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_resourcess`` otherwise. 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, regardless of Python
      version.
    * On Python 3.11+, 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*).
    Ú_PIP_USE_IMPORTLIB_METADATAN)é   é   Fr   T)Ú
contextlibÚsuppressÚKeyErrorÚ
ValueErrorÚboolr   ÚosÚenvironÚsysÚversion_infoÚimportlib.metadataÚgetattrÚmetadata©Ú	importlib© r%   úV/var/www/html/gsl.tools/lib/python3.9/site-packages/pip/_internal/metadata/__init__.pyÚ_should_use_importlib_metadata   s    0
r'   c                   @   s&   e Zd ZU ee ed< ee ed< dS )ÚBackendÚDistributionÚEnvironmentN)Ú__name__Ú
__module__Ú__qualname__r   r	   Ú__annotations__r
   r%   r%   r%   r&   r(   4   s   
r(   )Úmaxsizec                  C   s2   t ƒ rddlm}  tt| ƒS ddlm} tt|ƒS )Nr   r#   )Úpkg_resources)r'   Ú r$   r   r(   r0   )r$   r0   r%   r%   r&   r   9   s
    
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 accorss calls.
    )r   r*   Údefaultr%   r%   r%   r&   r   D   s    r   )Úpathsr   c                 C   s   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   r*   Ú
from_paths)r3   r%   r%   r&   r   N   s    r   )Ú	directoryr   c                 C   s   t ƒ j | ¡S )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   r)   Úfrom_directory)r5   r%   r%   r&   Úget_directory_distributionX   s    r7   )ÚwheelÚ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   r)   Ú
from_wheel)r8   r9   r%   r%   r&   r   a   s    r   )Úmetadata_contentsÚfilenamer9   r   c                 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   r)   Úfrom_metadata_file_contents)r;   r<   r9   r%   r%   r&   Úget_metadata_distributionl   s
    ýr>   )!r   Ú	functoolsr   r   Útypingr   r   r   r   r   Úpip._internal.utils.miscr   Úbaser	   r
   r   r   r   r   ÚobjectÚ__all__r   r'   r(   Ú	lru_cacher   r   Ústrr   r7   r   Úbytesr>   r%   r%   r%   r&   Ú<module>   s.   



	ü