Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/wheel/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/wheel/__pycache__/metadata.cpython-38.pyc
U

H��g�@s*dZddlmZddlZddlZddlZddlZddlZddl	m
Z
ddlmZddl
mZmZmZmZddlmZd	d
d�dd
�Zejddd�dd��Ze�e�d	dd�dd��Zddd�dd�Zd	d	d�dd�Zd	d	d�dd �Zd!d	d"�d#d$�Zd%dd&�d'd(�Zd)d*d+�d,d-�Zd	d	d.d/�d0d1�Z dS)2z2
Tools for converting old- to new-style metadata.
�)�annotationsN)�Message)�Parser)�	Generator�Iterable�Iterator�Literal�)�Requirement�strzbool | Literal[''])r�returncCs|o|�d�S)N�#)�
startswith)r�r�;/opt/cppython/lib/python3.8/site-packages/wheel/metadata.py�	_nonblanksrz
Iterable[str]z
Iterator[str])�iterablercCstj�tt|��S)a�
    Yield valid lines of a string or iterable.
    >>> list(yield_lines(''))
    []
    >>> list(yield_lines(['foo', 'bar']))
    ['foo', 'bar']
    >>> list(yield_lines('foo\nbar'))
    ['foo', 'bar']
    >>> list(yield_lines('\nfoo\n#bar\nbaz #comment'))
    ['foo', 'baz #comment']
    >>> list(yield_lines(['foo\nbar', 'baz', 'bing\n\n\n']))
    ['foo', 'bar', 'baz', 'bing']
    )�	itertools�chain�
from_iterable�map�yield_lines)rrrrrsr)�textrcCsttttj|����S�N)�filterrrr�strip�
splitlines)rrrr�_)srzstr | Iterator[str]z3Generator[tuple[str | None, list[str]], None, None])�srccsvd}g}t|�D]V}|�d�r\|�d�rP|s0|r:||fV|dd���}g}qftd|��q|�|�q||fVdS)arSplit a string or iterable thereof into (section, content) pairs
    Each ``section`` is a stripped version of the section header ("[section]")
    and each ``content`` is a list of stripped lines excluding blank lines and
    comment-only lines.  If there are any such lines before the first section
    header, they're returned in a first ``section`` of ``None``.
    N�[�]r	���zInvalid section heading)rr�endswithr�
ValueError�append)r�section�content�linerrr�split_sections.s	


r()�extrarcCst�dd|���S)z�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.
    z[^A-Za-z0-9.-]+r)�re�sub�lower)r)rrr�
safe_extraIsr-)�namercCst�dd|�S)z�Convert an arbitrary string to a standard distribution name
    Any runs of non-alphanumeric/. characters are replaced with a single '-'.
    z[^A-Za-z0-9.]+�-)r*r+)r.rrr�	safe_nameQsr0r
)�requirementrcCsP|jrd|jSg}|jD]}|�|j|j�q|rHdd�t|��SdSdS)zFReturn the version specifier for a requirement in PEP 345/566 fashion.z @ � �,�N)�url�	specifierr$�operator�version�join�sorted)r1Z
requires_dist�specrrr�requires_to_requires_distXs

r<z	list[str])�requirementsrccs\|D]R}t|�}t|�}d�tdd�|jD���}|rBd|�d�}t|j�||VqdS)z=Yield Requires-Dist: strings for parsed requirements strings.r3css|]}t|�VqdSr)r-)�.0�errr�	<genexpr>lsz'convert_requirements.<locals>.<genexpr>rr N)r
r<r9r:�extrasr0r.)r=�req�parsed_requirementr;rArrr�convert_requirementsgsrDzdict[str | None, list[str]]zIterator[tuple[str, str]])�extras_requirerccs�|��D]�\}}d}|pd}d|kr4|�dd�\}}t|�}|rjd|fV|rZd|d}|d|�d�7}|rvd	|}t|�D]}tt||��}d
|fVq~qdS)a,
    Convert requirements from a setup()-style dictionary to
    ('Requires-Dist', 'requirement') and ('Provides-Extra', 'extra') tuples.

    extras_require is a dictionary of {extra: [requirements]} as passed to setup(),
    using the empty extra {'': [requirements]} to hold install_requires.
    r4�:r	�Provides-Extra�(z) and z
extra == '�'z ; �
Requires-DistN)�items�splitr-rDrr
)rEr)�depends�	conditionZnew_reqZ
canonical_reqrrr�generate_requirementsss 

rOr)�
egg_info_path�pkginfo_pathrc
Cs t|dd��}t��|�}W5QRX|�dd�|d=|d=tj�|d�}tj�|�r�t|dd��}|��}W5QRXt	t
|�dd	�d
�}|D]6\}}	t||	i�D] \}
}|
|f|��kr�|||
<q�q�|d}|�r|d�
�}
d�|
d
��t�d�|
dd���df�}|�|�|d=|S)zN
    Convert .egg-info directory with PKG-INFO to the Metadata 2.1 format
    zutf-8)�encodingzMetadata-Versionz2.1rGrJzrequires.txtcSs|dp
dS)Nrr4r)�xrrr�<lambda>��z%pkginfo_to_metadata.<locals>.<lambda>)�key�Description�
rr	N)�openr�parse�replace_header�os�pathr9�exists�readr:r(rOrKr�lstrip�textwrap�dedent�set_payload)rPrQ�headers�pkg_infoZ
requires_pathZ
requires_file�requiresZparsed_requirementsr)�reqsrV�value�descriptionZdescription_linesZdedented_descriptionrrr�pkginfo_to_metadata�s4
��	
rj)!�__doc__�
__future__r�	functoolsr�os.pathr\r*ra�
email.messager�email.parserr�typingrrrrZvendored.packaging.requirementsr
r�singledispatchr�registerrrr(r-r0r<rDrOrjrrrr�<module>s,

F1le Man4ger