OwlCyberSecurity - MANAGER
Edit File: metadata.cpython-312.pyc
� ����W��g��������������������������d�Z�ddlmZ�ddlZddlZddlZddlZddlZddl m Z �ddlmZ�ddl mZmZmZmZ�ddlmZ�dd �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�|�j������������������d��������S�)N�#)� startswith)�strs��� �=/opt/hc_python/lib/python3.12/site-packages/wheel/metadata.py� _nonblankr������s�������*�s�~�~�c�*�*�*�����c�����������������\�����t���������j������������������j������������������t��������t��������|���������������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��� r���r���r������s ��������?�?�(�(��[�(�)C�D�Dr���c�����������������n�����t��������t��������t��������t��������j������������������|�j����������������������������������������S��N)�filterr���r���r����strip� splitlines)�texts��� r����_r ���)���s!�������)�S����D�O�O�,=�>�?�?r���c��������������#������K����d}g�}t��������|��������D�]a��}|j������������������d�������r=|j������������������d�������r |s|r||f���|dd�j��������������������������}g�}�Et ��������d|��������|j������������������|���������c�||f���y�w)ar��Split 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)r���r����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�����t��������j������������������dd|��������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_extrar2���I���s!������ ��6�6�#�S�%�0�6�6�8�8r���c�����������������0�����t��������j������������������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/���)�names��� r���� safe_namer6���Q���s��������6�6�"�C��.�.r���c�����������������������|�j�������������������rd|�j�������������������z���S�g�}|�j������������������D�]*��}|j������������������|j������������������|j������������������z������������,�|rddj������������������t ��������|��������������z���S�y)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_distrD���X���si����������{���&�&�!�M��%�%�����T�]�]�T�\�\�9�:��&����S�X�X�f�]�3�4�4�4�r���c��������������#�������K����|�D�]h��}t��������|�������}t��������|�������}dj������������������t��������d��|j������������������D�����������������������}|rd|��d�}t��������|j�������������������������|z���|z�������j�y�w)z=Yield Requires-Dist: strings for parsed requirements strings.r9���c��������������3���2���K����|�]��}t��������|������������y��wr���)r2���)�.0�es��� r���� <genexpr>z'convert_requirements.<locals>.<genexpr>l���s��������� R�8Q�1��A��8Q�s����r"���r#���N)r���rD���r?���r@����extrasr6���r5���)�requirements�req�parsed_requirementrC���rJ���s��� r����convert_requirementsrN���g���sr�����������(��-��(�);�<�����&� R�8J�8Q�8Q� R�R�S�������]�F��*�/�/�0�6�9�D�@�@���s����A/A1c��������������#���2��K����|�j��������������������������D�]���\��}}d}|xs�d}d|v�r|j������������������dd�������\��}}t��������|�������}|rd|f���|rd|z���dz���}|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�splitr2���rN���r���r���)�extras_requirer1����depends� condition�new_req� canonical_reqs��� r����generate_requirementsr\���s���s�����������)�.�.�0���w�� ������%�<�$�{�{�3��2��E�9��5�!���"�E�)�)���)�O�h�6� ��:�e�W�A�.�.�I��� �)�I�+�G�4�G���G�i�,?� @�A�M�!�=�0�0��5�!�1�s����BBc����������� ������ ����t��������|d��������5�}t����������������j������������������|�������}ddd��������j������������������dd��������|d=�|d=�t��������j ������������������j ������������������|�d�������}t��������j ������������������j������������������|�������rvt��������|d��������5�}|j��������������������������}ddd��������t��������t���������������d ��� �������}|D�]4��\��}} t��������|| i�������D�]��\��} }| |f|j��������������������������vs�||| <����!��6�|d���}|rq|d���j��������������������������} dj ������������������| d ���j��������������������������t��������j ������������������dj ������������������| dd���������������df�������}|j#������������������|��������|d=�|S�#�1�sw�Y�����QxY�w#�1�sw�Y�����xY�w)zN Convert .egg-info directory with PKG-INFO to the Metadata 2.1 format zutf-8)�encodingNzMetadata-Versionz2.1rQ���rT���zrequires.txtc����������������������|�d���xs�dS�)Nr���r:�����)�xs��� r����<lambda>z%pkginfo_to_metadata.<locals>.<lambda>����s������Q�q�T�Z�UW�Zr���)�key�Description� r���r ���)�openr����parse�replace_header�os�pathr?����exists�readr@���r,���r\���rU���r����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��3��%�^�H�%=�CW�X��.�K�E�4�3�U�D�M�B� ��U���<�x�~�~�'7�7�$)�H�S�M��C��/� ��=�)�K��$�]�3�>�>�@��#�y�y��"�!�$�+�+�-����� � �*;�A�B�*?� @�A�� � ��� ���1�2��]�#��O�C� .� -���3� 2�s����E7�F�7F�F )r���r����returnzbool | Literal[''])r���z Iterable[str]r���� Iterator[str])r���r���r���r����)r(���zstr | Iterator[str]r���z3Generator[tuple[str | None, list[str]], None, None])r1���r���r���r���)r5���r���r���r���)rA���r���r���r���)rK���z list[str]r���r����)rW���zdict[str | None, list[str]]r���zIterator[tuple[str, str]])rq���r���rr���r���r���r���)!�__doc__� __future__r���� functoolsr����os.pathri���r.���rn���� email.messager����email.parserr����typingr���r���r���r ����vendored.packaging.requirementsr���r����singledispatchr����registerr���r ���r,���r2���r6���rD���rN���r\���r~���r`���r���r����<module>r�������s��������#�������� ����!����9��9��8�+�����E���E�"� ���c��@���@����8��69�/�� A�1�/�1��1�>%r���