File: //usr/local/lib/python3.10/dist-packages/setuptools/tests/__pycache__/test_develop.cpython-310.pyc
o
��h � @ 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 s� � t �� �4}t �� �}| �d|� | �d|� d V W d � n1 s$w Y W d � d S W d � d S 1 s<w Y d S )Nzsite.USER_BASEzsite.USER_SITE)r �tempdir�setattr)�monkeypatch� user_base� user_site� r �H/usr/local/lib/python3.10/dist-packages/setuptools/tests/test_develop.py� temp_user s �
��"�r
c c s� � | }|� d�}|d }|�� rtt|���|�d��
}|�t� W d � n1 s+w Y |d }|�d��
}|�t� W d � n1 sIw Y |�� � |V W d � d S 1 saw 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 s� t jdddt|�g}| �� �- tt|�g��
t�|� W d � n1 s&w Y W d � d S W d � d S 1 s>w Y d S )Nr �developz
--install-dir)�sys�
executable�strr r �
subprocess�
check_call)�src_dirr �develop_cmdr r r �install_develop4 s �
��"�zTestNamespaces.install_develop�APPVEYORz-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 sKw Y tjddg}t t|�g�� t�|� W d
� d
S 1 snw 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 �build_namespace_packager"