
    <Bh!                     Z    S r SSKrSSKJr  SSKJr  SSKJr  \" \5      r	 " S S	\5      r
g)
zDefine YAML spec.    N)	getLogger   )EnvironmentSpecBase   )envc                   @    \ rS rSrSrSS1rS	S jrS r\S 5       r	Sr
g)
YamlFileSpec   Nz.yamlz.ymlc                     Xl         S U l        g N)filenamemsg)selfr   kwargss      9lib/python3.13/site-packages/conda/env/specs/yaml_file.py__init__YamlFileSpec.__init__   s         c                 X  ^ [         R                  R                  U R                  5      u  nm[	        U4S j[
        R                  5       5      (       d  g [        R                  " U R                  5      U l	        g! [         a"    [        R                  SU R                  SS9   gf = f)a.  
Validates loader can process environment definition.
This can handle if:
    * the provided file exists
    * the provided file ends in the supported file extensions (.yaml or .yml)
    * the env file can be interpreted and transformed into
      a `conda.env.env.Environment`

:return: True or False
c              3   ,   >#    U  H	  oT:H  v   M     g 7fr    ).0spec_extfile_exts     r   	<genexpr>*YamlFileSpec.can_handle.<locals>.<genexpr>%   s     P8OHx'8Os   FTz(Failed to load %s as `environment.yaml`.)exc_info)ospathsplitextr   anyr	   
extensionsr   	from_file_environment	Exceptionlogdebug)r   _r   s     @r   
can_handleYamlFileSpec.can_handle   s     gg&&t}}58 P8O8OPPP	 #dmm <D 	II:DMMTX   		s   %A= =)B)(B)c                 \    U R                   (       d  U R                  5         U R                   $ r   )r$   r)   )r   s    r   environmentYamlFileSpec.environment1   s!      OO   r   )r$   r   r   r   )__name__
__module____qualname____firstlineno__r$   r"   r   r)   propertyr,   __static_attributes__r   r   r   r	   r	      s/    L6"J6 ! !r   r	   )__doc__r   loggingr   plugins.typesr    r   r.   r&   r	   r   r   r   <module>r8      s-     	  0 '!& '!r   