Eo_|ZddlZddlZddlZddlZddlZddlZddlZddlmZddl Z ddl Z ddl Z ddl mZddlmZmZddlmZe jdZe jdZe jd d d Ze jd Ze jdZdZe jd dZe jd dZe jdZe jdZe jdZdZ dZ!dZ"dZ#dde!dddfdZ$e jdZ%dS)N)Path) safer_name)contexts environment)DALSc#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 k/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/setuptools/tests/fixtures.py user_overriderst    y,i888     9    0) < < <022                                sY*B**B*A;/ B;A? ?BA? B B*B B*B B**B.1B.c#lK|5}|VddddS#1swxYwYdSN)as_cwd)tmpdirorigs r tmpdir_cwdr"s~ D  )--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_projectr79sq D C CC5cs8}}55555 555 3444445 o %%s#*A  A c#lKtj|5dVddddS#1swxYwYdSr)r&r)r7s rsample_project_cwdr9Fs > " " rc 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/build-mbuildz--outdir) rsession_locked_tmp_dirnextglobrrrootdirexistsr/ check_outputr% executabler1)tmp_path_factoryr(tmpsdistwheels r_build_distributionsrITs  (!<  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&rBrresolverI)rEr(prebuiltrG_s rsetuptools_sdistrRos`y566H(BGNN8,,(H~~%%'''#$4g>>HE1 Lctjd}|r@tj|r!t |St ||\}}|S)NPRE_BUILT_SETUPTOOLS_WHEELrL)rEr(rPrQrHs rsetuptools_wheelrVys`y566H(BGNN8,,(H~~%%'''#$4g>>HAu LrSc 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_optsr1reqrcreate)r5rVenvs rrXrXs  " "CyF*++CH(*:;CO"##CG   . . .zz||s"BB Bctj}tj|dz |_ddg|_||S)z7Virtual env without any version of setuptools installedvenv_without_setuptoolsrY --no-wheelrr[r&rr\r] ensure_envr5r`s rrbrbsJ  " "Cy$==>>CH(,7CONN JrSctj}tj|dz |_gd|_||S)z1Virtual env without any common packages installed bare_venv)rYz--no-piprcz --no-seedrdrfs rrhrhsJ  " "CyK/00CHPPPCONN JrSct|dksJtj|d5}|D]\}}tj|d}tj|}t||_ttj |_ | || ddddS#1swxYwYdS)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 8 HgGNN7$;$;<z$make_nspkg_sdist..s-JJJ#tt%%JJJrSrzE import setuptools setuptools.setup( name=z, version=z, packages=z", namespace_packages=[z] ) z7__import__('pkg_resources').declare_namespace(__name__)r __init__.pyNr) splitrangermrrMr&rappendr) rzrr nspackagepackagessetup_pyinitr{packager}rs @rmake_nspkg_sdistrsA (???? NN3  EaIJJJJq#e**q.1I1IJJJH           "+      H ED( #bgll9m&L&Ld%S TEABB<%%7<'--"4"4 "FH h^$$$$y%     rSc tt|dtd|||fdgdS)Nrz import setuptools setuptools.setup( name={name!r}, version={version!r}, python_requires={python_requires!r}, ) )rkrpython_requiresr)rrformat)rzrrrs rmake_python_requires_sdistrsd  &!7O  ! rSfoobarz0.1ct|}dd|d|gtj|gd}|r||tj|d} tj| |rg} g} |D]}} || } | dvr| }n| }t| ttfrd| } | | d| ~tdd | d |  }nd }ttj| d d d5}||dddn #1swxYwY|td}ttj| dd d5}|||zdddn #1swxYwYtj||d|d}||||| S)aCreates a source tree under path for a trivial test package that has a single requirement in setup_requires--a tarball for that requirement is also created and added to the dependency_links argument. ``distname`` and ``version`` refer to the name/version of the package that the test package requires via ``setup_requires``. The name of the test package itself is just 'test_pkg'. test_pkgz0.0z==)rkrsetup_requiresdependency_linksz name version;z: zg [metadata] {metadata} [options] {options}  )optionsmetadatarrwrj)encodingNzI import setuptools setuptools.setup(**%r) r-z.tar.gz)rrMr&abspathupdatermkdirpopr isinstancetuplelistrrrrowrite)r&rr make_packagesetup_py_template setup_attrs use_setup_cfgnormalized_distnametest_setup_attrsrrrrkvaluesectiontest_setup_cfg_contentsf foobar_paths rcreate_setup_requires_packagers$%X..1>>W>>?W__T223  - ,,,w||D*--HHX%! / /D$((..E~++----"!%%// ( NNd--e-- . . . ."& # #  &IIg&&YYx((    #% bgll8[113 I I I)Q '((()))))))))))))))      bgll8Z00# H H H6A !$44555666666666666666',,t(;%N%Ng%N%N%NOOKLh000 Os$ F++F/2F/7HH #H c<tdtdtddddddid }|gd |d z }|tj|| |d d|S)Nz [build-system] requires = ["setuptools"] build-backend = "setuptools.build_meta" z __import__('setuptools').setup( pbr=True, setup_requires=["pbr"], ) z [metadata] name = mypkg [files] packages = mypkg rzprint('Hello world!'))rzhello.pyztest.txtzAnother file in here.)zpyproject.tomlrrmypkgother)pythonr<pipinstallpbrr)prefix PBR_VERSIONz0.42)rrunrjaracor&r=setenv)r5r rXr{rs r pbr_packageras          /  56=  E@ HH 6 6 6777  F LLNNN KeF+++}f--- MrS)&r"rprMr/r%rnrwpathlibr jaraco.pathrr&r3setuptools._normalizationrrrrtextwraprfixturerrr)r7r9rIrRrVrXrbrhrrrrrrrrSrrs    000000########    I...  /.   & & &CCC6i   ! i   ! *888"4!!!!!!H4 #JJJJZ&&&&&rS