관리-도구
편집 파일: packaging.cpython-37.pyc
B ��Re� � @ s� d dl mZ d dlZd dlmZ d dlmZ d dlmZm Z d dl mZ d dlm Z d dlmZ er�d d lmZmZ d d lmZ d dlmZ e�e�Zdd � Zdd� Zdd� Zdd� ZdS )� )�absolute_importN)� FeedParser)� pkg_resources)� specifiers�version)�NoneMetadataError)�display_path)�MYPY_CHECK_RUNNING)�Optional�Tuple)�Message)�Distributionc C s4 | dkrdS t �| �}t�d�tt|���}||kS )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)�requires_python�version_info�requires_python_specifier�python_version� r ��/builddir/build/BUILDROOT/alt-python37-pip-20.2.4-6.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/pip/_internal/utils/packaging.py�check_requires_python s r c C s� d}t | tj�r&| �|�r&| �|�}n0| �d�r@d}| �|�}nt�dt| j�� d}|dkrht | |��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)�dist� metadata_name�metadata�feed_parserr r r r , s r c C s&