_io hdZddlZddlmZddlmZddlmZmZm Z m Z m Z ddl m Z ddlmZdd lmZe d ZeedfZeZe j,Zd ed e eefd e eeeeeefffdZd ed e eeeffdZd ed e eeefd e eeeeeefffdZdZdZdZdZdZdZ y)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 N) defaultdict) filterfalse)DictListTupleMappingTypeVar)_reqs) yield_lines) Requirement_Tinstall_requiresextras_requirereturnc0t|}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 /builddir/build/BUILDROOT/alt-python312-setuptools-69.0.2-3.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/setuptools/command/_requirestxt.py_preparers *. 9F -.> GGctt}|jD]D\}}||tj|D]"}||t |zj |$F|S)z Convert requirements in `extras_require` of the form `"extra": ["barbazquux; {marker}"]` to `"extra:{marker}": ["barbazquux"]`. )rdictitemsr parse _suffix_for setdefault)routputsectionvrs rrr$sa3>d2CF$**, wQA 7[^+ , 7 7 : - MrcZttj|}tt|}t t|}tt t|}|D],}|dt|jzj|.td|jD}||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|]<\}}|ttjdtt|Df>yw)c32K|]}t|ywN)str).0r"s r z?_move_install_requirements_markers...OsB/A!s1v/AsN)listrfromkeysmap _clean_req)r)kr!s rr*z5_move_install_requirements_markers..Ms>+DAq DBs:q/ABB CD*sAA) r+r rfilter _no_markerrr-r(markerrrr)rr inst_reqs simple_reqs complex_reqssimple_install_requiresr"expanded_extrass rrr6sU[[!123IY/Kz95L"3sK#89 sS]*+66q9#((*O #O 33rcN|jrdt|jzSdS)z;Return the 'extras_require' suffix for a given requirement.r$)r2r(reqs rrrVs $'JJ3SZZ 6B6rc<tt|}d|_|S)z=Given a Requirement, remove environment markers and return itN)r r(r2)r;r"s rr.r.[sCHAAH Hrc|j Sr')r2r:s rr1r1bszz>rcbt|xsd}d}t||}|j|y)Nc |dzS)N r?)lines r append_crz&_write_requirements..append_cris d{r)r r- writelines)streamreqslinesrCs r_write_requirementsrHfs1   #E  5 !E erc |j}tj}t|jxsd|j xsi\}}t ||t|D]:}|jdjditt |||<|jd||jy)Nr?z [{extra}] requirements) distributionioStringIOrrrrHsortedwriteformatvarswrite_or_delete_filegetvalue)cmdbasenamefilenamedistdatarrextras rwrite_requirementsrZps   D ;;=D'/ #T%8%8%>B($n./' )?))3DF34D."78(^Xt}}Grctj}t||jj|j d||j y)Nzsetup-requirements)rLrMrHrKsetup_requiresrRrS)rTrUrVrXs rwrite_setup_requirementsr]}s< ;;=Dc..==>18T]]_Mr)!__doc__rL collectionsr itertoolsrtypingrrrrr r9r extern.jaraco.textr extern.packaging.requirementsr r_Orderedr_ordered _StrOrIterr(rrrrr.r1rHrZr]r?rrrgs #!66,7 T] D>     H H29#z/2JH 49d3S >* *+H S(;' '($4 429#x ?T:T2U4 49d3S >* *+4@7   HNr