+hg~dZddlmZddlZddlZddlmZddlm Z ddl m Z ddl m Z mZmZdd ZddZddZddZdS)z2 Tools for converting old- to new-style metadata. ) annotationsN)Message)Parser)Iterator) Requirement safe_extrasplit_sections requirementrreturnstrct|ddr d|jzSg}|jD]\}}|||z|r(ddt |zdzSdS)zFReturn the version specifier for a requirement in PEP 345/566 fashion.urlNz @ z (,))getattrrspecsappendjoinsorted)r requires_distopvers ^/home/jenkins/workspace/simtester-sanitize/venv/lib/python3.11/site-packages/wheel/metadata.pyrequires_to_requires_distrs{E4(('{&&M$''CR#X&&&&chhvm44555;;r requirements list[str] Iterator[str]c#K|D]c}tj|}t|}dt |j}|rd|d}|j|z|zVddS)z=Yield Requires-Dist: strings for parsed requirements strings.r[]N)rparserrrextras project_name)rreqparsed_requirementspecr$s rconvert_requirementsr)s>>(.s33();<<&!3!:;;<<  #"]]]F -6=====>>rextras_requiredict[str, list[str]]Iterator[tuple[str, str]]c#K|D]s\}}d}|pd}d|vr|dd\}}t|}|rd|fV|rd|zdz}|d|zz }|rd|z}t|D] }d ||zfV td S) 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:Provides-Extra(z) and z extra == '%s'z ; Requires-DistN)itemssplitrr))r*extradepends conditionnew_reqs rgenerate_requirementsr9*s)..0077w   %<<${{322 E95!!  1"E) ) ) ) 7)Oh6 50 0I  * )I+G44 7 7G!7Y#66 6 6 6 6 7!77r egg_info_path pkginfo_pathrc t|d5}t|}dddn #1swxYwY|dd|d=|d=tj|d}tj|rt|5}|}dddn #1swxYwYtt|d }|D]9\}} t|| iD]"\} } | | f| vr| || <#:|d } | r|d  } d | d tjd | ddd f}|||d =|S)zN Convert .egg-info directory with PKG-INFO to the Metadata 2.1 format zutf-8)encodingNzMetadata-Versionz2.1r0r2z requires.txtc|dpdS)Nrr)xs rz%pkginfo_to_metadata..XsQqTZUWr)key Description rr/)openrr#replace_headerospathrexistsreadrr r9r3 splitlineslstriptextwrapdedent set_payload)r:r;headerspkg_info requires_path requires_filerequiresparsed_requirementsr5reqsrBvalue descriptiondescription_linesdedented_descriptions rpkginfo_to_metadatar[Hsc lW - - -+88>>'**+++++++++++++++ .666!"!GLL??M w~~m$$* -  ,M$))++H , , , , , , , , , , , , , , ,%^H%=%=CWCWXXX. * *KE43UDMBB * * U>@@#yy"!$++-- *;ABB*? @ @AA    1222 ] # Os#"AAA5CCC)r rr r )rrr r)r*r+r r,)r:r r;r r r)__doc__ __future__ros.pathrGrM email.messager email.parserrtypingr pkg_resourcesrrr rr)r9r[r?rrrcs#"""""!!!!!!AAAAAAAAAA     > > > >7777<%%%%%%r