
    %d                        d dl mZ d dlZd dlmZmZ d dlmZmZm	Z	 d dl
mZ ddlmZ ddlmZ dd	lmZ eee         ee         f         ZddZeeeef         Z	 dddZdS )    )annotationsN)UnionType) EnvironmentFileExtensionNotValidEnvironmentFileNotFoundSpecNotFound)CONDA_SESSION_SCHEMES   )BinstarSpec)RequirementsSpec)YamlFileSpecfilenamestrreturnFileSpecTypesc                   t           j                            t          j                  }t          j                            |           \  }}t          j                            |           p"|                     dd          d         t          v }|rE|dk    s||vrt          |           |t           j        v rt           S |t          j        v rt          S dS t          |           )z
    Determine spec class to use from the provided ``filename``

    :raises EnvironmentFileExtensionNotValid | EnvironmentFileNotFound:
    z://r
   r    )r   N)r   
extensionsunionr   ospathsplitextisfilesplitr	   r   r   )r   all_valid_exts_extfile_existss        8lib/python3.11/site-packages/conda_env/specs/__init__.pyget_spec_class_from_filer       s     ",223C3NOONWh''FAs '..**bhnnUA.F.Fq.IMb.bK 9"9 	$>1 	$28<<<L++ 	$$// 	$##	$ 	$ &x8888    name	directoryremote_definition	SpecTypesc                   |:t          |          }|                                r|S t          |j                  |3t	          |          } || ||          }|                                r|S t          |j                  )z
    Return the appropriate spec type to use.

    :raises SpecNotFound: Raised if no suitable spec class could be found given the input
    :raises EnvironmentFileExtensionNotValid | EnvironmentFileNotFound:
    N)r"   )r"   r   r#   )r   
can_handler   msgr    )r"   r   r#   r$   spec
spec_classs         r   detectr+   1   s      ) 1222?? 	)Ktx((( -h77
zth)LLL?? 	K
tx
 
  r!   )r   r   r   r   )NNNN)
r"   r   r   r   r#   r   r$   r   r   r%   )
__future__r   r   typingr   r   conda.exceptionsr   r   r   !conda.gateways.connection.sessionr	   binstarr   requirementsr   	yaml_filer   r   r    r%   r+    r!   r   <module>r4      s%   # " " " " " 				                 
 D C C C C C             * * * * * * # # # # # # d<($/?*@@A9 9 9 9. +|-==>	 ]a! ! ! ! ! ! !r!   