o
    Ëý°jð  ã                   @   s„   d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlm	Z	 d dl
Z
d dlmZ ddlmZ dd„ Zd	d
„ Zdd„ ZdS )é    N)Úlog)ÚDistutilsError)ÚWheelé   )ÚSetuptoolsDeprecationWarningc                 C   s(   t | tƒr	|  ¡ S t | ttfƒsJ ‚| S )z8Ensure find-links option end-up being a list of strings.)Ú
isinstanceÚstrÚsplitÚtupleÚlist)Ú
find_links© r   ú‡/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/setuptools/installer.pyÚ_fixup_find_links   s   
r   c                 C   sH  t  dt¡ zt d¡ W n tjy   |  dtj¡ Y nw t	|ƒ}|  
d¡}d|v r0tdƒ‚dtjvo9dtjv}d	tjv rBd
}nd|v rM|d d }nd
}d|v r_t|d d ƒd
d
… ng }| jrj| | j¡ tj |  ¡ ¡}t ¡ }t |¡D ]}||v rŠ| |¡rŠ|  S q{t ¡ �Š}	tjdddddd|	g}
|r¢|
 d¡ |d
ur­|
 d|f¡ |p°g D ]	}|
 d|f¡ q±|
 |jpÃt|ƒ¡ zt |
¡ W n tj yà } ztt|ƒƒ|‚d
}~ww t!t" "tj #|	d¡¡d ƒ}tj #|| $¡ ¡}| %|¡ t &|tj #|d¡¡}tj'j(||d�} | W  d
  ƒ S 1 �sw   Y  d
S )zLFetch an egg needed for building.

    Use pip/wheel to fetch/build a wheel.z\setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.Úwheelz,WARNING: The wheel package is not available.Úeasy_installÚallow_hostszQthe `allow-hosts` option is not supported when using pip to install requirements.Ú	PIP_QUIETÚPIP_VERBOSEÚPIP_INDEX_URLNÚ	index_urlr   r   z-mÚpipz--disable-pip-version-checkz	--no-depsz-wz--quietz--index-urlz--find-linksz*.whlr   zEGG-INFO)Úmetadata))ÚwarningsÚwarnr   Úpkg_resourcesÚget_distributionÚDistributionNotFoundÚannouncer   ÚWARNÚstrip_markerÚget_option_dictr   ÚosÚenvironr   Údependency_linksÚextendÚpathÚrealpathÚget_egg_cache_dirÚEnvironmentÚfind_distributionsÚcan_addÚtempfileÚTemporaryDirectoryÚsysÚ
executableÚappendÚurlr   Ú
subprocessÚ
check_callÚCalledProcessErrorr   ÚglobÚjoinÚegg_nameÚinstall_as_eggÚPathMetadataÚDistributionÚfrom_filename)ÚdistÚreqÚoptsÚquietr   r   Úeggs_dirÚenvironmentÚegg_distÚtmpdirÚcmdÚlinkÚer   Údist_locationÚdist_metadatar   r   r   Úfetch_build_egg   sx   ýÿ

 þ€
ü
€ÿ
ÿÿ&ärI   c                 C   s   t j t| ƒ¡} d| _| S )z«
    Return a new requirement without the environment marker to avoid
    calling pip with something like `babel; extra == "i18n"`, which
    would always be ignored.
    N)r   ÚRequirementÚparser   Úmarker)r=   r   r   r   r    _   s   r    )r5   r"   r2   r.   r,   r   Ú	distutilsr   Údistutils.errorsr   r   Úsetuptools.wheelr   Ú_deprecation_warningr   r   rI   r    r   r   r   r   Ú<module>   s    H