zCj`Z d Z ddlmZ ddlZddlZddlZddlZddlZddl m Z ddlmZ ddl mZmZmZmZ ddlmZ d)dZej d*d Ze e d+d Zd,dZd-dZd.dZd/dZd0d Zd1d$Zd2d(Z dS )3z2 Tools for converting old- to new-style metadata. )annotationsN)Message)Parser) GeneratorIterableIteratorLiteral )Requirementstrreturnbool | Literal['']c 2 | 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 _nonblankr s *s~~c**** iterable Iterable[str] Iterator[str]c f t 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'] ) itertoolschain from_iterablemapyield_lines)r s r r r s$ ?(([()C)CDDDr textc t t t t j | S N)filterr r r strip splitlines)r s r _r$ ) s( )SDOO,=,=>>???r sstr | Iterator[str]3Generator[tuple[str | None, list[str]], None, None]c # 2 K d}g }t | D ]z}| d rN| d r)|s|r||fV |dd }g }Ut d| | | {||fV dS )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 zInvalid section heading)r r endswithr" ValueErrorappend)r% sectioncontentlines r split_sectionsr2 . s GGA ! !??3 !}}S!! B +g +!7****qt***,, !:DAAANN4 7 r extrac R t j dd| 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)r3 s r safe_extrar8 I s% 6#S%0066888r namec . t j dd| 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.]+-)r5 r6 )r9 s r safe_namer<