zCj`ZdZddlmZddlZddlZddlZddlZddlZddl m Z ddl m Z ddl mZmZmZmZddlmZd)d Zejd*dZeed+dZd,dZd-dZd.dZd/dZd0d Zd1d$Zd2d(Z dS)3z2 Tools for converting old- to new-style metadata. ) annotationsN)Message)Parser) GeneratorIterableIteratorLiteral) Requirementstrreturnbool | Literal['']c2|o|d S)N#) startswith)r s s/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/setuptools/_vendor/wheel/metadata.py _nonblankrs  *s~~c****iterable Iterable[str] Iterator[str]cftjtt|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'] ) itertoolschain from_iterablemap yield_lines)rs rrrs$ ? ( ([()C)C D DDrtextcttttj|SN)filterrrr strip splitlines)rs r_r$)s( )SDOO,=,=>> ? ??rsstr | Iterator[str]3Generator[tuple[str | None, list[str]], None, None]c#2Kd}g}t|D]z}|drN|dr)|s|r||fV|dd}g}Ut d|||{||fVdS)arSplit 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)rrendswithr" ValueErrorappend)r%sectioncontentlines rsplit_sectionsr2.sGGA ! ! ??3   !}}S!! B+g+!7****qt***,, !:DAAA NN4  7 rextracRtjdd|S)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$)resublower)r3s r safe_extrar8Is% 6#S% 0 0 6 6 8 88rnamec.tjdd|S)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.]+-)r5r6)r9s r safe_namer<Qs 6"C . ..r requirementr c|jr d|jzSg}|jD]$}||j|jz%|r%ddt |zSdS)zFReturn the version specifier for a requirement in PEP 345/566 fashion.z @  ,)url specifierr.operatorversionjoinsorted)r= requires_distspecs rrequires_to_requires_distrJXs|'{&&!M%;;T]T\9::::SXXf]334444rr requirements list[str]c#K|D]u}t|}t|}dtd|jD}|rd|d}t |j|z|zVvdS)z=Yield Requires-Dist: strings for parsed requirements strings.r@c34K|]}t|VdSr )r8).0es r z'convert_requirements..ls( R R1A R R R R R Rrr)r*N)r rJrFrGextrasr<r9)rKreqparsed_requirementrIrRs rconvert_requirementsrUgsAA(--();<<& R R8J8Q R R RRRSS  #"]]]F*/0069D@@@@@AArextras_requiredict[str | None, list[str]]Iterator[tuple[str, str]]c#TK|D]\}}d}|pd}d|vr|dd\}}t|}|rd|fV|rd|zdz}|d|dz }|rd |z}t|D]'}t t ||z}d |fV(d 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. rA:r Provides-Extra(z) and z extra == ''z ; Requires-DistN)itemssplitr8rUr r )rVr3depends conditionnew_req canonical_reqs rgenerate_requirementsress)..0011w   %<<${{322 E95!!  /"E) ) ) ) 7)Oh6 .e... .I  * )I+G44 1 1G Gi,? @ @AAM!=0 0 0 0 0 1!11r egg_info_path pkginfo_pathrc t|d5}t|}dddn #1swxYwY|dd|d=|d=tj|d}tj|rt|d5}|}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.1r[r^z requires.txtc|dpdS)NrrA)xs rz%pkginfo_to_metadata..sQqTZUWr)key Description rr )openrparsereplace_headerospathrFexistsreadrGr2rer_r#lstriptextwrapdedent set_payload)rfrgheaderspkg_info requires_path requires_filerequiresparsed_requirementsr3reqsrnvalue descriptiondescription_linesdedented_descriptions rpkginfo_to_metadatarsh lW - - -+88>>'**+++++++++++++++ .666!"!GLL??M w~~m$$* -' 2 2 2 ,m$))++H , , , , , , , , , , , , , , ,%^H%=%=CWCWXXX. * *KE43UDMBB * * U>@@#yy"!$++-- *;ABB*? @ @AA    1222 ] # Os#"AAA7CCC)r r r r)rrr r)rr r r)r%r&r r')r3r r r )r9r r r )r=r r r )rKrLr r)rVrWr rX)rfr rgr r r)!__doc__ __future__r functoolsros.pathrtr5ry email.messager email.parserrtypingrrrr vendored.packaging.requirementsr rsingledispatchrregisterr r$r2r8r<rJrUrerrkrrrs#""""" !!!!!!999999999999888888++++ EEEE" c@@@@69999////     A A A A1111>%%%%%%r