3
ûâdeY  ã               @   s  d dl Z d dlmZmZmZ dZdeee eeee dœdd„Zeee ee eee dœd	d
„Z	eee ee dœdd„Z
eee ee eee ee eee dœdd„Zeee eee dœdd„Zeee ee eee ee ee ee eeeee dœdd„ZdS )é    N)ÚListÚOptionalÚSequencea'  import io, os, sys, setuptools, tokenize; sys.argv[0] = {0!r}; __file__={0!r};f = getattr(tokenize, 'open', open)(__file__) if os.path.exists(__file__) else io.StringIO('from setuptools import setup; setup()');code = f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))F)Úsetup_py_pathÚglobal_optionsÚno_user_configÚunbuffered_outputÚreturnc             C   sF   t jg}|r|dg7 }|dtj| ƒ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-cz--no-user-cfg)ÚsysÚ
executableÚ_SETUPTOOLS_SHIMÚformat)r   r   r   r   Úargs© r   úC/tmp/pip-build-red6nood/pip/pip/_internal/utils/setuptools_build.pyÚmake_setuptools_shim_args   s    

r   )r   r   Úbuild_optionsÚdestination_dirr	   c             C   s(   t | |dd�}|dd|g7 }||7 }|S )NT)r   r   Úbdist_wheelz-d)r   )r   r   r   r   r   r   r   r   Ú make_setuptools_bdist_wheel_args/   s
    
r   )r   r   r	   c             C   s   t | |dd�}|ddg7 }|S )NT)r   r   Úcleanz--all)r   )r   r   r   r   r   r   Úmake_setuptools_clean_argsA   s    r   )r   r   Úinstall_optionsr   ÚprefixÚhomeÚuse_user_siter	   c             C   sh   |o| st ‚t| ||d�}|ddg7 }||7 }|r@|d|g7 }|d k	rT|d|g7 }|rd|ddg7 }|S )N)r   r   Údevelopz	--no-depsz--prefixz--install-dirz--userz	--prefix=)ÚAssertionErrorr   )r   r   r   r   r   r   r   r   r   r   r   Úmake_setuptools_develop_argsL   s    	r   )r   Úegg_info_dirr   r	   c             C   s*   t | |d�}|dg7 }|r&|d|g7 }|S )N)r   Úegg_infoz
--egg-base)r   )r   r   r   r   r   r   r   Úmake_setuptools_egg_info_argsl   s
    
r!   )r   r   r   Úrecord_filenameÚrootr   Ú
header_dirr   r   r   Ú	pycompiler	   c             C   sÆ   |o| st ‚|o| st ‚t| ||	dd�}|dd|g7 }|dg7 }|d k	rX|d|g7 }|d k	rl|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--rootz--prefixz--homez--userz	--prefix=z	--compilez--no-compilez--install-headers)r   r   )r   r   r   r"   r#   r   r$   r   r   r   r%   r   r   r   r   Úmake_setuptools_install_args{   s0    

r'   )NFF)r
   Útypingr   r   r   r   ÚstrÚboolr   r   r   r   r!   r'   r   r   r   r   Ú<module>   sL   	  	