HOME


Mini Shell 1.0
DIR: /snap/certbot/4482/lib/python3.12/site-packages/wheel/__pycache__/
Upload File :
Current File : //snap/certbot/4482/lib/python3.12/site-packages/wheel/__pycache__/metadata.cpython-312.pyc
�

�S�g���dZddlmZddlZddlZddlZddlZddlZddl	m
Z
ddlmZddl
mZmZmZmZddlmZdd	�Zej*dd
��Zej/e�dd��Z				dd�Zdd
�Zdd�Zdd�Zdd�Z				dd�Zdd�Z y)z2
Tools for converting old- to new-style metadata.
�)�annotationsN)�Message)�Parser)�	Generator�Iterable�Iterator�Literal�)�Requirementc�.�|xr|jd�S)N�#)�
startswith)�strs �~/build/snapcraft-certbot-29b1212f749eeba2f1dece1adfe9a83a/parts/certbot/install/lib/python3.12/site-packages/wheel/metadata.py�	_nonblankrs���*�s�~�~�c�*�*�*�c�\�tjjtt|��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)�iterables rrrs ���?�?�(�(��[�(�)C�D�Drc�n�ttttj|j���S�N)�filterrrr�strip�
splitlines)�texts r�_r )s!���)�S����D�O�O�,=�>�?�?rc#�K�d}g}t|�D]a}|jd�r=|jd�r |s|r||f��|ddj�}g}�Et	d|��|j|��c||f��y�w)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)�s�section�content�lines    r�split_sectionsr,.s������G��G��A��
!���?�?�3���}�}�S�!��g�!�7�*�*��q��*�*�*�,���� �!:�D�A�A��N�N�4� �
!��7�
��s�A;A=c�L�tjdd|�j�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)�extras r�
safe_extrar2Is!��
�6�6�#�S�%�0�6�6�8�8rc�0�tjdd|�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/)�names r�	safe_namer6Qs���6�6�"�C��.�.rc���|jrd|jzSg}|jD]*}|j|j|jz��,|rddjt
|��zSy)zFReturn the version specifier for a requirement in PEP 345/566 fashion.z @ � �,�)�url�	specifierr'�operator�version�join�sorted)�requirement�
requires_dist�specs   r�requires_to_requires_distrDXsn������{���&�&�!�M��%�%�;�����T�]�]�T�\�\�9�:�;���S�X�X�f�]�3�4�4�4�rc#��K�|D]h}t|�}t|�}djtd�|jD���}|rd|�d�}t|j�|z|z���jy�w)z=Yield Requires-Dist: strings for parsed requirements strings.r9c3�2K�|]}t|����y�wr)r2)�.0�es  r�	<genexpr>z'convert_requirements.<locals>.<genexpr>ls���� R�1��A�� R�s�r"r#N)rrDr?r@�extrasr6r5)�requirements�req�parsed_requirementrCrJs     r�convert_requirementsrNgsy�����A��(��-��(�);�<�����&� R�8J�8Q�8Q� R�R�S�������]�F��*�/�/�0�6�9�D�@�@�A�s�A/A1c#�2K�|j�D]�\}}d}|xsd}d|vr|jdd�\}}t|�}|rd|f��|rd|zdz}|d|�d�z
}|rd	|z}t|�D]}t	t||z��}d
|f���!��y�w)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.
    r:�:r
�Provides-Extra�(z) and z
extra == '�'z ; �
Requires-DistN)�items�splitr2rNrr)�extras_requirer1�depends�	condition�new_req�
canonical_reqs      r�generate_requirementsr\ss�����)�.�.�0�1���w��	������%�<�$�{�{�3��2��E�9��5�!���"�E�)�)���)�O�h�6�	��:�e�W�A�.�.�I���	�)�I�+�G�4�	1�G���G�i�,?� @�A�M�!�=�0�0�	1�!1�s�BBc
� �t|d��5}t�j|�}ddd�jdd�|d=|d=tj
j
|d�}tj
j|�rvt|d��5}|j�}ddd�tt�d	��
�}|D]4\}}	t||	i�D]\}
}|
|f|j�vs�|||
<�!�6|d}|rq|dj�}
dj
|
d
j�tj dj
|
dd��df�}|j#|�|d=|S#1swY��QxYw#1swY��xYw)zN
    Convert .egg-info directory with PKG-INFO to the Metadata 2.1 format
    zutf-8)�encodingNzMetadata-Versionz2.1rQrTzrequires.txtc��|dxsdS)Nrr:�)�xs r�<lambda>z%pkginfo_to_metadata.<locals>.<lambda>�s��Q�q�T�Z�UW�r)�key�Description�
rr
)�openr�parse�replace_header�os�pathr?�exists�readr@r,r\rUr�lstrip�textwrap�dedent�set_payload)�
egg_info_path�pkginfo_path�headers�pkg_info�
requires_path�
requires_file�requires�parsed_requirementsr1�reqsrc�value�description�description_lines�dedented_descriptions               r�pkginfo_to_metadatar~�s���
�l�W�	-�+���8�>�>�'�*��+�
���.��6��!�"���!��G�G�L�L���?�M�	�w�w�~�~�m�$�
�-�'�
2�	,�m�$�)�)�+�H�	,�%�^�H�%=�CW�X��.�	*�K�E�4�3�U�D�M�B�
*�
��U���<�x�~�~�'7�7�$)�H�S�M�
*�	*�
�=�)�K��$�]�3�>�>�@��#�y�y�"�!�$�+�+�-�����	�	�*;�A�B�*?� @�A��
� 
��	���1�2��]�#��O�C+�+��	,�	,�s�E7�F�7F�F
)rr�returnzbool | Literal[''])rz
Iterable[str]r�
Iterator[str])rrrr�)r(zstr | Iterator[str]rz3Generator[tuple[str | None, list[str]], None, None])r1rrr)r5rrr)rArrr)rKz	list[str]rr�)rWzdict[str | None, list[str]]rzIterator[tuple[str, str]])rqrrrrrr)!�__doc__�
__future__r�	functoolsr�os.pathrir.rn�
email.messager�email.parserr�typingrrrr	�vendored.packaging.requirementsrr�singledispatchr�registerrr r,r2r6rDrNr\r~r`rr�<module>r�s����#����	��!��9�9�8�+����E��E�"
���c��@��@����8��69�/��	A�1�/�1��1�>%r