ó
    ¶'Ôi,  ã                  ó:  • S r SSKJr  SSKrSSKrSSKrSSKrSSKrSSK	J
r
JrJr  SSKJr  SSKJr  SSKJr  SSKJr  SS	 jr\R,                  SS
 j5       r\R1                  \5      SS j5       r    SS jrSS jrSS jrSS jrSS jr    SS jr SS jr!g)z2
Tools for converting old- to new-style metadata.
é    )ÚannotationsN)Ú	GeneratorÚIterableÚIterator)ÚMessage)ÚParser)ÚLiteral)ÚRequirementc                ó@   • U =(       a    U R                  S5      (       + $ )NÚ#)Ú
startswith)Ústrs    ÚN/var/www/surfInsights/venv3-11/lib/python3.13/site-packages/wheel/_metadata.pyÚ	_nonblankr      s   € Ø×*�s—~‘~ cÓ*Ô*Ð*ó    c                ó\   • [         R                  R                  [        [        U 5      5      $ )aQ  
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   • [        [        [        [        R                  U R                  5       5      5      $ ©N)Úfilterr   r   r   ÚstripÚ
splitlines)Útexts    r   Ú_r   *   s!   € ä”)œS¤§¡¨D¯O©OÓ,=Ó>Ó?Ð?r   c              #  ó(  #   • Sn/ n[        U 5       Hv  nUR                  S5      (       aL  UR                  S5      (       a*  U(       d  U(       a  X4v •  USS R                  5       n/ nMY  [	        SU5      eUR                  U5        Mx     X4v •  g7f)a^  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Ú[Ú]é   éÿÿÿÿzInvalid section heading)r   r   Úendswithr   Ú
ValueErrorÚappend)ÚsÚsectionÚcontentÚlines       r   Úsplit_sectionsr,   /   s‰   é € ð €GØ€GÜ˜A–ˆØ�?‰?˜3×ÑØ�}‰}˜S×!Ñ!ÞžgØ!Ð*Ò*Ø˜q ˜*×*Ñ*Ó,�Ø’ä Ð!:¸DÓAÐAà�N‰N˜4Ö ñ ð Ð
Óùs   ‚BBc                óN   • [         R                  " SSU 5      R                  5       $ )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   J   s!   € ô
 �6Š6Ð# S¨%Ó0×6Ñ6Ó8Ð8r   c                ó2   • [         R                  " SSU 5      $ )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   R   s   € ô �6Š6Ð" C¨Ó.Ð.r   c                ó  • U R                   (       a  SU R                   -   $ / nU R                   H+  nUR                  UR                  UR                  -   5        M-     U(       a  SSR                  [        U5      5      -   $ g)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   Y   si   € à‡‡Ø�{—‘Ñ&Ð&à!€MØ×%Ô%ˆØ×Ñ˜TŸ]™]¨T¯\©\Ñ9Ö:ñ &ö Ø�S—X‘Xœf ]Ó3Ó4Ñ4Ð4àr   c              #  óô   #   • U  Hn  n[        U5      n[        U5      nSR                  [        S UR                   5       5      5      nU(       a  SU S3n[        UR                  5      U-   U-   v •  Mp     g7f)z=Yield Requires-Dist: strings for parsed requirements strings.r9   c              3  ó8   #   • U  H  n[        U5      v •  M     g 7fr   )r2   )Ú.0Úes     r   Ú	<genexpr>Ú'convert_requirements.<locals>.<genexpr>m   s   é € Ð RÒ8Q°1¤¨A§ Ò8Qùs   ‚r!   r"   N)r
   rD   r?   r@   Úextrasr6   r5   )ÚrequirementsÚreqÚparsed_requirementrC   rK   s        r   Úconvert_requirementsrO   h   sq   é € ãˆÜ(¨Ó-ÐÜ(Ð);Ó<ˆØ—‘œ&Ñ RÐ8J×8QÒ8QÓ RÓRÓSˆÞØ˜˜ �]ˆFäÐ*×/Ñ/Ó0°6Ñ9¸DÑ@Ô@ò ùs   ‚A6A8c              #  ó`  #   • U R                  5        H–  u  pSnU=(       d    SnSU;   a  UR                  SS5      u  p[        U5      nU(       a  SU4v •  U(       a  SU-   S-   nUSU S3-  nU(       a  S	U-   n[        U5       H  n[	        [        XC-   5      5      nS
