+
    SBi                    8   R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIHt ^ RIHtHtHtHt ^RIHt R R lt]P*                  R	 R
 l4       t]P/                  ]4      R R l4       tR R ltR R ltR R ltR R ltR R ltR R ltR R lt R# )z2
Tools for converting old- to new-style metadata.
)annotationsN)Message)Parser)	GeneratorIterableIteratorLiteral)Requirementc                    V ^8  d   QhRRRR/# )   strreturnzbool | Literal[''] )formats   "3/usr/lib/python3.14/site-packages/wheel/metadata.py__annotate__r      s     + +3 +- +    c                B    T ;'       d    V P                  R 4      '       * # )#)
startswith)r   s   &r   	_nonblankr      s    **s~~c***r   c                    V ^8  d   QhRRRR/# )r   iterablezIterable[str]r   Iterator[str]r   )r   s   "r   r   r      s     E E- EM Er   c                \    \         P                  P                  \        \        V 4      4      # )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)r   s   &r   r   r      s      ??(([()CDDr   c                    V ^8  d   QhRRRR/# )r   textr   r   r   r   )r   s   "r   r   r   *   s     @ @C @M @r   c                n    \        \        \        \        P                  V P                  4       4      4      # N)filterr   r   r   strip
splitlines)r!   s   &r   _r'   )   s!    )SDOO,=>??r   c                    V ^8  d   QhRRRR/# )r   szstr | Iterator[str]r   z3Generator[tuple[str | None, list[str]], None, None]r   )r   s   "r   r   r   .   s      8r   c              #  2  "   Rp. p\        V 4       Fz  pVP                  R4      '       dP   VP                  R4      '       d-   V'       g	   V'       d   W3x  V^R P                  4       p. pK]  \	        RV4      hVP                  V4       K|  	  W3x  R# 5i)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)r)   sectioncontentlines   &   r   split_sectionsr4   .   s      GGA??3}}S!!g!**q***, !:DAANN4   
s   A BBBABc                    V ^8  d   QhRRRR/# )r   extrar   r   r   )r   s   "r   r   r   I   s     9 9c 9c 9r   c                N    \         P                  ! RRV 4      P                  4       # )zConvert 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)r6   s   &r   
safe_extrar;   I   s!    
 66#S%06688r   c                    V ^8  d   QhRRRR/# )r   namer   r   r   )r   s   "r   r   r   Q   s     / /C /C /r   c                2    \         P                  ! RRV 4      # )zConvert an arbitrary string to a standard distribution name
Any runs of non-alphanumeric/. characters are replaced with a single '-'.
z[^A-Za-z0-9.]+-)r8   r9   )r=   s   &r   	safe_namer@   Q   s     66"C..r   c                    V ^8  d   QhRRRR/# )r   requirementr	   r   r   r   )r   s   "r   r   r   X   s      ; 3 r   c                $   V P                   '       d   RV P                   ,           # . pV P                   F/  pVP                  VP                  VP                  ,           4       K1  	  V'       d"   RRP                  \        V4      4      ,           # R# )zFReturn the version specifier for a requirement in PEP 345/566 fashion.z @  , )url	specifierr0   operatorversionjoinsorted)rB   requires_distspecs   &  r   requires_to_requires_distrO   X   sk    {&&!M%%T]]T\\9: & SXXf]3444r   c                    V ^8  d   QhRRRR/# )r   requirementsz	list[str]r   r   r   )r   s   "r   r   r   g   s     	A 	Ay 	A] 	Ar   c              #    "   V  Fw  p\        V4      p\        V4      pRP                  \        R VP                   4       4      4      pV'       d   RV R2p\        VP                  4      V,           V,           x  Ky  	  R# 5i)z=Yield Requires-Dist: strings for parsed requirements strings.rE   c              3  8   "   T F  p\        V4      x  K  	  R # 5ir#   )r;   ).0es   & r   	<genexpr>'convert_requirements.<locals>.<genexpr>l   s      R8Q1A8Qs   r+   r,   N)r	   rO   rK   rL   extrasr@   r=   )rQ   reqparsed_requirementrN   rX   s   &    r   convert_requirementsr[   g   sq     (-();<& R8J8Q8Q RRS]F*//069D@@ s   B Bc                    V ^8  d   QhRRRR/# )r   extras_requirezdict[str | None, list[str]]r   zIterator[tuple[str, str]]r   )r   s   "r   r   r   s   s     1 1/11r   c              #    "   V P                  4        F  w  rRpT;'       g    RpRV9   d   VP                  R^4      w  r\        V4      pV'       d,   RV3x  V'       d   RV,           R,           pVRV R2,          pV'       d
   RV,           p\        V4       F#  p\	        \        WC,           4      4      pR	V3x  K%  	  K  	  R
# 5i)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.
rF   :Provides-Extra(z) and z
extra == ''z ; Requires-DistN)itemssplitr;   r[   r   r	   )r]   r6   depends	conditionnew_reqcanonical_reqs   &     r   generate_requirementsrj   s   s      )..0	%<${{32E5!"E)))Oh6	:eWA..I	)I+G4GG,? @AM!=00 5! 1s    C>C"$CACc               $    V ^8  d   QhRRRRRR/# )r   egg_info_pathr   pkginfo_pathr   r   r   )r   s   "r   r   r      s!     % %s %# %' %r   c           	        \        VRR7      ;_uu_ 4       p\        4       P                  V4      pRRR4       XP                  RR4       VR VR \        P
                  P                  V R4      p\        P
                  P                  V4      '       d   \        VRR7      ;_uu_ 4       pVP                  4       pRRR4       \        \        X4      R	 R
7      pV F6  w  r\        W/4       F!  w  rW3VP                  4       9  g   K  WV
&   K#  	  K8  	  VR,          pV'       d   VR,          P                  4       pRP                  V^ ,          P                  4       \        P                   ! RP                  VR,          4      4      R34      pVP#                  V4       VR V#   + '       g   i     EL; i  + '       g   i     EL	; i)zF
Convert .egg-info directory with PKG-INFO to the Metadata 2.1 format
zutf-8)encodingNzMetadata-Versionz2.1r`   rc   zrequires.txtc                (    V ^ ,          ;'       g    R# )    rF   r   )xs   &r   <lambda>%pkginfo_to_metadata.<locals>.<lambda>   s    QqTZZUWZr   )keyDescription
:   NN)openr   parsereplace_headerospathrK   existsreadrL   r4   rj   rd   r&   lstriptextwrapdedentset_payload)rl   rm   headerspkg_inforequires_pathrequires_filerequiresparsed_requirementsr6   reqsru   valuedescriptiondescription_linesdedented_descriptions   &&             r   pkginfo_to_metadatar      s    
lW	-	-8>>'* 
. .6!"!GGLL?M	ww~~m$$-'22m$))+H 3 %^H%=CWX.KE3UMB
<x~~'77$)SM C /
 =)K$]3>>@#yy "!$++-		*;B*? @A 
 	12]#OC 
.	-	- 322s   F'*F;'F8	;G	)!__doc__
__future__r   	functoolsr   os.pathr|   r8   r   email.messager   email.parserr   typingr   r   r   r   vendored.packaging.requirementsr	   r   singledispatchr   registerr   r'   r4   r;   r@   rO   r[   rj   r   r   r   r   <module>r      s    #    	  !  9 9 8+ E E" c@ @69/	A1>%r   