\bgMddlZddlZddlZddlZddlmZddlZddlZddlm Z m Z ej dZ ej dZ ej dd d Zej d Zd Zej d dZej d dZej dZej dZej dZdS)N)Path)contexts environmentc#nKtj5}|d|tj5}|d|tj5dVdddn #1swxYwYdddn #1swxYwYddddS#1swxYwYdS)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 j/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/setuptools/tests/fixtures.py user_overrider st    y,i888     9    0) < < <022                                sY*B**B*A;/ B;A? ?BA? B B*B B*B B**B.1B.c#lK|5}|VddddS#1swxYwYdS)N)as_cwd)tmpdirorigs r tmpdir_cwdrs~ D s )--Tsession)autousescopec|jjdsdStjt 5t jdddddS#1swxYwYdS)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%!s > ' 2 27 ; ;  Z ( ( s A((A,/A,cgd} tj|t|n$#t$rt jdYnwxYw|dz S)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_projectr32sq D C CC5cs8}}55555 555 3444445 o %%s#*A  A c tj||d5}t|dd}t|dd}|r|r||fcdddSt |jjdrJtj tj dddt|t|jjgt |jjdrJt|dt|dfcdddS#1swxYwYdS)N dist_buildz*.tar.gzz*.whlzbuild/lib/buildz-mbuildz--outdir) rsession_locked_tmp_dirnextglobrrrootdirexistsr+ check_outputr! executabler-)tmp_path_factoryr$tmpsdistwheels r_build_distributionsrBGs  (!<  C SXXj))400SXXg&&--  "U "5> CCCCCCCC.0ABBIIKKKKK N    HH & ' ' !    .0ABBIIKKKKKCHHZ(())40A0A+B+BB/CCCCCCCCCCCCCCCCCCsAE&2C'E&&E*-E*)rctjd}|r@tj|r!t |St ||\}}|S)NPRE_BUILT_SETUPTOOLS_SDISTosgetenvr"r;rresolverB)r>r$prebuiltr@_s rsetuptools_sdistrKbs`y566H(BGNN8,,(H~~%%'''#$4g>>HE1 Lctjd}|r@tj|r!t |St ||\}}|S)NPRE_BUILT_SETUPTOOLS_WHEELrE)r>r$rIrJrAs rsetuptools_wheelrOls`y566H(BGNN8,,(H~~%%'''#$4g>>HAu LrLc tj}tj|dz |_ddg|_t ||_tjd5| cdddS#1swxYwYdS)z?Virtual env with the version of setuptools under test installedvenv--no-setuptoolsz--wheel=bundleN) PYTHONPATH) r VirtualEnvr"rroot create_optsr-reqrcreate)r1rOenvs rrQrQvs  " "CyF*++CH(*:;CO"##CG   . . .zz||s"BB Bctj}tj|dz |_ddg|_||S)z7Virtual env without any version of setuptools installedvenv_without_setuptoolsrR --no-wheelrrTr"rrUrV ensure_envr1rYs rr[r[sJ  " "Cy$==>>CH(,7CONN JrLctj}tj|dz |_gd|_||S)z1Virtual env without any common packages installed bare_venv)rRz--no-pipr\z --no-seedr]r_s rrarasJ  " "CyK/00CHPPPCONN JrL)rrFr+r!pathlibrr"r/rrrfixturerrr%r3rBrKrOrQr[rarLrres   ########    I...  /.   & & &(CCC6i   ! i   ! *rL