efo dZddlZddlmZddlmZddlmZmZm Z m Z m Z ddl m Z ddlmZdd lmZe d ZeedfZeZe jZd ed e eefd e eeeeeefffdZd ed e eeeffdZd ed e eeefd e eeeeeefffdZdZdZdZdZdZdZ dS)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_requirereturnc@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 /builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/setuptools/command/_requirestxt.py_preparers" *. 9 9F -.> G GGctt}|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...Os(BB!s1vvBBBBBBrN)listrfromkeysmap _clean_req)r)kr!s rr*z5_move_install_requirements_markers..Msn Aq DBBs:q/A/ABBBBB C CDr) r+r rfilter _no_markerrr-r(markerrrr)rr inst_reqs simple_reqs complex_reqssimple_install_requiresr"expanded_extrass rrr6sU[!12233IY//Kz955L"3sK#8#899 ::sS]]*+66q9999#((**O #O 33rcB|jrdt|jzndS)z;Return the 'extras_require' suffix for a given requirement.r$)r2r(reqs rrrVs!$'J 63SZ B6rcLtt|}d|_|S)z=Given a Requirement, remove environment markers and return itN)r r(r2)r;r"s rr.r.[s!CHHAAH Hrc|j Sr')r2r:s rr1r1bs z>rcxt|pd}d}t||}||dS)Nc |dzS)N r?)lines r append_crz&_write_requirements..append_cris d{r)r r- writelines)streamreqslinesrCs r_write_requirementsrHfsM   # #E  5 ! !E erc |j}tj}t|jpd|jpi\}}t ||t|D]D}|dj ditt |||E| d|| dS)Nr?z [{extra}] requirements) distributionioStringIOrrrrHsortedwriteformatvarswrite_or_delete_filegetvalue)cmdbasenamefilenamedistdatarrextras rwrite_requirementsrZps  D ;==D'/ #T%8%>B(($n.///''99 )?)33DFF33444D."78888^Xt}}GGGGGrctj}t||jj|d||dS)Nzsetup-requirements)rLrMrHrKsetup_requiresrRrS)rTrUrVrXs rwrite_setup_requirementsr]}sJ ;==Dc.=>>>18T]]__MMMMMr)!__doc__rL collectionsr itertoolsrtypingrrrrr r9r extern.jaraco.textr extern.packaging.requirementsr r_Orderedr_ordered _StrOrIterr(rrrrr.r1rHrZr]r?rrrgs ######!!!!!!66666666666666,,,,,,777777 WT]] D>    H H29#z/2JH 49d3S >* *+HHHH S(;' '($4 429#x ?T:T2U4 49d3S >* *+4444@777     H H HNNNNNr