o
    Ëý°j<  ã                   @   s¶   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	m
Z
 d dlmZ edeƒZe e¡Zdee deedf d	efd
d„Ze jdd�ded	efdd„ƒZded	efdd„ZdS )é    N)ÚNewTypeÚOptionalÚTupleÚcast)Ú
specifiersÚversion©ÚRequirementÚNormalizedExtraÚrequires_pythonÚversion_info.Úreturnc                 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   ú�/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/pip/_internal/utils/packaging.pyÚcheck_requires_python   s
   
r   i   )ÚmaxsizeÚ
req_stringc                 C   s   t | ƒS )z5Construct a packaging.Requirement object with cachingr   )r   r   r   r   Úget_requirement%   s   r   Úextrac                 C   s   t tt dd| ¡ ¡ ƒS )aD  Convert an arbitrary string to a standard 'extra' name

    Any runs of non-alphanumeric characters are replaced with a single '_',
    and the result is always lowercased.

    This function is duplicated from ``pkg_resources``. Note that this is not
    the same to either ``canonicalize_name`` or ``_egg_link_name``.
    z[^A-Za-z0-9.-]+Ú_)r   r
   ÚreÚsubÚlower)r   r   r   r   Ú
safe_extra0   s   	r!   )Ú	functoolsÚloggingr   Útypingr   r   r   r   Úpip._vendor.packagingr   r   Ú"pip._vendor.packaging.requirementsr	   r   r
   Ú	getLoggerÚ__name__ÚloggerÚintÚboolr   Ú	lru_cacher   r!   r   r   r   r   Ú<module>   s$    

ÿ
ÿ
þ

