Ë
    nûàgü  ã                  óþ   — d Z ddlmZ ddlZddlZddlZddlZddlZddl	m
Z
 ddlmZ ddlmZ ddlmZ d	„ Zej$                  d
„ «       Zej)                  e«      d„ «       Zd„ Zd„ Zd„ Zdd„Zdd„Z	 	 	 	 dd„Zdd„Zy)z2
Tools for converting old- to new-style metadata.
é    )ÚannotationsN)ÚMessage)ÚParser)ÚIteratoré   )ÚRequirementc                ó.   — | xr | j                  d«       S )Nú#)Ú
startswith)Ústrs    ú_/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/setuptools/_vendor/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–— |dd 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   éÿÿÿÿzInvalid 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                  dd| «      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_extrar/   G   s!   € ô
 �6‰6Ð# S¨%Ó0×6Ñ6Ó8Ð8r   c                ó0   — t        j                  dd| «      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_namer3   O   s   € ô �6‰6Ð" C¨Ó.Ð.r   c                óð   — t        | dd«      rd| j                  z   S g }| j                  D ]*  }|j                  |j                  |j
                  z   «       Œ, |rddj                  t        |«      «      z   S y)zFReturn the version specifier for a requirement in PEP 345/566 fashion.ÚurlNz @ ú ú,Ú )Úgetattrr5   Ú	specifierr$   ÚoperatorÚversionÚjoinÚsorted)ÚrequirementÚrequires_distÚspecs      r   Úrequires_to_requires_distrB   V   ss   € äˆ{˜E 4Ô(Ø�{—‘Ñ&Ð&à€MØ×%Ñ%ò ;ˆØ×Ñ˜TŸ]™]¨T¯\©\Ñ9Õ:ð;ñ Ø�S—X‘Xœf ]Ó3Ó4Ñ4Ð4àr   c              #  óæ   K  — | D ]h  }t        |«      }t        |«      }dj                  t        d„ |j                  D «       «      «      }|rd|› d�}t        |j                  «      |z   |z   –— Œj y­w)z=Yield Requires-Dist: strings for parsed requirements strings.r7   c              3  ó2   K  — | ]  }t        |«      –— Œ y ­wr   )r/   )Ú.0Úes     r   ú	<genexpr>z'convert_requirements.<locals>.<genexpr>j   s   è ø€ Ò R°1¤¨A§Ñ Rùs   ‚r   r    N)r   rB   r=   r>   Úextrasr3   r2   )ÚrequirementsÚreqÚparsed_requirementrA   rH   s        r   Úconvert_requirementsrL   e   sy   è ø€ àò AˆÜ(¨Ó-ÐÜ(Ð);Ó<ˆØ—‘œ&Ñ RÐ8J×8QÑ8QÔ RÓRÓSˆÙØ˜˜ �]ˆFäÐ*×/Ñ/Ó0°6Ñ9¸DÑ@Ó@ñAùs   ‚A/A1c              #  ó  K  — | j                  «       D ]k  \  }}d}|xs d}d|v r|j                  dd«      \  }}t        |«      }|rd|f–— |rd|z   dz   }|d|z  z  }|rd|z   }t        |«      D ]  }d	||z   f–— Œ Œm 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.
    r8   ú:r   úProvides-Extraú(z) and zextra == '%s'z ; úRequires-DistN)ÚitemsÚsplitr/   rL   )Úextras_requirer.   ÚdependsÚ	conditionÚnew_reqs        r   Úgenerate_requirementsrX   q   s·   è ø€ ð )×.Ñ.Ó0ò 7‰ˆˆwØˆ	Ø’˜ˆØ�%‰<Ø$Ÿ{™{¨3°Ó2ÑˆE�9ä˜5Ó!ˆÙØ" EÐ)Ò)ÙØ )™O¨hÑ6�	Ø˜¨5Ñ0Ñ0ˆIáØ 	Ñ)ˆIä+¨GÓ4ò 	7ˆGØ! 7¨YÑ#6Ð6Ó6ñ	7ñ!7ùs   ‚B Bc           
     ó   — t        |d¬«      5 }t        «       j                  |«      }ddd«       j                  dd«       |d= |d= t        j
                  j                  | d«      }t        j
                  j                  |«      rvt        |d¬«      5 }|j                  «       }ddd«       t        t        «      d	„ ¬
«      }|D ]4  \  }}	t        ||	i«      D ]  \  }
}|
|f|j                  «       vsŒ|||
<   Œ! Œ6 |d   }|rq|d   j                  «       }dj                  |d   j                  «       t        j                   dj                  |dd «      «      df«      }|j#                  |«       |d= |S # 1 sw Y   �ŒQxY w# 1 sw Y   ŒàxY w)zN
    Convert .egg-info directory with PKG-INFO to the Metadata 2.1 format
    zutf-8)ÚencodingNzMetadata-Versionz2.1rO   rQ   zrequires.txtc                ó   — | d   xs dS )Nr   r8   © )Úxs    r   ú<lambda>z%pkginfo_to_metadata.<locals>.<lambda>Ÿ   s   € ÈQÈqÉTÊZÐUW€ r   )ÚkeyÚDescriptionú
r   r   )Úopenr   ÚparseÚreplace_headerÚosÚpathr=   ÚexistsÚreadr>   r)   rX   rR   r   ÚlstripÚtextwrapÚdedentÚset_payload)Úegg_info_pathÚpkginfo_pathÚheadersÚpkg_infoÚrequires_pathÚrequires_fileÚrequiresÚparsed_requirementsr.   Úreqsr_   ÚvalueÚdescriptionÚdescription_linesÚdedented_descriptions                  r   Úpkginfo_to_metadatarz   �   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Å7FÆF)r?   r   Úreturnr   )rI   z	list[str]r{   zIterator[str])rT   zdict[str, list[str]]r{   zIterator[tuple[str, str]])rm   r   rn   r   r{   r   )Ú__doc__Ú
__future__r   Ú	functoolsr   Úos.pathre   r+   rj   Úemail.messager   Úemail.parserr   Útypingr   Úvendored.packaging.requirementsr   r   Úsingledispatchr   Úregisterr   r   r)   r/   r3   rB   rL   rX   rz   r\   r   r   ú<module>r†      s    ðñõ #ã Û Û Û 	Û Ý !Ý Ý å 8ò+ð ×ÑñEó ðEð" ×Ñ�cÓñ@ó ð@òò29ò/óó	Að7Ø(ð7àó7ô<%r   