
    Ki                       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rd dlmZ g d	Zd$dZd%dZ G d de	          Zej        d&d            Zd'dZd(dZd)dZd*dZ d+d#Z!dS ),    )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                 ^   t           j        dk    rdS t          j        t          t
                    5  t          t          t          j	        d                             cddd           S # 1 swxY 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	importlibs    W/srv/django_bis/venv311/lib/python3.11/site-packages/pip/_internal/metadata/__init__.py_should_use_importlib_metadatar+      s    " 7""t		Xz	2	2 J JIbj)FGHHIIJ J J J J J J J J J J J J J J J '!! u	*,I4PPQQQs   ,A++A/2A/Nonec                     t           j        dk     rd S dd l} t          | j        d          rd S t          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(   s    r*   )_emit_pkg_resources_deprecation_if_neededr3   ?   st    
'!! 	y!#@AA  	 HP          c                  .    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__ r4   r*   r6   r6   X   s6         ////((((&&&&&&r4   r6   c                     t                      rddlm}  t          t          |           S t                       ddlm} t          t          |          S )Nr
   r(   )pkg_resources)r+    r)   r   r6   r3   r@   )r)   r@   s     r*   r   r   ^   s`    %'' (GY'''-///'''r4   r   c                 L    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   r9   defaultr>   r4   r*   r   r   l   s     '//111r4   pathslist[str] | Nonec                N    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   r9   
from_paths)rD   s    r*   r   r   v   s!     '225999r4   	directorystrr   c                N    t                      j                            |           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.
    )r   r8   from_directory)rH   s    r*   get_directory_distributionrL      s!     (77	BBBr4   wheelr   canonical_namer   c                P    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   r8   
from_wheel)rM   rN   s     r*   r   r      s#     (33E>JJJr4   metadata_contentsbytesfilenamec                R    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   r8   from_metadata_file_contents)rQ   rS   rN   s      r*   get_metadata_distributionrV      s.     (DD  r4   )r   r   )r   r,   )r   r6   )r   r   )rD   rE   r   r   )rH   rI   r   r   )rM   r   rN   r   r   r   )rQ   rR   rS   rI   rN   rI   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+   r3   r6   cacher   r   r   rL   r   rV   r>   r4   r*   <module>r`      s   " " " " " "         				 



 9 9 9 9 9 9 9 9 9 9 9 9 6 6 6 6 6 6 . . . . . . X X X X X X X X X X X X X X ;::::::
 
 
R R R RB   2' ' ' ' 'h ' ' ' 
( 
( 
( 
(2 2 2 2: : : :C C C C
K 
K 
K 
K     r4   