o _a@sddlZddlZddlZddlZddlZddlZddlmZddlm Z ddl Z ddl m Z ddl mZddZd d Zd d ZdS) N)log)DistutilsError)Wheel)SetuptoolsDeprecationWarningcCs(t|tr |St|ttfsJ|S)z8Ensure find-links option end-up being a list of strings.) isinstancestrsplittuplelist) find_linksr 6/usr/lib/python3/dist-packages/setuptools/installer.py_fixup_find_linkss rc CsHtdtztdWntjy|dtjYnwt |}| d}d|vr0t ddt j vo9dt j v}d t j vrBd }n d |vrM|d d }nd }d |vr_t|d d d d ng}|jrj||jt j|}t}t|D]}||vr||r|Sq{t} tjdddddd| g} |r| d|d ur| d|f|pgD] } | d| fq| |jpt|zt| Wntj y} zt t| | d } ~ wwt!t""t j#| dd} t j#|| $}| %|t&|t j#|d}tj'j(||d}|Wd S1swYd 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_urlrr z-mpipz--disable-pip-version-checkz --no-depsz-wz--quietz --index-urlz --find-linksz*.whlrzEGG-INFO)metadata))warningswarnr pkg_resourcesget_distributionDistributionNotFoundannouncerWARN strip_markerget_option_dictrosenvironrdependency_linksextendpathrealpathget_egg_cache_dir Environmentfind_distributionscan_addtempfileTemporaryDirectorysys executableappendurlr subprocess check_callCalledProcessErrorrglobjoinegg_nameinstall_as_egg PathMetadata Distribution from_filename)distreqoptsquietrr eggs_dir environmentegg_disttmpdircmdlinker dist_location dist_metadatar r rfetch_build_eggsx        &rIcCstjt|}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 Requirementparsermarker)r=r r rr _sr )r5r"r2r.r,r distutilsrdistutils.errorsrrsetuptools.wheelr_deprecation_warningrrrIr r r r rs     H