
    ϶vg                        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ZddlmZ ddl	m
Z
 ddlmZ ddlmZmZ dZd	Zej        d
             Zej        d             Z G d d          Z G d d          Z G d d          ZdS )zdevelop tests    N)paths_on_pythonpath)develop)Distribution   )contexts
namespaceszHfrom setuptools import setup

setup(name='foo',
    packages=['foo'],
)
zprint "foo"
c              #     K   t          j                    5 }t          j                    5 }|                     d|           |                     d|           d V  d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Nzsite.USER_BASEzsite.USER_SITE)r   tempdirsetattr)monkeypatch	user_base	user_sites      Z/var/www/pixelcanvas.ch/venv/lib/python3.11/site-packages/setuptools/tests/test_develop.py	temp_userr      s     				 y 	9 0)<<< 0)<<<EEE	 	 	 	 	 	 	 	 	 	 	 	 	 	 	                 s4   A?1A'A?'A+	+A?.A+	/A??BBc              #   *  K   | }|                     d          }|dz  }|                                rt          t          |                    |                    d          5 }|                    t                     d d d            n# 1 swxY w Y   |dz  }|                    d          5 }|                    t                     d d d            n# 1 swxY w Y   |                                5  |V  d d d            d S # 1 swxY w Y   d S )Nfoosetup.pywz__init__.py)	mkdirisfile
ValueErrordiropenwriteSETUP_PYINIT_PYas_cwd)tmpdirr   targetr   setupfinits          r   test_envr#   &   s     F
,,u

CZE||~~ &V%%%	C A	              D	3 1	              	                   s6   $BBB0CCC6DDDc                       e Zd Z eed          Z eed          oej        ej        k    Zd Z	e
j                            d          d             ZdS )TestDevelopreal_prefixbase_prefixc                    t          j        d           t          ddgdddgi          }t          |          }d|_        t          |          }|                                 ||_        |                                 dS )	z
        Test that console scripts are installed and that they reference
        only the project by name and not the current version.
        zTTODO: needs a fixture to cause 'develop' to be invoked without mutating environment.r   z0.0console_scriptszfoocmd = foo:foo)namepackagesversionentry_pointsr   N)	pytestskipdictr   script_namer   ensure_finalizedinstall_dirrun)selfr   settingsdistcmds        r   test_console_scriptsz TestDevelop.test_console_scripts:   s    
 	:	
 	
 	
 W!&$		
 	
 	
 H%%%dmm 					    z0legacy behavior retained for compatibility #4167reasonc                     t          d          }t          |          }t          |          }|                                 t	          j        |j                  }|j        dk    sJ |j        dk    sJ d S )NzFoo $$$ Bar_baz-bing)r*   z	.egg-linkFoo_Bar_baz_bing)	r0   r   r   r2   pathlibPathegg_linksuffixstem)r5   r6   r7   r8   links        r   test_egg_link_filenamez"TestDevelop.test_egg_link_filenameU   s    '
 
 
 H%%dmm|CL)){k))))y.......r:   N)__name__
__module____qualname__hasattrsysin_virtualenvr'   prefixin_venvr9   r.   markxfailrE    r:   r   r%   r%   6   s        GC//Mgc=))Kco.KG  6 [PQQ	/ 	/ RQ	/ 	/ 	/r:   r%   c                   $    e Zd ZdZd Zd Zd ZdS )TestResolverz
    TODO: These tests were written with a minimal understanding
    of what _resolve_setup_path is intending to do. Come up with
    more meaningful cases that look like real-world scenarios.
    c                 >    t          j        ddd          dk    sJ d S )N.r   _resolve_setup_pathr5   s    r   test_resolve_setup_path_cwdz(TestResolver.test_resolve_setup_path_cwdi   s(    *3S99S@@@@@@r:   c                 >    t          j        ddd          dk    sJ d S )NpkgsrT   ../rU   rW   s    r   test_resolve_setup_path_one_dirz,TestResolver.test_resolve_setup_path_one_dirl   s(    *63??5HHHHHHr:   c                 >    t          j        ddd          dk    sJ d S )Nzpkgs/rT   rZ   r[   rU   rW   s    r   .test_resolve_setup_path_one_dir_trailing_slashz;TestResolver.test_resolve_setup_path_one_dir_trailing_slasho   s(    *7C@@EIIIIIIr:   N)rF   rG   rH   __doc__rX   r\   r^   rP   r:   r   rR   rR   b   sV         A A AI I IJ J J J Jr:   rR   c                      e Zd Zed             Zej                             ee	j
                            d                    d          ej                             ej                    dk    d          d                         ZdS )	TestNamespacesc                 .   t           j        dddt          |          g}|                                 5  t	          t          |          g          5  t          j        |           d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Nr   r   z--install-dir)rJ   
executablestrr   r   
subprocess
check_call)src_dirr   develop_cmds      r   install_developzTestNamespaces.install_developt   s    NKK
 ^^ 	3 	3$c&kk]33 3 3%k2223 3 3 3 3 3 3 3 3 3 3 3 3 3 3	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3s5   B
A2&B
2A6	6B
9A6	:B

BBAPPVEYORz-https://github.com/pypa/setuptools/issues/851r;   PyPyz.https://github.com/pypa/setuptools/issues/1202c           	         t          j        |d          }t          j        |d          }|dz  }t          j        dddt	          |          dt	          |          g}t          j        |           |                     ||           t          j        |           t          j        dd	g}t          t	          |          g          5  t          j        |           d
d
d
           n# 1 swxY w Y   t          j        ddg}t          t	          |          g          5  t          j        |           d
d
d
           d
S # 1 swxY w Y   d
S )a  
        Installing two packages sharing the same namespace, one installed
        naturally using pip or `--single-version-externally-managed`
        and the other installed using `develop` should leave the namespace
        in tact and both packages reachable by import.
        z	myns.pkgAz	myns.pkgBr+   z-mpipinstallz-tz-cz"import myns.pkgA; import myns.pkgBNzimport pkg_resources)
r   build_namespace_packagerJ   rc   rd   re   rf   ri   make_site_dirr   )r5   r   pkg_Apkg_Br   install_cmd
try_importpkg_resources_imps           r   !test_namespace_package_importablez0TestNamespaces.test_namespace_package_importable   s    26;GG26;GG*$ NJJKK
 	k***UF+++ (((N0


 !#f++// 	. 	.!*---	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	.
 N"

 !#f++// 	5 	5!"3444	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5s$   C((C,/C,EEEN)rF   rG   rH   staticmethodri   r.   rN   skipifboolosenvirongetplatformpython_implementationrv   rP   r:   r   ra   ra   s   s        
3 
3 \
3 [RZ^^J''((>    [&&((F2?   &5 &5	 	 &5 &5 &5r:   ra   )r_   rz   r?   r}   re   rJ   r.   setuptools._pathr   setuptools.command.developr   setuptools.distr    r   r   r   r   fixturer   r#   r%   rR   ra   rP   r:   r   <module>r      se     				       



  0 0 0 0 0 0 . . . . . . ( ( ( ( ( ( " " " " " " " "      )/ )/ )/ )/ )/ )/ )/ )/XJ J J J J J J J"<5 <5 <5 <5 <5 <5 <5 <5 <5 <5r:   