ó
@K7]c           @` sC  d  d l  m Z m Z m Z d  d l Z d  d l Z d  d l Z d  d l m Z d  d l Z d  d l	 m
 Z
 d  d l m Z m Z m Z d  d l m Z m Z d  d l m Z m Z d  d l m Z m Z d  d	 l m Z e j d
 k Z d e j f d „  ƒ  YZ d „  Z d „  Z e  d „ Z! d „  Z" e# d k r?e" ƒ  n  d S(   i    (   t   absolute_importt   divisiont   print_functionN(   t   pprint(   t   ParserError(   t   ArgumentParsert   add_parser_channelst   cc_conda_build(   t   __version__t   api(   t   get_or_merge_configt   get_channel_urls(   t   get_package_variantst   set_language_env_vars(   t   LoggingContextt   win32t   ParseYAMLArgumentc           B` s   e  Z d d  „ Z RS(   c         C` s³   t  | ƒ d k r! t d ƒ ‚ n  yZ t j | d d t j ƒ} t | t ƒ sg t d j | ƒ ƒ ‚ n  t | |  j	 | ƒ Wn1 t
 k
 r® } t d j | t | ƒ ƒ ƒ ‚ n Xd  S(   Ni   s)   This switch requires exactly one argumenti    t   Loaders,   The argument of {} is not a YAML dictionary.sB   The argument of {} is not a valid YAML. The parser error was: 

{}(   t   lent   RuntimeErrort   yamlt   loadt
   BaseLoadert
   isinstancet   dictt   formatt   setattrt   destR   t   str(   t   selft   parsert	   namespacet   valuest   option_stringt   my_dictt   e(    (    s:   lib/python2.7/site-packages/conda_build/cli/main_render.pyt   __call__   s    N(   t   __name__t
   __module__t   NoneR$   (    (    (    s:   lib/python2.7/site-packages/conda_build/cli/main_render.pyR      s   c       
   C` sü  t  d d d d ƒ }  |  j d d d d d	 d
 d d t ƒ|  j d d d d d	 d ƒ|  j d d d d	 d ƒ|  j d d d d	 d ƒ|  j d d d d	 d ƒ|  j d d d d	 d ƒ|  j d d d d	 d d d ƒ|  j d d d d	 d ƒ|  j d d	 d  ƒ|  j d! d	 d" d d# ƒ|  j d$ d	 d% d d& ƒ|  j d' d( d d d	 d) ƒ|  j d* d+ d, d d d	 d- ƒ|  j d. d d/ d d0 d1 t j d/ d2 ƒ j ƒ  d2 k d	 d3 ƒ|  j d4 d d d d5 d	 d6 ƒ|  j d7 d8 d9 d t d	 d: ƒt |  ƒ |  S(;   Nt   descriptionsG  
