U e @spddlZddlZddlZddlZddlZddlmZddlmZddl Z ddl m Z ddZ ddZ d d ZdS) N)log)DistutilsError)WheelcCs(t|tr|St|ttfs$t|S)z8Ensure find-links option end-up being a list of strings.) isinstancestrsplittuplelistAssertionError) find_linksr B/opt/hc_python/lib/python3.8/site-packages/setuptools/installer.py_fixup_find_links s rc CsHztdWn$tjk r2|dtjYnXt|}|d}d|krVtddt j kohdt j k}dt j krzd }nd |kr|d d }nd }d |krt |d d d d ng}|j r| |j t j|}t}t|D]}||kr||r|Sqt(} tjd ddddd| g} |r>| d|d k rV| d|f|p^gD]} | d| fq`| |jpt|zt| Wn4tjk r} ztt| | W5d } ~ XYnXttt j | dd} t j || !}| "|t#|t j |d}tj$j%||d}|W5QRSQRXd S)zLFetch an egg needed for building. Use pip/wheel to fetch/build a wheel.wheelz,WARNING: The wheel package is not available. easy_installZ allow_hostszQthe `allow-hosts` option is not supported when using pip to install requirements.Z PIP_QUIETZ PIP_VERBOSEZ PIP_INDEX_URLN index_urlr z-mpipz--disable-pip-version-checkz --no-depsz-wz--quietz --index-urlz --find-linksz*.whlrzEGG-INFO)metadata)& pkg_resourcesget_distributionDistributionNotFoundannouncerWARN strip_markerget_option_dictrosenvironrZdependency_linksextendpathrealpathZget_egg_cache_dir Environmentfind_distributionscan_addtempfileTemporaryDirectorysys executableappendurlr subprocess check_callCalledProcessErrorrglobjoinegg_nameZinstall_as_egg PathMetadata Distribution from_filename)distreqoptsquietrr Zeggs_dir environmentZegg_distZtmpdircmdlinker dist_locationZ dist_metadatar r r fetch_build_eggsr           r<cCstjt|}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)r4r r r rXsr)r-rr*r&r$ distutilsrdistutils.errorsrrZsetuptools.wheelrrr<rr r r r s   C