관리-도구
편집 파일: packaging.cpython-39.pyc
a ��Re� � @ s� 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 e�e�Zee eedf ed�d d�Zeed�dd�Zeed�dd�Ze jdd�eed�dd��Z dS )� N)�Message)� FeedParser)�Optional�Tuple)� pkg_resources)� specifiers�version��Requirement)�Distribution)�NoneMetadataError)�display_path.)�requires_python�version_info�returnc C s4 | du rdS t �| �}t�d�tt|���}||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 ��/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_internal/utils/packaging.py�check_requires_python s r )�distr c C s� d}t | tj�r&| �|�r&| �|�}n0| �d�r@d}| �|�}nt�dt| j�� d}|du rht | |��t � }|�|� |�� S )z� :raises NoneMetadataError: if the distribution reports `has_metadata()` True but `get_metadata()` returns None. �METADATAzPKG-INFOzNo metadata found in %s� N) � isinstancer �DistInfoDistribution�has_metadata�get_metadata�logger�warningr �locationr r �feed�close)r � metadata_name�metadata�feed_parserr r r r"