U
    «ÃT_Î  ã                   @   sf   d dl Z d dlmZ er,d dlmZmZmZ dZddd„Zdd	„ Z	d
d„ Z
dd„ Zdd„ Zdd„ ZdS )é    N)ÚMYPY_CHECK_RUNNING)ÚListÚOptionalÚSequencezÅimport sys, setuptools, tokenize; sys.argv[0] = {0!r}; __file__={0!r};f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))Fc                 C   sF   t jg}|r|dg7 }|dt | ¡g7 }|r4||7 }|rB|dg7 }|S )ao  
    Get setuptools command arguments with shim wrapped setup file invocation.

    :param setup_py_path: The path to setup.py to be wrapped.
    :param global_options: Additional global options.
    :param no_user_config: If True, disables personal user configuration.
    :param unbuffered_output: If True, adds the unbuffered switch to the
     argument list.
    z-uz-cú--no-user-cfg)ÚsysÚ
executableÚ_SETUPTOOLS_SHIMÚformat)Úsetup_py_pathÚglobal_optionsÚno_user_configÚunbuffered_outputÚargs© r   úH/tmp/pip-unpacked-wheel-8u7dkzi1/pip/_internal/utils/setuptools_build.pyÚmake_setuptools_shim_args   s    

r   c                 C   s(   t | |dd�}|dd|g7 }||7 }|S )NT©r   r   Úbdist_wheelz-d©r   )r   r   Úbuild_optionsÚdestination_dirr   r   r   r   Ú make_setuptools_bdist_wheel_args2   s    ýr   c                 C   s   t | |dd�}|ddg7 }|S )NTr   Úcleanz--allr   )r   r   r   r   r   r   Úmake_setuptools_clean_argsG   s    ýr   c                 C   sf   |r|rt ‚t| ||d�}|ddg7 }||7 }|r>|d|g7 }|d k	rR|d|g7 }|rb|ddg7 }|S )N)r   r   Údevelopz	--no-depsú--prefixú--homeú--userú	--prefix=©ÚAssertionErrorr   )r   r   Úinstall_optionsr   ÚprefixÚhomeÚuse_user_siter   r   r   r   Úmake_setuptools_develop_argsU   s    
ýr&   c                 C   s4   t | ƒ}|r|dg7 }|dg7 }|r0|d|g7 }|S )Nr   Úegg_infoz
--egg-baser   )r   Úegg_info_dirr   r   r   r   r   Úmake_setuptools_egg_info_argsv   s    

r)   c                 C   sÂ   |r|rt ‚|r|rt ‚t| ||	dd�}|dd|g7 }|dg7 }|d k	rT|d|g7 }|d k	rh|d|g7 }|d k	r||d|g7 }|rŒ|d	d
g7 }|
rœ|dg7 }n
|dg7 }|r¶|d|g7 }||7 }|S )NT)r   r   r   Úinstallz--recordz#--single-version-externally-managedz--rootr   r   r   r   z	--compilez--no-compilez--install-headersr    )r   r   r"   Úrecord_filenameÚrootr#   Ú
header_dirr$   r%   r   Ú	pycompiler   r   r   r   Úmake_setuptools_install_argsˆ   s2    ü

r/   )NFF)r   Úpip._internal.utils.typingr   Útypingr   r   r   r	   r   r   r   r&   r)   r/   r   r   r   r   Ú<module>   s   	ÿ   ü
!