ó
F]c           @   se   d  d l  Z  d  d l m Z d  d l m Z d  d l m Z e  j e  Z	 d e f d     YZ
 d S(   iÿÿÿÿN(   t   BuildEnvironment(   t   AbstractDistribution(   t   InstallationErrort   SourceDistributionc           B   s    e  Z d  Z d   Z d   Z RS(   sÅ  Represents a source distribution.

    The preparation step for these needs metadata for the packages to be
    generated, either using PEP 517 or using the legacy `setup.py egg_info`.

    NOTE from @pradyunsg (14 June 2019)
    I expect SourceDistribution class will need to be split into
    `legacy_source` (setup.py based) and `source` (PEP 517 based) when we start
    bringing logic for preparation out of InstallRequirement into this class.
    c         C   s   |  j  j   S(   N(   t   reqt   get_dist(   t   self(    (    sA   lib/python2.7/site-packages/pip/_internal/distributions/source.pyt   get_pkg_resources_distribution   s    c            s   j  j    j  j o | }    f d   } | rdt    j  _  j  j j |  j  j d d   j  j j  j  j  \   }   r | d    n  | rã t	 j
 d  j   t	 j
 d d j t t t |     n   j  j # d  j  _  j  j j   } Wd  QX j  j j |  \   }   rE| d	    n   j  j j | | d
 d  n   j  j    j  j   d  S(   Nc            s9   t  d  j |  d j d   t    D  f   d  S(   Ns4   Some build dependencies for %s conflict with %s: %s.s   , c         s   s%   |  ] \ } } d  | | f Vq d S(   s   %s is incompatible with %sN(    (   t   .0t	   installedt   wanted(    (    sA   lib/python2.7/site-packages/pip/_internal/distributions/source.pys	   <genexpr>%   s   (   R   R   t   joint   sorted(   t   conflicting_witht   conflicting_reqs(   t   conflictingR   (    sA   lib/python2.7/site-packages/pip/_internal/distributions/source.pyt   _raise_conflicts!   s
    t   overlays   Installing build dependenciess"   PEP 517/518 supported requirementss4   Missing build requirements in pyproject.toml for %s.s`   The project does not specify a build backend, and pip cannot fall back to setuptools without %s.s    and s#   Getting requirements to build wheels   the backend dependenciest   normals   Installing backend dependencies(   R   t   load_pyproject_tomlt
   use_pep517R    t	   build_envt   install_requirementst   pyproject_requirest   check_requirementst   requirements_to_checkt   loggert   warningR   t   mapt   reprR   t   spin_messaget   pep517_backendt   get_requires_for_build_wheelt   prepare_metadatat   assert_source_matches_version(   R   t   findert   build_isolationt   should_isolateR   t   missingt   reqs(    (   R   R   sA   lib/python2.7/site-packages/pip/_internal/distributions/source.pyt   prepare_distribution_metadata   s>    

"	
(   t   __name__t
   __module__t   __doc__R   R(   (    (    (    sA   lib/python2.7/site-packages/pip/_internal/distributions/source.pyR   
   s   
	(   t   loggingt   pip._internal.build_envR    t    pip._internal.distributions.baseR   t   pip._internal.exceptionsR   t	   getLoggerR)   R   R   (    (    (    sA   lib/python2.7/site-packages/pip/_internal/distributions/source.pyt   <module>   s
   