관리-도구
편집 파일: packaging.cpython-310.pyc
o ƚ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�Zdee deed f defdd�Zdedefdd�Zdedefdd�Ze jdd�dedefdd��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-python310-pip-21.3.1-3.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_internal/utils/packaging.py�check_requires_python s r �distc C s� d}t | tj�r| �|�r| �|�}n| �d�r d}| �|�}nt�dt| j�� d}|du r4t | |��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"