Tool for building conda packages. A conda package is a binary tarball
containing system-level libraries, Python modules, executable programs, or
other components. conda keeps track of dependencies between packages and
platform specifics, making it simple to create working environments from
        different sets of packages.t   conflict_handlert   resolves   -Vs	   --versiont   actiont   versiont   helps-   Show the conda-build version number and exit.s   conda-build %ss   -ns   --no-sourcet
   store_truesg   When templating can't be completed, do not obtain the source to try fill in related template variables.s   --outputs?   Output the conda package filename which would have been createds   --pythont   appends+   Set the Python version used by conda build.s   --perls)   Set the Perl version used by conda build.s   --numpys*   Set the NumPy version used by conda build.s   --Rs&   Set the R version used by conda build.R   t   r_bases   --luas(   Set the Lua version used by conda build.s   --bootstraps—   Provide initial configuration in addition to recipe.
        Can be a path to or name of an environment, which will be emulated
        in the package.s   --append-filesc   Append data in meta.yaml with fields from this file.  Jinja2 is not done
        on appended fieldst   append_sections_files   --clobber-filesf   Clobber data in meta.yaml with fields from this file.  Jinja2 is not done
        on clobbered fields.t   clobber_sections_files   -ms   --variant-config-filess•   Additional variant config files to add.  These yaml files can contain
        keys such as `c_compiler` and `target_platform` to form a build matrix.s   -es   --exclusive-config-filess   --exclusive-config-files}  Exclusive variant config files to add. Providing files here disables
        searching in your home directory and in cwd.  The files specified here come at the
        start of the order, as opposed to the end with --variant-config-files.  Any config
        files in recipes and any config files specified with --variant-config-files will
        override values from these files.s   --old-build-stringt   filename_hashingt   store_falset   defaultt   truesÔ   Disable hash additions to filenames to distinguish package variants from one another. NOTE: any filename collisions are yours to handle. Any variants with overlapping names within a build will clobber each other.s   --use-channeldatat   use_channeldatasx   Use channeldata, if available, to determine run_exports. Otherwise packages are downloaded to determine this informations
   --variantst   nargsi   sb   Variants to extend the build matrix. Must be a valid YAML instance, such as "{python: [3.6, 3.7]}"(   R   t   add_argumentR   R   t   gett   lowerR   R   (   t   p(    (    s:   lib/python2.7/site-packages/conda_build/cli/main_render.pyt   get_render_parser-   sŽ    				
c         C` sp   t  ƒ  } | j d d d d ƒ| j d d d d d ƒ| j d	 d
 d d d ƒ| j |  ƒ \ }  } | |  f S(   Ns   -fs   --fileR-   sS   write YAML to file, given as argument here.              Overwrites existing files.t   recipet   metavart   RECIPE_PATHs   Path to recipe directory.s	   --verboseR+   R.   s>   Enable verbose output from download tools and progress updates(   R=   R9   t   parse_known_args(   t   argsR<   t   _(    (    s:   lib/python2.7/site-packages/conda_build/cli/main_render.pyt
   parse_argsœ   s    		c   	      C` s¬  t  |  ƒ \ } }  t d  |  j  } t |  j | d |  j ƒ} t | ƒ t |  j ƒ | _	 |  j
 | _
 |  j r… t | _ t | _ n  t j |  j d | d |  j d |  j ƒ} | r¤|  j r	t t j d ƒ 3 t j | d | ƒ} t d j t | ƒ ƒ ƒ Wd  QXq¨t j d t j ƒ x‰ | D]z \ } } } t d ƒ t d ƒ t d ƒ t | j ƒ  ƒ t d	 ƒ t d
 ƒ t d	 ƒ t t j | |  j d t ƒƒ q#Wn | Sd  S(   Nt   variantst   configt   no_download_sourcei   s   
t   levels   --------------s   Hash contents:s
   ----------s
   meta.yaml:t   suppress_outputs(    RD   R
   R'   t   __dict__R   R>   RE   R   R   t   channel_urlst   override_channelst   outputt   Falset   verboset   debugR	   t   rendert	   no_sourceR   t   loggingt   CRITICALt   get_output_file_pathst   printt   joint   sortedt   basicConfigt   INFOR   t   get_hash_contentst   output_yamlt   filet   True(	   RB   t   print_resultsR<   RF   RE   t   metadata_tuplest   pathst   mRC   (    (    s:   lib/python2.7/site-packages/conda_build/cli/main_render.pyt   execute³   s8    
				"





&c           C` s   t  t j d ƒ S(   Ni   (   Rc   t   syst   argv(    (    (    s:   lib/python2.7/site-packages/conda_build/cli/main_render.pyt   mainÛ   s    t   __main__($   t
   __future__R    R   R   t   argparseRS   Rd   R   R   t   yaml.parserR   t   conda_build.conda_interfaceR   R   R   t   conda_buildR   R	   t   conda_build.configR
   R   t   conda_build.variantsR   R   t   conda_build.utilsR   t   platformt   on_wint   ActionR   R=   RD   R^   Rc   Rf   R%   (    (    (    s:   lib/python2.7/site-packages/conda_build/cli/main_render.pyt   <module>   s&   	o	(	