
    si                        S r SSKJr  SSKrSSKJr  \(       a  SSKJr  SSKJr  SSK	J
r
  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJr   " S S\5      rg)zDefine requirements.txt spec.    )annotationsN)TYPE_CHECKING)ClassVar   )context)
deprecated)CondaValueError)yield_lines)Environment)	MatchSpec)EnvironmentSpecBase   )EnvironmentYamlc                  h   \ rS rSr% SrSrS\S'   S1rS\S'   \R                  " S	S
S5       S     SS jj5       r
\\" SS
SS9S 5       5       r\R                  \" SS
SS9S 5       5       r\" SS
SS9SS j5       r\" SS
SS9SS j5       rSS jr\\" S
SSS9SS j5       5       r\SS j5       rSrg) RequirementsSpec   zr
Reads dependencies from requirements files (including explicit files)
and returns an Environment object from it.
N
str | Nonemsgz.txtzClassVar[set[str]]
extensionsz24.7z26.3namec                    Xl         X l        g)zInitialize the requirements specification.

:param filename: Path to the requirements file
:param name: (Deprecated) Name of the environment
:param kwargs: Additional arguments
N)filename_name)selfr   r   kwargss       <lib/python3.13/site-packages/conda/env/specs/requirements.py__init__RequirementsSpec.__init__    s     !
    z25.9z#This attribute is not used anymore.)addendumc                    U R                   $ Nr   r   s    r   r   RequirementsSpec.name-   s     zzr   c                    Xl         g r"   r#   )r   values     r   r   r%   2   s	     
r   z This method is not used anymore.c                    U R                   (       a/  [        R                  R                  U R                   5      (       a  gSU l        g)zMCheck if the file exists.

:return: True if the file exists, False otherwise
TzThere is no requirements.txtF)r   ospathexistsr   r$   s    r   _valid_fileRequirementsSpec._valid_file7   s.     ==RWW^^DMM::5DHr   c                .    U R                   c  SU l        gg)zQCheck if the name is valid.

:return: True if the name is valid, False otherwise
z$The environment does not have a nameFT)r   r   r$   s    r   _valid_nameRequirementsSpec._valid_nameC   s     99=DHr   c                n  ^ U R                   c  g[        R                  R                  U R                   5      u  nm[	        U4S jU R
                   5       5      (       d1  SU R                    SSR                  U R
                  5       3U l        g[        [        U R                   5      5      nSU;   a  gg)a"  
Validates that this spec can process the environment definition.
This checks if:
    * a filename was provided
    * the file has a supported extension
    * the file exists
    * the file content is valid for this specifier type

:return: True if the file can be handled, False otherwise
Fc              3  ,   >#    U  H	  oT:H  v   M     g 7fr"    ).0spec_extfile_exts     r   	<genexpr>.RequirementsSpec.can_handle.<locals>.<genexpr>b   s     HHx's   zFile z& does not have a supported extension: z, z	@EXPLICITT)
r   r)   r*   splitextanyr   joinr   listr
   )r   _dependencies_listr6   s      @r   
can_handleRequirementsSpec.can_handleO   s     ==  gg&&t}}58 HHHHt}}o-STXT]T]^b^m^mTnSopDH !T]]!;<++r   z26.9z*This method is not used anymore, use 'env'c                    U R                   (       d  [        S5      e[        [        U R                   5      5      n[	        UU R                   S9$ )z
Build an environment from the requirements file.

This method reads the file as a generator and passes it directly to EnvironmentYaml.

:return: An Environment object containing the package specifications
:raises ValueError: If the file cannot be read
No filename provided)dependenciesr   )r   r	   r<   r
   r   )r   r>   s     r   environmentRequirementsSpec.environmentm   sD     }}!"899 !T]]!;<*]]
 	
r   c                    U R                   (       d  [        S5      e[        [        U R                   5      5      nU Vs/ s H  n[	        U5      PM     nn[        [        R                  US9$ s  snf )z
Build an environment from the requirements file.

:return: An Environment object containing the package specifications
:raises ValueError: If the file cannot be read
rB   )platformrequested_packages)r   
ValueErrorr<   r
   r   r   r   subdir)r   r>   deprH   s       r   envRequirementsSpec.env   se     }}344 !T]]!;<8IJ8Iin8IJ^^1
 	
 Ks   A.)r   r   r   )NN)r   r   r   r   returnNone)rN   bool)rN   r   )rN   r   )__name__
__module____qualname____firstlineno____doc__r   __annotations__r   r   argumentr   propertyr   setterr,   r/   r?   rD   rL   __static_attributes__r3   r   r   r   r      s,   
 C&,XJ"-0>B
"
1;
	
 1
 )NO P  
[[)NO P  )KL	 M	 )KL	 M	< )UV
 W 
& 
 
r   r   )rU   
__future__r   r)   typingr   r   base.contextr   deprecationsr   
exceptionsr	   gateways.disk.readr
   models.environmentr   models.match_specr   plugins.typesr   rL   r   r   r3   r   r   <module>rd      s@    $ " 	   # & ) - - * 0 !}
* }
r   