3 e@sddlZddlZddlZddlZddlZddlZddlmZddlm Z ddl Z ddl m Z ddl mZddZd d Zd d ZdS) N)log)DistutilsError)Wheel)SetuptoolsDeprecationWarningcCs(t|tr|jSt|ttfs$t|S)z8Ensure find-links option end-up being a list of strings.) isinstancestrsplittuplelistAssertionError) find_linksr:/tmp/pip-build-vlmub77e/setuptools/setuptools/installer.py_fixup_find_linkss rc"CsLtjdtytjdWn$tjk r>|jdtjYnXt |}|j d}d|krbt ddt j kotdt j k}d t j krd }nd |kr|d d }nd }d |krt|d d d d ng}|jr|j|jt jj|j}tj}x(tj|D]}||kr|j|r|SqWtj } tjdddddd| g} |rJ| jd|d k rb| jd|fx"|plgD]} | jd| fqnW| j|jpt|ytj| Wn4tj k r} zt t| | WYd d } ~ XnXt!t"j"t jj#| dd} t jj#|| j$}| j%|tj&|t jj#|d}tj'j(||d}|SQRXd 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_installZ allow_hostszQthe `allow-hosts` option is not supported when using pip to install requirements.Z PIP_QUIETZ PIP_VERBOSEZ 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_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_metadatarrrfetch_build_eggsd          r@cCstjjt|}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)r8rrrr_sr)r1rr.r*r(r distutilsrZdistutils.errorsrrZsetuptools.wheelrZ_deprecation_warningrrr@rrrrrs    H