ruạṛ
a �u:j � @ s~ d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z m Z dZdZej dd � �Zej d d� �ZG dd � d �ZdS )z develop tests� N)�paths_on_pythonpath� )�contexts� namespaceszHfrom setuptools import setup setup(name='foo', packages=['foo'], ) zprint "foo" c c sr t �� �V}t �� �.}| �d|� | �d|� d V W d � n1 sF0 Y W d � n1 sd0 Y d S )Nzsite.USER_BASEzsite.USER_SITE)r �tempdir�setattr)Zmonkeypatch� user_base� user_site� r �P/opt/bart/bart_venv/lib/python3.9/site-packages/setuptools/tests/test_develop.py� temp_user s r c c s� | }|� d�}|d }|�� r*tt|���|�d��}|�t� W d � n1 sT0 Y |d }|�d��}|�t� W d � n1 s�0 Y |�� � |V W d � n1 s�0 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�initr r r �test_env# s (( r c @ s\ e Zd Zedd� �Zejjee j �d��dd�ejje� � dkdd�ejjdd � ���Zd S )�TestNamespacesc C sx t jdddt|�g}| �� �H tt|�g�� t�|� W d � n1 sL0 Y W d � n1 sj0 Y d S )Nr Zdevelopz --install-dir)�sys� executable�strr r � subprocess� check_call)�src_dirr Zdevelop_cmdr r r �install_develop4 s � zTestNamespaces.install_developZAPPVEYORz-https://github.com/pypa/setuptools/issues/851)�reason�PyPyz.https://github.com/pypa/setuptools/issues/1202c C s� t �|d�}t �|d�}|d }tjdddt|�dt|�g}t�|� | �||� t �|� tjdd g}t t|�g�� t�|� W d � n1 s�0 Y tjddg}t t|�g�� t�|� W d � n1 s�0 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.pkgB�packagesz-m�pip�installz-tz-cz"import myns.pkgA; import myns.pkgBNzimport pkg_resources) r Zbuild_namespace_packager r! r"