
    7f+                     `   d Z ddlZddlZddlZddlZddlZddlmZ ddl	mZ
 ddlmZ ej                            dd          Zd Zej        d	             Zd
 Zd Zej        j        d             Zd Zej        j        ej                            d          d                         Zd ZdS )z<Run some integration tests.

Try to install a few packages.
    N)easy_install)DistributionzMplatform.python_implementation() == "PyPy" and platform.system() == "Windows"zpypa/setuptools#2496)reasonc           	      `   d}|D ]O}	 t          |           d}t          j         |j        di t	                                 @# t
          $ r Y Lw xY w	 t          j                            d           d S # t          $ r,}t          j        t          |                     Y d }~d S d }~ww xY w)N)	stevedorevirtualenvwrapperpbr
novaclientz4Integration tests cannot run when {pkg} is installedzhttps://pypi.python.org/pypi )
__import__pytestskipformatlocalsImportErrorurllibrequesturlopen	Exceptionstr)modulepackagespkgtmplexcs        _/home/feoh/.local/pipx/shared/lib/python3.11/site-packages/setuptools/tests/test_integration.pysetup_moduler      s    DH  	sOOOIDK//fhh//0000 	 	 	D	=>>>>>   CHHs)   <A
AAA7 7
B-!B((B-c                   	 |                     d          |                     d          |                     d          	|                     d          	fd}|                     |                                                              t          d	j                                       dj                                       d	j                                       d	t          j        j        gz                                  d
t          t          j        j                            t          j                                       t                      }t          |          }j        |_        |S )z3Fixture to set up temporary installation directory.cwd	user_base	user_siteinstall_dirc                                                                                                                                                                                             d S )N)undoremove)r"   monkeypatchnew_cwdr    r!   s   r   finzinstall_context.<locals>.fin1   sc     	    __file__zsite.USER_BASEzsite.USER_SITEzsys.path
PYTHONPATH)mkdiraddfinalizerchdirsetattreasy_install_pkgstrpathsyspathsetenvr   ospathsepjoinr   r   r"   )
r   tmpdirr&   r(   distcmdr"   r'   r    r!   s
     `   @@@@r   install_contextr;   (   sr    ll5!!G[))I[))I,,}--K          g(*i6GHHH()*;<<<()*;<<<
CH0C/D$DEEE|S)=)=ch)G)G%H%HIII >>D
t

C!)COJr)   c                 r   | g|_         |                                 |                                 |j        }t	          j        t
          j                            ||dz                       }|sJ t
          j                            t
          j                            |d         ||                    sJ d S )Nz*.eggr   )	argsensure_finalizedrunr"   globr5   r3   r7   exists)requirementr:   pkgname
modulenametarget	dest_paths         r   _install_onerG   L   s    }CHGGIII_F	"',,vw/@AABBI7>>"',,y|WjIIJJJJJJJr)   c                 *    t          d| dd           d S )Nr   zextension.pyrG   r;   s    r   test_stevedorerK   V   s    o{NKKKKKr)   c                 *    t          d| dd           d S )Nr   zhook_loader.pyrI   rJ   s    r   test_virtualenvwrapperrM   Z   s)    _.ACS    r)   c                 *    t          d| dd           d S )Nr	   zcore.pyrI   rJ   s    r   test_pbrrO   a   s    	:::::r)   z(ignore:'encoding' argument not specifiedc                 *    t          d| dd           d S )Nzpython-novaclientr
   zbase.pyrI   rJ   s    r   test_python_novaclientrQ   e   s     $o|YOOOOOr)   c                     t          d| dd           | j        d         }t          j                            t          j                            |j        dd                    sJ dS )z
    Install the pyuri package (version 0.3.1 at the time of writing).

    This is also a regression test for issue #1016.
    pyurizuri.pyz	uri.regexN)rG   installed_projectsr5   r3   rA   r7   location)r;   rS   s     r   
test_pyurirV   o   s[     /7H===.w7E 7>>"',,u~wLLMMMMMMMr)   )__doc__r@   r5   r2   urllib.requestr   r   setuptools.command.easy_installr   setuptools.commandr0   setuptools.distr   markskipif
pytestmarkr   fixturer;   rG   rK   xfailrM   rO   filterwarningsrQ   rV   r   r)   r   <module>rb      s{   
  				 



      8 8 8 8 8 8 ? ? ? ? ? ? ( ( ( ( ( ( [S!    
         FK K KL L L   ; ; ; FGG
P P HG PN N N N Nr)   