K i `dZddlZddlZddlZddlmZddlmZd dZGddZ dZ d Z y) zReusable functions and classes for different types of integration tests. For example ``Archive`` can be used to check the contents of distribution built with setuptools, and ``run`` will always try to be as verbose as possible to facilitate debugging. N)Path)ZipFilec ztj|ddditj|xsi}|jdz|j z}t dt d|d|jd||jd k(r|Stj|j||j|j ) NTutf-8)capture_outputtextencodingenv z<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~z Command: z return code: z r) subprocessrunosenvironstdoutstderrprint returncodeCalledProcessError)cmdr routs j/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/setuptools/tests/integration/helpers.pyr r s   )rzz )ciR )  A ((T/AHH $C HI IcU/!,,tC5 AB||q  ' ' c188QXX NNc(eZdZdZdZdZdZdZy)Archivez5Compatibility layer for ZipFile/Info and TarFile/Infoc||_|jdrtj|d|_y|jdrt ||_yt |d)Nztar.gzr:gzzipz# doesn't seem to be a zip or tar.gz) _filenameendswithtarfileopen_objr ValueError)selffilenames r__init__zArchive.__init__&sV!   X & Xv6DI   u %)DIz)LMN Nrct|jdr#t|jjSt|jS)Ninfolist)hasattrr#iterr))r%s r__iter__zArchive.__iter__/s6 499j ) **,- -DIIrcJt|dr |jS|jS)Nr&)r*r&name)r%zip_or_tar_infos rget_namezArchive.get_name4s$ ?J /"++ +###rc4t|jdr^|jj|}|'d|jd|j}t |t |jdSt |jj|dS)N extractfilezInvalid z in r)r*r#r2r.rr$strread)r%r/contentmsgs r get_contentzArchive.get_content9s~ 499m ,ii++O>:JK o%w||~w/ /499>>/2G<z$get_sdist_members..Gs#;chhqwwqr{+;s(*)r!r"getnamesr) sdist_pathtarrDfilesrelative_filess rget_sdist_membersrKCsl j& )2S"%,,.1Qa112rTs6 O(==@,'r