\bgdZddlmZddlZddlmZddlmZddlm Z ddl m Z ddl m Z dd lmZd d lmZd d lmZe d ZeedfZddZddZd dZdZdZdZdZdZdZdS)!aSHelper code used to generate ``requires.txt`` files in the egg-info directory. The ``requires.txt`` file has an specific format: - Environment markers need to be part of the section headers and should not be part of the requirement spec itself. See https://setuptools.pypa.io/en/latest/deprecated/python_eggs.html#requires-txt ) annotationsN) defaultdict)Mapping) filterfalse)TypeVar) yield_lines) Requirement)_reqs) _StrOrIter_Tinstall_requiresr extras_requireMapping[str, _StrOrIter]return&tuple[list[str], dict[str, list[str]]]c@t|}t||S)zGiven values for ``install_requires`` and ``extras_require`` create modified versions in a way that can be written in ``requires.txt`` )_convert_extras_requirements"_move_install_requirements_markers)rrextrass p/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/setuptools/command/_requirestxt.py_preparers" *. 9 9F -.> G GG#Mapping[str, _Ordered[Requirement]]ctt}|D]O\}}||tj|D]-}||t |z|.P|S)z Convert requirements in `extras_require` of the form `"extra": ["barbazquux; {marker}"]` to `"extra:{marker}": ["barbazquux"]`. )rdictitemsr parse _suffix_for setdefault)routputsectionvrs rrr's3>d2C2CF$**,,;; wQ ; ;A 7[^^+ , 7 7 : : : : ; Mrcttj|}tt|}t t|}tt t|}|D]2}|dt|jz |3td| D}||fS)a+ The ``requires.txt`` file has an specific format: - Environment markers need to be part of the section headers and should not be part of the requirement spec itself. Move requirements in ``install_requires`` that are using environment markers ``extras_require``. :c 3K|]M\}}|ttdtt|DfVNdS)c34K|]}t|VdSN)str).0r$s r z?_move_install_requirements_markers...Rs(BB!s1vvBBBBBBrN)listrfromkeysmap _clean_req)r+kr#s rr,z5_move_install_requirements_markers..Psn Aq DBBs:q/A/ABBBBB C CDr) r-r rfilter _no_markerrr/r*markerr rr)rr inst_reqs simple_reqs complex_reqssimple_install_requiresr$expanded_extrass rrr9sU[!12233IY//Kz955L"3sK#8#899 ::sS]]*+66q9999#((**O #O 33rcB|jrdt|jzndS)z;Return the 'extras_require' suffix for a given requirement.r&)r4r*reqs rrrYs!$'J 63SZ B6rcLtt|}d|_|S)z=Given a Requirement, remove environment markers and return itN)r r*r4)r=r$s rr0r0^s!CHHAAH Hrc|j Sr))r4r<s rr3r3es z>rcxt|pd}d}t||}||dS)Nc |dzS)N rA)lines r append_crz&_write_requirements..append_crls d{r)rr/ writelines)streamreqslinesrEs r_write_requirementsrJisM   # #E  5 ! !E erc |j}tj}t|jpd|jpi\}}t ||t|D]D}|dj ditt |||E| d|| dS)NrAz [{extra}] requirements) distributionioStringIOrrrrJsortedwriteformatvarswrite_or_delete_filegetvalue)cmdbasenamefilenamedistdatarrextras rwrite_requirementsr\ss  D ;==D'/ #T%8%>B(($n.///''99 )?)33DFF33444D."78888^Xt}}GGGGGrctj}t||jj|d||dS)Nzsetup-requirements)rNrOrJrMsetup_requiresrTrU)rVrWrXrZs rwrite_setup_requirementsr_sJ ;==Dc.=>>>18T]]__MMMMMr)rr rrrr)rrrr)rr rrrr)__doc__ __future__rrN collectionsrcollections.abcr itertoolsrtypingr jaraco.textrpackaging.requirementsr r;r r r r_Orderedrrrrr0r3rJr\r_rArrris#""""" ############!!!!!!######...... WT]] D>HHHH$4444@777     H H HNNNNNr