ó
ã™L]c           @   s|  d  Z  d d l m Z d d l m Z d d l m Z d d l m	 Z	 d d l Z d d l Z d d l
 Z
 d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d d	 l m Z d d
 l m Z d d l m Z d d l m Z d d l m Z d d l m Z m  Z  m! Z! m" Z" m# Z# m$ Z$ m% Z% m& Z& d d l' j( Z( d d l) m* Z* d d l m+ Z+ d d l m, Z, d „  Z- d d( d „  ƒ  YZ. d e. e f d „  ƒ  YZ/ d e f d „  ƒ  YZ d e f d „  ƒ  YZ0 d „  Z1 d „  Z2 d „  Z3 d „  Z4 d „  Z5 d  „  Z6 d! „  Z7 d" „  Z8 e9 d# „ Z: d$ „  Z; d% „  Z< d& e, f d' „  ƒ  YZ= d S()   sU   setuptools.command.egg_info

Create a distribution's .egg-info directory and contentsiÿÿÿÿ(   t   FileList(   t   DistutilsInternalError(   t   convert_path(   t   logN(   t   six(   t   map(   t   Command(   t   sdist(   t   walk_revctrl(   t   edit_config(   t	   bdist_egg(   t   parse_requirementst	   safe_namet   parse_versiont   safe_versiont   yield_linest
   EntryPointt   iter_entry_pointst   to_filename(   t   glob(   t	   packaging(   t   SetuptoolsDeprecationWarningc         C   s€  d } |  j  t j j ƒ } t j t j ƒ } d | f } xt | ƒ D]\ } } | t | ƒ d k } | d k r¢ | rˆ | d 7} qG | d | | f 7} qG n  d } t | ƒ }	 x‹| |	 k  rA| | }
 |
 d k rê | | d 7} nJ|
 d	 k r| | 7} n1|
 d
 k r!| d } | |	 k  rB| | d k rB| d } n  | |	 k  rk| | d k rk| d } n  x* | |	 k  r—| | d k r—| d } qnW| |	 k rº| t j |
 ƒ 7} q4| | d | !} d } | d d k rôd } | d } n  | t j | ƒ 7} | d | f 7} | } n | t j |
 ƒ 7} | d 7} q· W| sG | | 7} qG qG W| d 7} t j | d t j	 t j
 BƒS(   sö   
    Translate a file path glob like '*.txt' in to a regular expression.
    This differs from fnmatch.translate which allows wildcards to match
    directory separators. It also knows about '**/' which matches any number of
    directories.
    t    s   [^%s]i   s   **s   .*s
   (?:%s+%s)*i    t   *t   ?t   [t   !t   ]t   ^s   [%s]s   \Zt   flags(   t   splitt   ost   patht   sept   ret   escapet	   enumeratet   lent   compilet	   MULTILINEt   DOTALL(   R   t   patt   chunksR!   t
   valid_chart   ct   chunkt
   last_chunkt   it	   chunk_lent   chart   inner_it   innert
   char_class(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   translate_pattern$   sV    

	
t
   InfoCommonc           B   sA   e  Z d Z d Z e d  „  ƒ Z d „  Z d „  Z e e ƒ Z	 RS(   c         C   s   t  |  j j ƒ  ƒ S(   N(   R   t   distributiont   get_name(   t   self(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   name{   s    c         C   sE   |  j  j ƒ  } |  j r4 | j |  j ƒ r4 t | ƒ St | |  j ƒ S(   N(   R7   t   get_versiont   vtagst   endswithR   (   R9   t   version(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   tagged_version   s    
c         C   sB   d } |  j  r | |  j  7} n  |  j r> | t j d ƒ 7} n  | S(   NR   s   -%Y%m%d(   t	   tag_buildt   tag_datet   timet   strftime(   R9   R>   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   tags‡   s    		N(
   t   __name__t
   __module__t   NoneR@   RA   t   propertyR:   R?   RD   R<   (    (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyR6   w   s   		t   egg_infoc           B   s«   e  Z d  Z d d d d g Z d g Z i d d
 6Z d „  Z e d „  ƒ Z e j	 d „  ƒ Z d „  Z
 d „  Z e d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s+   create a distribution's .egg-info directorys	   egg-base=t   esL   directory containing .egg-info directories (default: top of the source tree)s   tag-datet   ds0   Add date stamp (e.g. 20050528) to version numbers
   tag-build=t   bs-   Specify explicit tag to add to version numbers   no-datet   Ds"   Don't include date stamp [default]c         C   s1   d  |  _ d  |  _ d  |  _ d  |  _ t |  _ d  S(   N(   RG   t   egg_baset   egg_nameRI   t   egg_versiont   Falset   broken_egg_info(   R9   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   initialize_options¡   s
    				c         C   s   d  S(   N(    (   R9   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   tag_svn_revision«   s    c         C   s   d  S(   N(    (   R9   t   value(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyRT   ¯   s    c         C   s@   t  j ƒ  } |  j ƒ  | d <d | d <t | t d | ƒ ƒ d S(   s³   
        Materialize the value of date into the
        build tag. Install build keys in a deterministic order
        to avoid arbitrary reordering on subsequent builds.
        R@   i    RA   RI   N(   t   collectionst   OrderedDictRD   R	   t   dict(   R9   t   filenameRI   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   save_version_info´   s    
c         C   sÌ  |  j  |  _ |  j ƒ  |  _ t |  j ƒ } yK t | t j j ƒ } | rN d n d } t	 t
 | |  j |  j f ƒ ƒ Wn3 t k
 rª t j j d |  j |  j f ƒ ‚ n X|  j d  k rç |  j j } | pÏ i  j d t j ƒ |  _ n  |  j d ƒ t |  j ƒ d |  _ |  j t j k r=t j j |  j |  j ƒ |  _ n  d |  j k rY|  j ƒ  n  |  j |  j j _ |  j j } | d  k	 rÈ| j |  j j ƒ  k rÈ|  j | _  t |  j ƒ | _! d  |  j _ n  d  S(   Ns   %s==%ss   %s===%ss2   Invalid distribution name or version syntax: %s-%sR   RN   s	   .egg-infot   -("   R:   RO   R?   RP   R   t
   isinstanceR   R>   t   Versiont   listR   t
   ValueErrort	   distutilst   errorst   DistutilsOptionErrorRN   RG   R7   t   package_dirt   getR   t   curdirt   ensure_dirnameR   RI   R    t   joint   check_broken_egg_infot   metadatat   _patched_distt   keyt   lowert   _versiont   _parsed_version(   R9   t   parsed_versiont
   is_versiont   spect   dirst   pd(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   finalize_optionsÁ   s6    !	!!$c         C   sl   | r |  j  | | | ƒ nL t j j | ƒ rh | d k rX | rX t j d | | ƒ d S|  j | ƒ n  d S(   s¹  Write `data` to `filename` or delete if empty

        If `data` is non-empty, this routine is the same as ``write_file()``.
        If `data` is empty but not ``None``, this is the same as calling
        ``delete_file(filename)`.  If `data` is ``None``, then this is a no-op
        unless `filename` exists, in which case a warning is issued about the
        orphaned file (if `force` is false), or deleted (if `force` is true).
        s$   %s not set in setup(), but %s existsN(   t
   write_fileR   R    t   existsRG   R   t   warnt   delete_file(   R9   t   whatRY   t   datat   force(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   write_or_delete_fileò   s    	c         C   sd   t  j d | | ƒ t j r. | j d ƒ } n  |  j s` t | d ƒ } | j | ƒ | j ƒ  n  d S(   sª   Write `data` to `filename` (if not a dry run) after announcing it

        `what` is used in a log message to identify what is being written
        to the file.
        s   writing %s to %ss   utf-8t   wbN(	   R   t   infoR   t   PY3t   encodet   dry_runt   opent   writet   close(   R9   Ry   RY   Rz   t   f(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyRu     s    		c         C   s-   t  j d | ƒ |  j s) t j | ƒ n  d S(   s8   Delete `filename` (if not a dry run) after announcing its   deleting %sN(   R   R~   R�   R   t   unlink(   R9   RY   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyRx     s    	c         C   sÒ   |  j  |  j ƒ t j |  j d  ƒ |  j j } xX t d ƒ D]J } | j d | ƒ | j	 ƒ  } | |  | j
 t j j |  j | j
 ƒ ƒ q< Wt j j |  j d ƒ } t j j | ƒ rÄ |  j | ƒ n  |  j ƒ  d  S(   Ns   egg_info.writerst	   installers   native_libs.txt(   t   mkpathRI   R   t   utimeRG   R7   t   fetch_build_eggR   t   requiret   resolveR:   R    Rg   Rv   Rx   t   find_sources(   R9   R‡   t   ept   writert   nl(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   run  s    ,c         C   sJ   t  j j |  j d ƒ } t |  j ƒ } | | _ | j ƒ  | j |  _ d S(   s"   Generate SOURCES.txt manifest files   SOURCES.txtN(	   R   R    Rg   RI   t   manifest_makerR7   t   manifestR‘   t   filelist(   R9   t   manifest_filenamet   mm(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyR�   *  s
    	
c         C   sŽ   |  j  d } |  j t j k r: t j j |  j | ƒ } n  t j j | ƒ rŠ t j d d d d d | |  j	 ƒ |  j	 |  _
 | |  _	 n  d  S(   Ns	   .egg-infoR[   iN   s¦   
Note: Your current .egg-info directory has a '-' in its name;
this will not work correctly with "setup.py develop".

Please rename %s to %s to correct this problem.
(   RO   RN   R   Re   R    Rg   Rv   R   Rw   RI   RR   (   R9   t   bei(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyRh   2  s    (   s	   egg-base=RJ   sL   directory containing .egg-info directories (default: top of the source tree)(   s   tag-dateRK   s0   Add date stamp (e.g. 20050528) to version number(   s
   tag-build=RL   s-   Specify explicit tag to add to version number(   s   no-dateRM   s"   Don't include date stamp [default](   RE   RF   t   descriptiont   user_optionst   boolean_optionst   negative_optRS   RH   RT   t   setterRZ   Rt   RQ   R|   Ru   Rx   R‘   R�   Rh   (    (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyRI   ‘   s&   		
	
		1				R    c           B   s†   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z RS(   c         C   só  |  j  | ƒ \ } } } } | d k rw |  j d d j | ƒ ƒ x«| D]( } |  j | ƒ sH t j d | ƒ qH qH Wnx| d k rÓ |  j d d j | ƒ ƒ xO| D]( } |  j | ƒ s¤ t j d | ƒ q¤ q¤ Wn| d k r/|  j d	 d j | ƒ ƒ xó| D]( } |  j | ƒ s t j d
 | ƒ q q WnÀ| d k r‹|  j d d j | ƒ ƒ x—| D]( } |  j | ƒ s\t j d | ƒ q\q\Wnd| d k ró|  j d | d j | ƒ f ƒ x5| D]. } |  j	 | | ƒ s¾t j d | | ƒ q¾q¾Wnü | d k r[|  j d | d j | ƒ f ƒ xÍ | D]. } |  j
 | | ƒ s&t j d | | ƒ q&q&Wn” | d k r�|  j d | ƒ |  j | ƒ sït j d | ƒ qïnR | d k rß|  j d | ƒ |  j | ƒ sït j d | ƒ qïn t d | ƒ ‚ d  S(   Nt   includes   include t    s%   warning: no files found matching '%s't   excludes   exclude s9   warning: no previously-included files found matching '%s's   global-includes   global-include s>   warning: no files found matching '%s' anywhere in distributions   global-excludes   global-exclude sR   warning: no previously-included files matching '%s' found anywhere in distributions   recursive-includes   recursive-include %s %ss:   warning: no files found matching '%s' under directory '%s's   recursive-excludes   recursive-exclude %s %ssN   warning: no previously-included files matching '%s' found under directory '%s't   grafts   graft s+   warning: no directories found matching '%s't   prunes   prune s6   no previously-included directories found matching '%s's'   this cannot happen: invalid action '%s'(   t   _parse_template_linet   debug_printRg   R�   R   Rw   RŸ   t   global_includet   global_excludet   recursive_includet   recursive_excludeR    R¡   R   (   R9   t   linet   actiont   patternst   dirt   dir_patternt   pattern(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   process_template_lineE  sd    									c         C   sr   t  } xe t t |  j ƒ d d d ƒ D]D } | |  j | ƒ r& |  j d |  j | ƒ |  j | =t } q& q& W| S(   s†   
        Remove all files from the file list that match the predicate.
        Return True if any matching files were removed
        i   iÿÿÿÿs
    removing (   RQ   t   rangeR%   t   filesR£   t   True(   R9   t	   predicatet   foundR/   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   _remove_filesŽ  s    &
c         C   sH   g  t  | ƒ D] } t j j | ƒ s | ^ q } |  j | ƒ t | ƒ S(   s#   Include files that match 'pattern'.(   R   R   R    t   isdirt   extendt   bool(   R9   R­   R…   R³   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyR�   ›  s    1c         C   s   t  | ƒ } |  j | j ƒ S(   s#   Exclude files that match 'pattern'.(   R5   R´   t   match(   R9   R­   R¸   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyRŸ   ¡  s    c         C   sf   t  j j | d | ƒ } g  t | d t ƒD] } t  j j | ƒ s+ | ^ q+ } |  j | ƒ t | ƒ S(   sN   
        Include all files anywhere in 'dir/' that match the pattern.
        s   **t	   recursive(   R   R    Rg   R   R±   Rµ   R¶   R·   (   R9   R«   R­   t   full_patternR…   R³   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyR¦   ¦  s
    c         C   s.   t  t j j | d | ƒ ƒ } |  j | j ƒ S(   sM   
        Exclude any file anywhere in 'dir/' that match the pattern.
        s   **(   R5   R   R    Rg   R´   R¸   (   R9   R«   R­   R¸   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyR§   °  s    c         C   sO   g  t  | ƒ D]% } t j j | ƒ D] } | ^ q# q } |  j | ƒ t | ƒ S(   s   Include all files from 'dir/'.(   R   R`   R”   t   findallR¶   R·   (   R9   R«   t	   match_dirt   itemR³   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyR    ·  s
    %c         C   s+   t  t j j | d ƒ ƒ } |  j | j ƒ S(   s   Filter out files from 'dir/'.s   **(   R5   R   R    Rg   R´   R¸   (   R9   R«   R¸   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyR¡   Á  s    c         C   sy   |  j  d k r |  j ƒ  n  t t j j d | ƒ ƒ } g  |  j  D] } | j | ƒ rA | ^ qA } |  j | ƒ t	 | ƒ S(   s“   
        Include all files anywhere in the current directory that match the
        pattern. This is very inefficient on large file trees.
        s   **N(
   t   allfilesRG   R»   R5   R   R    Rg   R¸   R¶   R·   (   R9   R­   R¸   R…   R³   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyR¤   Æ  s    +c         C   s+   t  t j j d | ƒ ƒ } |  j | j ƒ S(   sD   
        Exclude all files anywhere that match the pattern.
        s   **(   R5   R   R    Rg   R´   R¸   (   R9   R­   R¸   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyR¥   Ò  s    c         C   sN   | j  d ƒ r | d  } n  t | ƒ } |  j | ƒ rJ |  j j | ƒ n  d  S(   Ns   iÿÿÿÿ(   R=   R   t
   _safe_pathR°   t   append(   R9   R½   R    (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyRÀ   Ù  s
    c         C   s    |  j  j t |  j | ƒ ƒ d  S(   N(   R°   R¶   t   filterR¿   (   R9   t   paths(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyR¶   á  s    c         C   s"   t  t |  j |  j ƒ ƒ |  _ d S(   sÜ   
        Replace self.files with only safe paths

        Because some owners of FileList manipulate the underlying
        ``files`` attribute directly, this method must be called to
        repair those paths.
        N(   R^   RÁ   R¿   R°   (   R9   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   _repairä  s    c         C   sÈ   d } t  j | ƒ } | d  k r6 t j d | ƒ t St  j | d ƒ } | d  k rk t j | | d ƒ t Sy, t j j	 | ƒ s’ t j j	 | ƒ r– t
 SWn* t k
 rÃ t j | | t j ƒ  ƒ n Xd  S(   Ns!   '%s' not %s encodable -- skippings'   '%s' in unexpected encoding -- skippings   utf-8(   t   unicode_utilst   filesys_decodeRG   R   Rw   RQ   t
   try_encodeR   R    Rv   R±   t   UnicodeEncodeErrort   syst   getfilesystemencoding(   R9   R    t   enc_warnt   u_patht	   utf8_path(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyR¿   î  s    $(   RE   RF   R®   R´   R�   RŸ   R¦   R§   R    R¡   R¤   R¥   RÀ   R¶   RÃ   R¿   (    (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyR    B  s   	I				
		
						
R’   c           B   se   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e	 d „  ƒ Z
 d „  Z d	 „  Z RS(
   s   MANIFEST.inc         C   s(   d |  _  d |  _ d |  _ d |  _ d  S(   Ni   (   t   use_defaultsR¡   t   manifest_onlyt   force_manifest(   R9   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyRS   	  s    			c         C   s   d  S(   N(    (   R9   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyRt     s    c         C   sŒ   t  ƒ  |  _ t j j |  j ƒ s. |  j ƒ  n  |  j ƒ  t j j |  j ƒ rZ |  j	 ƒ  n  |  j
 ƒ  |  j j ƒ  |  j j ƒ  |  j ƒ  d  S(   N(   R    R”   R   R    Rv   R“   t   write_manifestt   add_defaultst   templatet   read_templatet   prune_file_listt   sortt   remove_duplicates(   R9   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyR‘     s    

c         C   s"   t  j | ƒ } | j t j d ƒ S(   Nt   /(   RÄ   RÅ   t   replaceR   R!   (   R9   R    (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   _manifest_normalize  s    c         C   sb   |  j  j ƒ  g  |  j  j D] } |  j | ƒ ^ q } d |  j } |  j t |  j | f | ƒ d S(   so   
        Write the file list in 'self.filelist' to the manifest file
        named by 'self.manifest'.
        s   writing manifest file '%s'N(   R”   RÃ   R°   RÙ   R“   t   executeRu   (   R9   R…   R°   t   msg(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyRÐ   "  s    (c         C   s&   |  j  | ƒ s" t j |  | ƒ n  d  S(   N(   t   _should_suppress_warningR   Rw   (   R9   RÛ   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyRw   .  s    c         C   s   t  j d |  ƒ S(   s;   
        suppress missing-file warnings from sdist
        s   standard file .*not found(   R"   R¸   (   RÛ   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyRÜ   2  s    c         C   sÒ   t  j |  ƒ |  j ƒ  |  j j |  j ƒ |  j j |  j ƒ t t ƒ  ƒ } | re |  j j	 | ƒ n" t
 j j |  j ƒ r‡ |  j ƒ  n  t
 j j d ƒ r¬ |  j j d ƒ n  |  j d ƒ } |  j j | j ƒ d  S(   Ns   setup.pyRI   (   R   RÑ   t   check_licenseR”   RÀ   RÒ   R“   R^   R   R¶   R   R    Rv   t   read_manifestt   get_finalized_commandR    RI   (   R9   t   rcfilest   ei_cmd(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyRÑ   9  s    
c         C   sy   |  j  d ƒ } |  j j ƒ  } |  j j | j ƒ |  j j | ƒ t j t j	 ƒ } |  j j
 d | d | d d ƒd  S(   Nt   builds   (^|s   )(RCS|CVS|\.svn)t   is_regexi   (   Rß   R7   t   get_fullnameR”   R¡   t
   build_baseR"   R#   R   R!   t   exclude_pattern(   R9   Râ   t   base_dirR!   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyRÔ   L  s    (   RE   RF   RÒ   RS   Rt   R‘   RÙ   RÐ   Rw   t   staticmethodRÜ   RÑ   RÔ   (    (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyR’     s   							c         C   sG   d j  | ƒ } | j d ƒ } t |  d ƒ � } | j | ƒ Wd QXd S(   s{   Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    s   
s   utf-8R}   N(   Rg   R€   R‚   Rƒ   (   RY   t   contentsR…   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyRu   V  s    c         C   s«   t  j d | ƒ |  j s§ |  j j } |  j | j | _ } |  j | j | _ } z | j	 |  j
 ƒ Wd  | | | _ | _ Xt |  j d d  ƒ } t j |  j
 | ƒ n  d  S(   Ns
   writing %st   zip_safe(   R   R~   R�   R7   Ri   RP   R>   RO   R:   t   write_pkg_infoRI   t   getattrRG   R
   t   write_safety_flag(   t   cmdt   basenameRY   Ri   t   oldvert   oldnamet   safe(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyRë   c  s    	c         C   s&   t  j j | ƒ r" t j d ƒ n  d  S(   Nss   WARNING: 'depends.txt' is not used by setuptools 0.6!
Use the install_requires/extras_require setup() args instead.(   R   R    Rv   R   Rw   (   Rî   Rï   RY   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   warn_depends_obsoletev  s    c         C   s;   t  | p d ƒ } d „  } t | | ƒ } |  j | ƒ d  S(   Nc         S   s   |  d S(   Ns   
(    (   R¨   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   <lambda>€  s    (    (   R   R   t
   writelines(   t   streamt   reqst   linest	   append_cr(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   _write_requirements~  s    	c         C   s’   |  j  } t j ƒ  } t | | j ƒ | j p1 i  } x> t | ƒ D]0 } | j d j t	 ƒ  �  ƒ t | | | ƒ qA W|  j
 d | | j ƒ  ƒ d  S(   Ns   
[{extra}]
t   requirements(   R7   R   t   StringIORú   t   install_requirest   extras_requiret   sortedRƒ   t   formatt   varsR|   t   getvalue(   Rî   Rï   RY   t   distRz   Rþ   t   extra(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   write_requirements…  s    	c         C   s<   t  j ƒ  } t | |  j j ƒ |  j d | | j ƒ  ƒ d  S(   Ns   setup-requirements(   t   ioRü   Rú   R7   t   setup_requiresR|   R  (   Rî   Rï   RY   Rz   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   write_setup_requirements�  s    c         C   se   t  j g  |  j j ƒ  D] } | j d d ƒ d ^ q ƒ } |  j d | d j t | ƒ ƒ d ƒ d  S(   Nt   .i   i    s   top-level namess   
(   RX   t   fromkeysR7   t   iter_distribution_namesR   Ru   Rg   Rÿ   (   Rî   Rï   RY   t   kt   pkgs(    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   write_toplevel_names–  s    2c         C   s   t  |  | | t ƒ d  S(   N(   t	   write_argR±   (   Rî   Rï   RY   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   overwrite_arg   s    c         C   sg   t  j j | ƒ d } t |  j | d  ƒ } | d  k	 rM d j | ƒ d } n  |  j | | | | ƒ d  S(   Ni    s   
(   R   R    t   splitextRì   R7   RG   Rg   R|   (   Rî   Rï   RY   R{   t   argnameRU   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyR  ¤  s
    c         C   sö   |  j  j } t | t j ƒ s* | d  k r3 | } n© | d  k	 rÜ g  } x‚ t | j ƒ  ƒ D]n \ } } t | t j ƒ s¯ t j	 | | ƒ } d j
 t t t | j ƒ  ƒ ƒ ƒ } n  | j d | | f ƒ qX Wd j
 | ƒ } n  |  j d | | t ƒ d  S(   Ns   
s	   [%s]
%s

R   s   entry points(   R7   t   entry_pointsR\   R   t   string_typesRG   Rÿ   t   itemsR   t   parse_groupRg   R   t   strt   valuesRÀ   R|   R±   (   Rî   Rï   RY   RŽ   Rz   t   sectionRé   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   write_entries¬  s    	'c          C   s}   t  j d t ƒ t j j d ƒ ry t j d ƒ �C }  x9 |  D]1 } t j	 d | ƒ } | r; t
 | j d ƒ ƒ Sq; WWd QXn  d S(   sd   
    Get a -r### off of PKG-INFO Version in case this is an sdist of
    a subversion revision.
    s$   get_pkg_info_revision is deprecated.s   PKG-INFOs   Version:.*-r(\d+)\s*$i   Ni    (   t   warningsRw   t   EggInfoDeprecationWarningR   R    Rv   R  R‚   R"   R¸   t   intt   group(   R…   R¨   R¸   (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   get_pkg_info_revision½  s     R  c           B   s   e  Z d  Z RS(   sq   Class for warning about deprecations in eggInfo in setupTools. Not ignored by default, unlike DeprecationWarning.(   RE   RF   t   __doc__(    (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyR  Ì  s   (    (>   R   t   distutils.filelistR    t	   _FileListt   distutils.errorsR   t   distutils.utilR   R`   R   R   R"   RÈ   R  R  RB   RV   t   setuptools.externR   t   setuptools.extern.six.movesR   t
   setuptoolsR   t   setuptools.command.sdistR   R   t   setuptools.command.setoptR	   t   setuptools.commandR
   t   pkg_resourcesR   R   R   R   R   R   R   R   t   setuptools.unicode_utilsRÄ   t   setuptools.globR   R   R   R5   R6   RI   R’   Ru   Rë   Ró   Rú   R  R  R  R  RQ   R  R  R  R  (    (    (    s?   /tmp/pip-build-sZz8gW/setuptools/setuptools/command/egg_info.pyt   <module>   sT   :	S±ÄP							
			