a c@sddlZddlZddlZddlZddlmZddlmZddlZddl m Z ddl m Z ddl mZddlmZd d Zd d Zd dZddZdS)N)log)DistutilsError) easy_install)six)Wheel)TemporaryDirectorycCs*t|tjr|St|ttfs&J|S)z8Ensure find-links option end-up being a list of strings.) isinstancer string_typessplittuplelist) find_linksra/workspaces/shunt/resources/test-fastapi/venv/lib/python3.9/site-packages/setuptools/installer.py_fixup_find_linkss rc Cs|ddgi}|d}||dd|dD|jr||jdd}d|vrpt|dd|}d|f|d<|}t|d g|d d dd d d d d d }| ||S) zJFetch an egg needed for building. Legacy path using EasyInstall. script_argsrcss"|]\}}|dvr||fVqdS))r site_dirs index_urloptimizer allow_hostsNr).0kvrrr sz*_legacy_fetch_build_egg..NrrsetupxTF) args install_dirZexclude_scriptsZ always_copyZbuild_directoryeditableupgradeZ multi_versionZ no_reportuser) __class__get_option_dictclearupdateitemsdependency_linksrget_egg_cache_dirrensure_finalized)distreqZtmp_distoptslinksrcmdrrr_legacy_fetch_build_eggs(    r/c CsztdWn,tjy:|dtjt||YS0ztdWn"tjyl|dtjYn0t|}|d}d|vrt ddt j vsd t j vrd }nd }d t j vrd }nd|vr|dd}nd }d|vrt |ddd d }ng}|j r||j t j|}t}t|D]$}||vr4||r4|Sq4t<} tjdddddd| g} |r| d|d ur| d|f|d ur|D]} | d| fq|jr| |jn| t|zt| Wn4tjy,} zt t| WYd } ~ n d } ~ 00ttt j | dd} t j || !}| "|t#|t j |d}tj$j%||d}|Wd S1s0Yd S)zLFetch an egg needed for building. Use pip/wheel to fetch/build a wheel.pipzWARNING: The pip package is not available, falling back to EasyInstall for handling setup_requires/test_requires; this is deprecated and will be removed in a future version.wheelz,WARNING: The wheel package is not available.rrzQthe `allow-hosts` option is not supported when using pip to install requirements.Z PIP_QUIETZ PIP_VERBOSEFTZ PIP_INDEX_URLNrrrz-mz--disable-pip-version-checkz --no-depsz-wz--quietz --index-urlz --find-linksz*.whlrzEGG-INFO)metadata)& pkg_resourcesget_distributionDistributionNotFoundannouncerWARNr/ strip_markerr#rosenvironrr'extendpathrealpathr( Environmentfind_distributionscan_addrsys executableappendurlstr subprocess check_callCalledProcessErrorrglobjoinegg_nameZinstall_as_egg PathMetadata Distribution from_filename)r*r+r,quietrrZeggs_dir environmentZegg_disttmpdirr.linker1 dist_locationZ dist_metadatarrrfetch_build_egg8s        " rUcCstjt|}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)r3 RequirementparserEmarker)r+rrrr8sr8)rIr9rFrA distutilsrdistutils.errorsrr3Zsetuptools.command.easy_installrZsetuptools.externrZsetuptools.wheelr py31compatrrr/rUr8rrrrs       U