
    wBf 	                        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y)    )annotationsN)TypeUnion   ) EnvironmentFileExtensionNotValidEnvironmentFileNotFoundSpecNotFound)CONDA_SESSION_SCHEMES   )BinstarSpec)RequirementsSpec)YamlFileSpecc                   t         j                  j                  t        j                        }t        j
                  j                  |       \  }}t        j
                  j                  |       xs | j                  dd      d   t        v }|rE|dk(  s||vrt        |       |t         j                  v rt         S |t        j                  v rt        S yt        |       )z
    Determine spec class to use from the provided ``filename``

    :raises EnvironmentFileExtensionNotValid | EnvironmentFileNotFound:
    z://r   r    )filenameN)r   
extensionsunionr   ospathsplitextisfilesplitr
   r   r   )r   all_valid_exts_extfile_existss        8lib/python3.12/site-packages/conda/env/specs/__init__.pyget_spec_class_from_filer      s     ",,223C3N3NONWWh'FAs 	x XHNN5!$<Q$?CX$X  "9>128<<L+++$///## 0 &x88    c                    |3t        |      }|j                         r|S t        |j                        |(t	        |      } || ||      }|j                         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:
    )name)r!   r   	directory)r   
can_handler	   msgr   )r!   r   r"   remote_definitionspec
spec_classs         r   detectr(   1   so     $ 12??Ktxx((-h7
th)L??K
txx
  r   )r   strreturnFileSpecTypes)NNNN)
r!   r)   r   r)   r"   r)   r%   r)   r*   	SpecTypes)
__future__r   r   typingr   r   
exceptionsr   r   r	   gateways.connection.sessionr
   binstarr   requirementsr   	yaml_filer   r+   r   r,   r(    r   r   <module>r5      s    # 	  
 A   * #d<($/?*@@A92 +|-==>	 !	!
!! ! 	!
 !r   