U4v •  M!     M˜     g7f)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   rO   r   r
   )Úextras_requirer1   ÚdependsÚ	conditionÚnew_reqÚcanonical_reqs         r   Úgenerate_requirementsr]   t   s¹   é € ð )×.Ñ.Ö0‰ˆØˆ	Ø—˜ˆØ�%‹<Ø$Ÿ{™{¨3°Ó2ÑˆEä˜5Ó!ˆÞØ" EÐ)Ò)ÞØ )™O¨hÑ6�	Ø˜: e W¨AÐ.Ñ.ˆIæØ 	Ñ)ˆIä+¨GÖ4ˆGÜ¤¨GÑ,?Ó @ÓAˆMØ! =Ð0Ô0ó 5ò! 1ùs   ‚B,B.c           
     ó<  • [        USS9 n[        5       R                  U5      nSSS5        WR                  SS5        US	 US	 [        R
                  R                  U S5      n[        R
                  R                  U5      (       ar  [        USS9 nUR                  5       nSSS5        [        [        W5      S	 S
9nU H5  u  p‰[        X‰05       H   u  p«X«4UR                  5       ;  d  M  X³U
'   M"     M7     US   nU(       ar  US   R                  5       nSR                  US   R                  5       [        R                   " SR                  USS 5      5      S45      nUR#                  U5        US	 U$ ! , (       d  f       GN]= f! , (       d  f       Nï= f)zF
Convert .egg-info directory with PKG-INFO to the Metadata 2.1 format
zutf-8)ÚencodingNzMetadata-Versionz2.1rR   rU   zrequires.txtc                ó   • U S   =(       d    S$ )Nr   r:   © )Úxs    r   Ú<lambda>Ú%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]   rV   r   ÚlstripÚtextwrapÚdedentÚset_payload)Úegg_info_pathÚpkginfo_pathÚheadersÚpkg_infoÚrequires_pathÚrequires_fileÚrequiresÚparsed_requirementsr1   Úreqsre   ÚvalueÚdescriptionÚdescription_linesÚdedented_descriptions                  r   Úpkginfo_to_metadatar€   “   sw  € ô 
ˆl WÒ	-°Ü“8—>‘> 'Ó*ˆ÷ 
.ð ×ÑÐ.°Ô6àÐ!Ð"Ø�Ð!Ü—G‘G—L‘L °Ó?€MÜ	‡w�w‡~�~�m×$Ñ$Ü�-¨'Ò2°mØ$×)Ñ)Ó+ˆH÷ 3ô %¤^°HÓ%=ÑCWÑXÐÛ.‰KˆEÜ3°U°MÖB‘
�Ø�< x§~¡~Ó'7Õ7Ø$)˜S“Mó Cñ /ð
 ˜=Ñ)€KÞØ$ ]Ñ3×>Ñ>Ó@ÐØ#Ÿy™yð " !Ñ$×+Ñ+Ó-Ü—’ §	¡	Ð*;¸A¸BÐ*?Ó @ÓAØðó 
Ðð 	×ÑÐ1Ô2Ø�]Ð#à€O÷C 
.Ö	-ú÷ 3Õ2ús   ‹E;ÂFÅ;
F
Æ
F)r   r   Úreturnzbool | Literal[''])r   zIterable[str]r�   úIterator[str])r   r   r�   r‚   )r(   zstr | Iterator[str]r�   z3Generator[tuple[str | None, list[str]], None, None])r1   r   r�   r   )r5   r   r�   r   )rA   r
   r�   r   )rL   z	list[str]r�   r‚   )rX   zdict[str | None, list[str]]r�   zIterator[tuple[str, str]])rs   r   rt   r   r�   r   )"Ú__doc__Ú
__future__r   Ú	functoolsr   Úos.pathrk   r.   rp   Úcollections.abcr   r   r   Úemail.messager   Úemail.parserr   Útypingr	   Úpackaging.requirementsr
   r   Úsingledispatchr   Úregisterr   r   r,   r2   r6   rD   rO   r]   r€   ra   r   r   Ú<module>rŽ      s¶   ðñõ #ã Û Û Û 	Û ß 9Ñ 9Ý !Ý Ý å .ô+ð ×ÑóEó ðEð" ×Ñ�cÓó@ó ð@ðØðà8ôô69ô/ôô	Að1Ø/ð1àô1õ>%r   