o
    ~îj·  ã                   @  s„   d dl mZ d dlZd dlZd dlZd dlmZmZ d dlm	Z	 e 
e¡Zejdd�ddd„ƒZejdd�ddd„ƒZddd„ZdS )é    )ÚannotationsN)Ú
specifiersÚversion©ÚRequirementé    )ÚmaxsizeÚrequires_pythonú
str | NoneÚversion_infoútuple[int, ...]ÚreturnÚboolc                 C  s4   | du rdS t  | ¡}t d tt|ƒ¡¡}||v S )a˜  
    Check if the given Python version matches a "Requires-Python" specifier.

    :param version_info: A 3-tuple of ints representing a Python
        major-minor-micro version to check (e.g. `sys.version_info[:3]`).

    :return: `True` if the given Python version satisfies the requirement.
        Otherwise, return `False`.

    :raises InvalidSpecifier: If `requires_python` has an invalid format.
    NTÚ.)r   ÚSpecifierSetr   ÚparseÚjoinÚmapÚstr)r	   r   Úrequires_python_specifierÚpython_version© r   úg/raid/bulk_storage/M2HATS/real-image-venv/lib/python3.10/site-packages/pip/_internal/utils/packaging.pyÚcheck_requires_python   s
   
r   i'  Ú
req_stringr   r   c                 C  s   t | ƒS )z5Construct a packaging.Requirement object with cachingr   )r   r   r   r   Úget_requirement%   s   r   Úreqc                 C  s   t   | ¡}d|_|S )zÏReturn a copy of ``req`` with its environment marker removed.

    Intended for error messages. The original is left unchanged, which
    matters because ``get_requirement`` caches and shares instances.
    N)ÚcopyÚmarker)r   Ústrippedr   r   r   Úrequirement_without_marker0   s   
r    )r	   r
   r   r   r   r   )r   r   r   r   )r   r   r   r   )Ú
__future__r   r   Ú	functoolsÚloggingÚpip._vendor.packagingr   r   Ú"pip._vendor.packaging.requirementsr   Ú	getLoggerÚ__name__ÚloggerÚ	lru_cacher   r   r    r   r   r   r   Ú<module>   s    



