
    <Bh	                     J    S r SSK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.    N   )
deprecated)EnvironmentSpecBase   )Environmentc                      \ rS rSrSrSrS1r\R                  " SSS5      SS 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 5       r\" S	SSS9S 5       rS\4S jr\
S 5       rSrg)RequirementsSpec   z\
Reads dependencies from a requirements.txt file
and returns an Environment object from it.
Nz.txtz24.7z26.3namec                 ,    Xl         S U l        S U l        g N)filename_namemsg)selfr   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                   $ r   r   r   s    r   r   RequirementsSpec.name   s     zzr   c                     Xl         g r   r   )r   values     r   r   r       s	     
r   z This method is not used anymore.c                 p    [         R                  R                  U R                  5      (       a  gSU l        g)NTzThere is no requirements.txtF)ospathexistsr   r   r   s    r   _valid_fileRequirementsSpec._valid_file%   s&    77>>$--((5DHr   c                      U R                   c  gg)NFT)r   r   s    r   _valid_nameRequirementsSpec._valid_name-   s    99r   returnc                    ^ ^ T R                   c  g[        R                  R                  T R                   5      u  nm[	        UU 4S j[
        R                  5       5      $ )z
Validates loader can process environment definition.
This can handle if:
    * the provided file ends in the supported file extensions (.txt)
    * the file exists

:return: True if the file can be parsed and handled, False otherwise
Fc              3      >#    U  H:  nUT:H  =(       a)    [         R                  R                  TR                  5      v   M<     g 7fr   )r   r    r!   r   ).0spec_extfile_extr   s     r   	<genexpr>.RequirementsSpec.can_handle.<locals>.<genexpr>E   s6      
7  BRWW^^DMM%BB7s   AA)r   r   r    splitextanyr	   
extensions)r   _r,   s   ` @r   
can_handleRequirementsSpec.can_handle4   sR     ==  gg&&t}}58  
,77
 
 	
r   c                    / n[        U R                  5       nU HC  nUR                  5       nU(       a  UR                  S5      (       a  M2  UR	                  U5        ME     S S S 5        [        US9$ ! , (       d  f       N= f)N#)dependencies)openr   strip
startswithappendr   )r   r7   reqfilelines       r   environmentRequirementsSpec.environmentJ   sg    $-- Gzz|ts33##D)	   ! 55 ! s   A
A33
B)r   r   r   r   )__name__
__module____qualname____firstlineno____doc__r   r1   r   argumentr   propertyr   setterr"   r%   boolr3   r>   __static_attributes__ r   r   r	   r	      s    
 CJ0 1
 )NO P  
[[)NO P  )KL M )KL M
D 
, 6 6r   r	   )	rD   r   deprecationsr   plugins.typesr   envr   r	   rJ   r   r   <module>rN      s%    $ 	 & 0 G6* G6r   