CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
metadata.cpython-310.pyc73 linesDownload Raw Back to __pycache__
1o

2��Yi�@s�dZddlmZddlZddlZddlZddlZddlZddl	m3Z4ddlmZddl
mZmZmZmZddlmZd3dd
�Zejd4dd��Ze�e�d5dd��Zd6dd�Zd7dd�Zd8dd �Zd9d#d$�Zd:d'd(�Zd;d,d-�Zd<d1d2�Z dS)=z25Tools for converting old- to new-style metadata.6�)�annotationsN)�Message)�Parser)�	Generator�Iterable�Iterator�Literal�)�Requirement�str�return�bool | Literal['']cCs|o|�d�S)N�#)�7startswith)r�r�xE:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\wheel/metadata.py�	_nonblanksr�iterable�
Iterable[str]�
Iterator[str]cCstj�tt|��S)a�8    Yield valid lines of a string or iterable.9    >>> list(yield_lines(''))10    []11    >>> list(yield_lines(['foo', 'bar']))12    ['foo', 'bar']13    >>> list(yield_lines('foo\nbar'))14    ['foo', 'bar']15    >>> list(yield_lines('\nfoo\n#bar\nbaz #comment'))16    ['foo', 'baz #comment']17    >>> list(yield_lines(['foo\nbar', 'baz', 'bing\n\n\n']))18    ['foo', 'bar', 'baz', 'bing']19    )�	itertools�chain�
from_iterable�map�yield_lines)rrrrrsr�textcCsttttj|����S�N)�filterrrr�strip�20splitlines)rrrr�_)sr �s�str | Iterator[str]�3Generator[tuple[str | None, list[str]], None, None]ccsv�d}g}t|�D]*}|�d�r.|�d�r)|s|r||fV|dd���}g}q	td|��|�|�q	||fVdS)arSplit a string or iterable thereof into (section, content) pairs21    Each ``section`` is a stripped version of the section header ("[section]")22    and each ``content`` is a list of stripped lines excluding blank lines and23    comment-only lines.  If there are any such lines before the first section24    header, they're returned in a first ``section`` of ``None``.25    N�[�]r	�����zInvalid section heading)rr�endswithr�26ValueError�append)r!�section�content�linerrr�split_sections.s�	27282930r-�extracCst�dd|���S)z�Convert an arbitrary string to a standard 'extra' name31    Any runs of non-alphanumeric characters are replaced with a single '_',32    and the result is always lowercased.33    z[^A-Za-z0-9.-]+r )�re�sub�lower)r.rrr�34safe_extraIsr2�namecCst�dd|�S)z�Convert an arbitrary string to a standard distribution name35    Any runs of non-alphanumeric/. characters are replaced with a single '-'.36    z[^A-Za-z0-9.]+�-)r/r0)r3rrr�	safe_nameQsr5�requirementr37cCsL|jrd|jSg}|jD]}|�|j|j�q
|r$dd�t|��SdS)zFReturn the version specifier for a requirement in PEP 345/566 fashion.z @ � �,�)�url�	specifierr)�operator�version�join�sorted)r6Z
requires_dist�specrrr�requires_to_requires_distXs3839rA�requirements�	list[str]ccs^�|D])}t|�}t|�}d�tdd�|jD���}|r"d|�d�}t|j�||VqdS)z=Yield Requires-Dist: strings for parsed requirements strings.r8css�|]}t|�VqdSr)r2)�.0�errr�	<genexpr>ls�z'convert_requirements.<locals>.<genexpr>r$r%N)r40rAr>r?�extrasr5r3)rB�req�parsed_requirementr@rGrrr�convert_requirementsgs��rJ�extras_require�dict[str | None, list[str]]�Iterator[tuple[str, str]]ccs��|��D]K\}}d}|pd}d|vr|�dd�\}}t|�}|r6d|fV|r.d|d}|d|�d�7}|r<d	|}t|�D]}tt||��}d41|fVq@qdS)a,42    Convert requirements from a setup()-style dictionary to43    ('Requires-Dist', 'requirement') and ('Provides-Extra', 'extra') tuples.44 45    extras_require is a dictionary of {extra: [requirements]} as passed to setup(),46    using the empty extra {'': [requirements]} to hold install_requires.47    r9�:r	�Provides-Extra�(z) and z48extra == '�'z ; �
Requires-DistN)�items�splitr2rJrr49)rKr.Zdepends�	conditionZnew_reqZ
canonical_reqrrr�generate_requirementsss&�5051��rV�
egg_info_path�pkginfo_pathrc52CsFt|dd��}t��|�}Wd�n1swY|�dd�|d=|d=tj�|d�}tj�|�rwt|dd��}|��}Wd�n1sJwYt	t53|�d	d54�d�}|D]\}}	t||	i�D]\}55}|56|f|��vru|||57<qeq[|d}|r�|d�
�}
d
�|
d��t�d
�|
dd���d
f�}|�|�|d=|S)zN58    Convert .egg-info directory with PKG-INFO to the Metadata 2.1 format59    zutf-8)�encodingNzMetadata-Versionz2.1rOrRzrequires.txtcSs|dpdS)Nrr9r)�xrrr�<lambda>�sz%pkginfo_to_metadata.<locals>.<lambda>)�key�Description�60rr	)�openr�parse�replace_header�os�pathr>�exists�readr?r-rVrSr�lstrip�textwrap�dedent�set_payload)rWrX�headersZpkg_infoZ
requires_pathZ
requires_file�requiresZparsed_requirementsr.�reqsr\�value�descriptionZdescription_linesZdedented_descriptionrrr�pkginfo_to_metadata�s<�61���62��63	ro)rrrr
)rrrr)rrrr)r!r"rr#)r.rrr)r3rrr)r6r64rr)rBrCrr)rKrLrrM)rWrrXrrr)!�__doc__�65__future__r�	functoolsr�os.pathrbr/rg�
email.messager�email.parserr�typingrrrrZvendored.packaging.requirementsr66r�singledispatchr�registerrr r-r2r5rArJrVrorrrr�<module>s.67686970717273
Aluode/PerceptionLabPortable · CoolFace