
    h
                     0   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
mZ  G d de      Z G d de      Zdej                  j                   d	ee   fd
Zdej                  j                   d	eee   ee   f   fdZdej                  j                   d	e
fdZy)    N)AnyOptionalProtocolTuplecast)NormalizedNamecanonicalize_namec                   T    e Zd Zdej                  j
                  deddfdZdefdZy)BadMetadatadistreasonreturnNc                     || _         || _        y Nr   r   )selfr   r   s      QD:\EasyAligner\venv\Lib\site-packages\pip/_internal/metadata/importlib/_compat.py__init__zBadMetadata.__init__	   s    	    c                 <    d| j                    d| j                   dS )NzBad metadata in z ()r   r   s    r   __str__zBadMetadata.__str__   s    !$))Bt{{m1==r   )	__name__
__module____qualname__	importlibmetadataDistributionstrr   r    r   r   r   r      s5    Y//<<  QU > >r   r   c                   8    e Zd ZdZedefd       Zedd       Zy)BasePatha  A protocol that various path objects conform.

    This exists because importlib.metadata uses both ``pathlib.Path`` and
    ``zipfile.Path``, and we need a common base for type hints (Union does not
    work well since ``zipfile.Path`` is too new for our linter setup).

    This does not mean to be exhaustive, but only contains things that present
    in both classes *that we need*.
    r   c                     t               r   NotImplementedErrorr   s    r   namezBasePath.name       !##r   c                     t               r   r%   r   s    r   parentzBasePath.parent    r(   r   N)r   r#   )r   r   r   __doc__propertyr    r'   r*   r!   r   r   r#   r#      s6     $c $ $ $ $r   r#   dr   c                     t        | dd      S )a  Find the path to the distribution's metadata directory.

    HACK: This relies on importlib.metadata's private ``_path`` attribute. Not
    all distributions exist on disk, so importlib.metadata is correct to not
    expose the attribute as public. But pip's code base is old and not as clean,
    so we do this to avoid having to rewrite too many things. Hopefully we can
    eliminate this some day.
    _pathN)getattr)r-   s    r   get_info_locationr1   %   s     1gt$$r   r   c                     t        |       }|yt        j                  j                  |j                        \  }}|dk(  r|j                  d      \  }}}|r||fS |dk(  r|j                  dd      d   }|dfS y)zzGet a name and version from the metadata directory name.

    This is much faster than reading distribution metadata.
    N)NNz
.dist-info-z	.egg-info   r   )r1   ospathsplitextr'   	partitionsplit)r   info_locationstemsuffixr'   sepversions          r   *parse_name_and_version_from_info_directoryr?   1   s     &d+M77##M$6$67LD&!^^C0c7= zz#q!!$Tzr   c                     t        |       d   x}rt        |      S t        t        |       j                  }t        |t              st        | d      t        |      S )zGet the distribution's normalized name.

    The ``name`` attribute is only available in Python 3.10 or later. We are
    targeting exactly that, but Mypy does not know this.
    r   zinvalid metadata entry 'name')r   )r?   r	   r   r   r'   
isinstancer    r   )r   r'   s     r   get_dist_canonical_namerB   I   sX     :$?BBtB &&T?DdC $'FGGT""r   )importlib.metadatar   r5   typingr   r   r   r   r   pip._vendor.packaging.utilsr   r	   
ValueErrorr   r#   r   r   r1   r    r?   rB   r!   r   r   <module>rG      s     	 7 7 I>* >$x $(	%++88 	%Xh=O 	%



)
)
8C=(3-'(0#)"4"4"A"A #n #r   