K i|dZddlZddlZddlZddlZddlZddlmZddlZddl m Z ddl m Z eejjdZGd d ZGd d Zd ZdZy)z$Test .dist-info style distributions.N)partial)unpack_archive)DALSutf-8encodingc\eZdZdZdZej jdddZy) TestDistInfocHd}|dz j|dtjdtjtjz}t d|d}|j sJ|j|jsJt|jd rJy ) zA Supplying an invalid version crashes dist_info. z@[metadata] name=proj version=42 [egg_info] tag_build=invalid!!! setup.cfgrrzinvalid version dist_infoF)cwdcheck *.dist-infoN) write_textrecompileMIrun_command_inner returncodesearchstdoutlistglob)selftmp_pathconfigmsgprocs e/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/setuptools/tests/test_dist_info.pytest_invalid_versionz!TestDistInfo.test_invalid_versionsY K ++FW+Ejj*BDD244K8 (%Hzz$++&&& m45555cd}|dz j|dttdd|t|j d}|j j d sJtj|ttdd d |t|j d}|j j d sJy) Nz [metadata] name=proj version=42 [egg_info] tag_date=1 tag_build=.post r rrrz --no-daterrzproj-42z --tag-buildz.azproj-42a) rprint run_commandnextrname startswithshutilrmtree)rrrrs r"test_tag_argumentszTestDistInfo.test_tag_arguments s  K ++FW+E k+{AB}56 ~~((333 i  k+}dIJ}56 ~~((444r$ keep_egg_info)FTcd}|dz j|d|dz }|j|rdgng}tdd|g|d |itt |j d d k(sJtt |j d d k(sJt |}tt |j d |k(sJtt |j d d k(sJtt |j dd k(sJtt |j dd k(sJy)Nz [metadata] name=proj version=42 r rr__outz--keep-egg-inforz --output-dirrrrrz *.egg-infoz *.__bkp__)rmkdirr(lenrrint)rrr/routoptsexpected_egg_infos r"test_output_dirzTestDistInfo.test_output_dir4s'6 K ++FW+E  &3!"KJtJJ4/01Q6664 m456!;;; .4./04EEEE4 l345:::4-./14444 k234999r$N) __name__ __module__ __qualname__r#r.pytestmark parametrizer8r$r"r r s1 65( [[_m< := :r$r ceZdZdZedZgdZejjddjejjddgejjded Z y ) TestWheelCompatibilityzMake sure the .dist-info directory produced with the ``dist_info`` command is the same as the one produced by ``bdist_wheel``. ae [metadata] name = {name} version = {version} [options] install_requires = foo>=12; sys_platform != "linux" [options.extras_require] test = pytest [options.entry_points] console_scripts = executable-name = my_package.module:function discover = myproj = my_package.other_module:function ))rB).postz[egg_info] tag_build = post )rCz[egg_info] tag_build = .post )rCz)[egg_info] tag_build = post tag_date = 1 ).devz[egg_info] tag_build = .dev )rDz)[egg_info] tag_build = .dev tag_date = 1 )a1zgg_info] tag_build = .a1 )z+localz[egg_info] tag_build = +local r*zmy-proj my_proj my.proj My.Projversionz0.42.13)suffixcfgcj|jj|||z}dD].}||z j||z dz j|d0t d|dz t |j d }t||d z t |j d } t d |d z t |j d} | j| jk(sJ| jjd||sJdD]!} t| | z t| | z k(r!Jy)N)r*rF) dir_wheeldir_distr rr bdist_wheelrJr&zdir_wheel/dist/*.whlunpackzunpack/*.dist-inforrKzdir_dist/*.dist-infozmy_proj-)METADATAzentry_points.txt) SETUPCFGformatr2rr(r)rrr*r+read) rr*rFrrGrHriwheelwheel_dist_inforfiles r"&test_dist_info_is_the_same_as_in_wheelz=TestWheelCompatibility.test_dist_info_is_the_same_as_in_wheelks8 %%4%ACG( NA \ " \K ' 3 3FW 3 M N Mx+'=>X]]#9:;uh12x}}-ABCKX %:;'=>? ~~!5!5555~~((8G9VH)EFFF2 JD D()T/D2H-II II Jr$N) r9r:r;__doc__rrO EGG_INFO_OPTSr<r=r>splitrVr?r$r"rArAEs H* M [[V%F%L%L%NO [[Y 4 [[. >J?5PJr$rActjtjdddd|}tjddgt t |}tj|fi|S)NTr)stderrrtextr rz-cz __import__('setuptools').setup()) subprocessSTDOUTPIPEsys executablemapstrrun)cmdkwargsr6s r"rrs^##//     D >>4!C Tc#sm TC >># & &&r$c,t|i|jS)N)rr)argsrfs r"r(r(s d -f - 4 44r$)rWpathlibrr,r]r` functoolsrr<setuptools.archive_utilrtextwraprPath read_textrQr rArr(r?r$r"ros[*   2w||%%8/:/:d=J=J@ '5r$