CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
test_namespaces.cpython-310.pyc46 linesDownload Raw Back to __pycache__
1o

2��Yi��@s:ddlZddlZddlmZddlmZGdd�d�ZdS)�N)�paths_on_pythonpath�)�3namespacesc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)4�TestNamespacesc	Cs�t�|d�}t�|d�}|d}|d}||f}tjdddt|�dt|�g}t�|�t�|�tjdddt|�dt|�g}t�|�tjd	d5g}tt	t|���t�|�Wd�dS1sawYdS)z�6        Installing two packages sharing the same namespace, one installed7        to a site dir and the other installed just to a path on PYTHONPATH8        should leave the namespace in tact and both packages reachable by9        import.10        �	myns.pkgA�	myns.pkgBz
site-packagesz
path-packages�-m�pip.__main__�install�-t�-cz"import myns.pkgA; import myns.pkgBN)11r�build_namespace_package�sys�12executable�str�13subprocess�14check_call�
make_site_dirr�map)	�self�tmpdir�pkg_A�pkg_B�
site_packagesZ
path_packages�targets�install_cmd�15try_import�r��E:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\setuptools/tests/test_namespaces.py�test_mixed_site_and_non_site16s>�17	18�19	�"�z+TestNamespaces.test_mixed_site_and_non_sitecCs�t�|d�}|d}|��tjddddt|�t|�g}tt|�g��
t�|�Wd�n1s3wYt�	|�tjdd	g}tt|�g��t�|�Wd�dS1s[wYdS)20zc21        Ensure that a namespace package doesn't break on import22        of pkg_resources.23        r�packagesr�pipr24rNrzimport pkg_resources)25rr
�mkdirrrrrrrr)rr�pkg�targetrrrrr�test_pkg_resources_import4s,�	�26�"�z(TestNamespaces.test_pkg_resources_importcCs�t�|d�}|d}tjdddt|�dt|�g}t�|�t�|�tjddg}tt|�g��tj|t|�d	�Wd27�d28S1sDwYd29S)z�30        Installing a namespace packages but also having it in the current31        working directory, only one version should take precedence.32        rr rr	r33rrz&import pkg_resources; import myns.pkgA��cwdN�	rr
rrrrrrr)rrrr$r�pkg_resources_imprrr�(test_namespace_package_installed_and_cwdPs&�34	35�"�z7TestNamespaces.test_namespace_package_installed_and_cwdcCs�t�|d�}t�|d�}|d}tjdddt|�dt|�g}t�|�t�|�tjdd	g}tt|�g��tj|t|�d36�Wd�dS1sJwYdS)z�37        Installing one namespace package and also have another in the same38        namespace in the current working directory, both of them must be39        importable.40        rrr rr	r41rrz8import pkg_resources; import myns.pkgA; import myns.pkgBr&Nr()rrrrr$rr)rrr�5test_packages_in_the_same_namespace_installed_and_cwdms(�42	43�"�zDTestNamespaces.test_packages_in_the_same_namespace_installed_and_cwdN)�__name__�44__module__�__qualname__rr%r*r+rrrrr	s45*r)rrZsetuptools._pathr�rrrrrr�<module>s46
Aluode/PerceptionLabPortable · CoolFace