K i-rddlZddlZddlZddlZddlZddlZddlZddlmZddl Z ddl Z ddl Z ddl mZddlmZmZddlmZe j(dZe j(dZe j(d d d Ze j(d Ze j(dZdZe j(d dZe j(d dZe j(dZe j(dZe j(dZdZ dZ!dZ"dZ#dde!dddfdZ$e j(dZ%y)N)Path) safer_name)contexts environment)DALSc#RKtj5}|jd|tj5}|jd|tj5ddddddddddy#1swYxYw#1swYxYw#1swYyxYww)za Override site.USER_BASE and site.USER_SITE with temporary directories in a context. zsite.USER_BASEzsite.USER_SITEN)rtempdirsetattrsave_user_site_setting) monkeypatch user_base user_sites _/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/setuptools/tests/fixtures.py user_overriders    y,i8     9    0) <002       sKB''B'B%B*B2B: B'B BB BB$ B'c#^K|j5}|dddy#1swYyxYwwN)as_cwd)tmpdirorigs r tmpdir_cwdr"s* D s-! -*-Tsession)autousescopec|jjjdsytjt 5t jjddddy#1swYyxYw)z Workaround pytest-dev/pytest-xdist#376 ``pytest-xdist`` tends to inject '' into ``sys.path``, which may break certain isolation expectations. Remove the entry so the import machinery behaves the same irrespective of xdist. xdistN) config pluginmanager has_plugin contextlibsuppress ValueErrorsyspathremove)requests rworkaround_xdist_376r((sR >> ' ' 2 27 ;   Z ( s A))A2cgd} tj|t||dz S#t$rt j dY|dz SwxYw)z< Clone the 'sampleproject' and return a path to it. )gitclonez%https://github.com/pypa/sampleproject)cwdzUnable to clone sampleproject sampleproject) subprocess check_callstr Exceptionpytestskip)tmp_pathcmds rsample_projectr69sY DC5cs8}5 o %% 5 34 o %%5s +AAc#hKtj|5ddddy#1swYyxYwwr)r%r)r6s rsample_project_cwdr8Fs) > " s2& 2/2c tj||d5}t|jdd}t|jdd}|r|r ||fcdddSt |j j djrJtjtjdddt|t|j j gt |j j djrJt|jdt|jdfcdddS#1swYyxYw)N dist_buildz*.tar.gzz*.whlzbuild/lib/build-mbuildz--outdir) rsession_locked_tmp_dirnextglobrrrootdirexistsr. check_outputr$ executabler0)tmp_path_factoryr'tmpsdistwheels r_build_distributionsrHTs"  ( (!< C SXXj)40SXXg&- U5> CC..0ABIIKKK NN    H && ' !  ..0ABIIKKKCHHZ()40A+BB/CCCs>E  C"E  E)rctjd}|r8tjj|rt |j St ||\}}|S)NPRE_BUILT_SETUPTOOLS_SDISTosgetenvr%rArresolverH)rDr'prebuiltrF_s rsetuptools_sdistrQosLyy56HBGGNN8,H~%%''#$4g>HE1 Lctjd}|r8tjj|rt |j St ||\}}|S)NPRE_BUILT_SETUPTOOLS_WHEELrK)rDr'rOrPrGs rsetuptools_wheelrUysLyy56HBGGNN8,H~%%''#$4g>HAu LrRctj}tj|dz |_ddg|_t ||_tjd5|jcdddS#1swYyxYw)z?Virtual env with the version of setuptools under test installedvenv--no-setuptoolsz--wheel=bundleN) PYTHONPATH) r VirtualEnvr%rroot create_optsr0reqrcreate)r4rUenvs rrWrWso  "CyyF*+CH(*:;CO"#CG    .zz|s !A;;Bctj}tj|dz |_ddg|_|j |S)z7Virtual env without any version of setuptools installedvenv_without_setuptoolsrX --no-wheelrrZr%rr[r\ ensure_envr4r_s rrarasC  "Cyy$==>CH(,7CONN JrRctj}tj|dz |_gd|_|j |S)z1Virtual env without any common packages installed bare_venv)rXz--no-piprbz --no-seedrcres rrgrgs=  "CyyK/0CHPCONN JrRct|dkDsJtj|d5}|D]\}}tj|j d}tj |}t|j|_ttj|_ |j|| dddy#1swYyxYw)z Create a simple sdist tarball at dist_path, containing the files listed in ``files`` as ``(filename, content)`` tuples. rzw:gzutf-8)name)fileobjN) lentarfileopenioBytesIOencodeTarInfogetvaluesizeinttimemtimeaddfile) dist_pathfilesdistfilenamecontent file_bytes file_infos r make_sdistrs u:>> i (8D!& 8 HgGNN7$;?WW__T23   ,ww||D*-HHHX! /D$((.E~++--"!%%/ NNdV2eW- . /#' #  &IIg&YYx(   #% bggll8[13 I)Q '()     bggll8Z0# H6A !$4456'',,t(;'rs    0#   I. /   & &C6i !i !*8"4!!H4 #JZ&&rR