관리-도구
편집 파일: packaging.cpython-311.pyc
� �Re� � �8 � d dl Z d dlZd dlmZ d dlmZ d dlmZmZ d dl m Z d dlmZm Z d dlmZ d dlmZ d d lmZ d d lmZ ej e� � Zdee deed f defd�Zdedefd�Zdedefd�Z e j d�� � dedefd�� � Z dS )� N)�Message)� FeedParser)�Optional�Tuple)� pkg_resources)� specifiers�version��Requirement)�Distribution)�NoneMetadataError)�display_path�requires_python�version_info.�returnc � � | �dS t j | � � }t j 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_versions ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/utils/packaging.py�check_requires_pythonr sQ � � ���t� *� 7�� H� H���]�3�8�8�C��\�,B�,B�#C�#C�D�D�N��6�6�6� �distc �� � d}t | t j � � r+| � |� � r| � |� � }n\| � d� � rd}| � |� � }n/t � dt | j � � � � d}|�t | |� � �t � � }|� |� � |� � � S )z� :raises NoneMetadataError: if the distribution reports `has_metadata()` True but `get_metadata()` returns None. �METADATAzPKG-INFOzNo metadata found in %s� ) � isinstancer �DistInfoDistribution�has_metadata�get_metadata�logger�warningr �locationr r �feed�close)r � metadata_name�metadata�feed_parsers r r% r% ) s� � � �M��$� �:�;�;� ��@Q�@Q��A� A� � �$�$�]�3�3��� � � �:� &� &� �"� ��$�$�]�3�3������0�,�t�}�2M�2M�N�N�N�������m�4�4�4��,�,�K� ���X���������r c � � | � d� � rB| � d� � D ],}|� � � r|� � � c S �-dS )N� INSTALLERr! )r$ �get_metadata_lines�strip)r �lines r � get_installerr3 D sc � �����%�%� $��+�+�K�8�8� $� $�D��z�z�|�|� $��z�z�|�|�#�#�#� $� �2r i )�maxsize� req_stringc � � t | � � S )z5Construct a packaging.Requirement object with cachingr )r5 s r �get_requirementr7 L s � � �z�"�"�"r )!� functools�logging� email.messager �email.parserr �typingr r �pip._vendorr �pip._vendor.packagingr r �"pip._vendor.packaging.requirementsr �pip._vendor.pkg_resourcesr �pip._internal.exceptionsr �pip._internal.utils.miscr � getLogger�__name__r&