
    q"h
O                        % S r SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r
SSKJr  SSKJr  SSKJrJrJrJrJrJrJrJrJrJr  SSKJr  SSKJrJr  SSKJr  \(       a  SS	K J!r!  SS
K"J#r#  S/r$\\\%\&4      r'\\&/\\&\4   4   r(\RR                  " S\RT                  5      r+\RR                  " S5      r,\RR                  " S5      r-\R\                  \R^                  \R`                  \Rb                  \Rd                  \Rf                  \Rh                  \Rj                  \Rl                  \Rn                  \Rp                  \Rr                  \Rt                  \Rv                  /r<\\S\Rz                  4      \>S'   \R~                  \R                  \R                  /rB\\S\Rz                  4      \>S'   \R                  /rC\\S\Rz                  4      \>S'   \B V s/ s H  n \&" U " 5       R                  5      PM     sn rE\C V s/ s H  n \&" U " 5       R                  5      PM     sn rF\R                  S4\R                  S4\R                  S4\R                  S4\R                  S4\R                  S4\R                  S4/rN\\\O\&4      \>S'   \RR                  " S5      rPSrQ\R                  " \S5      rT\" SS9 " S S5      5       rU\" SS9 " S  S!5      5       rV   SBS"\&S#S$S%\S&   S'\\R                     S(\WS)\\USS4   4S* jjrXS+\&S)\'4S, jrY SCS-\VS'\\R                     S)\U4S. jjrZ   SDS/\S"\&S0\%S%\S&   S'\\R                     S#\S$   S)S4S1 jjr[   SDS-\VS'\\R                     S%\S&   S#\S$   S)\\U   4
S2 jjr\ " S3 S45      r]S%\S&   S)\(4S5 jr^S-\&S)\\&\&4   4S6 jr_ " S7 S8\`5      raS)\R                  4S9 jrcS:\'S)\'4S; jrdS:\'S)\'4S< jreS:\'S)\'4S= jrfS>\&S#S$S)\\&\&4   4S? jrgS@\OS>\&S)\&4SA jrhgs  sn f s  sn f )Ez
Requirements file parsing
    N)	dataclass)Values)
TYPE_CHECKINGAnyCallableDict	GeneratorIterableListNoReturnOptionalTuple)
cmdoptions)InstallationErrorRequirementsFileParseError)SearchScope)PackageFinder)
PipSessionparse_requirementsz^(http|https|file):z(^|\s+)#.*$z#(?P<var>\$\{(?P<name>[A-Z0-9_]+)\}).SUPPORTED_OPTIONSSUPPORTED_OPTIONS_REQSUPPORTED_OPTIONS_EDITABLE_REQzutf-8zutf-32z	utf-32-bez	utf-32-lezutf-16z	utf-16-bez	utf-16-leBOMSs   coding[:=]\s*([-\w.]+)T)frozenc                   l    \ rS rSr% Sr\\S'   \\S'   \\S'   \\S'   \\	\\
4      \S'   \\   \S'   S	rg
)ParsedRequirementi   requirementis_editable
comes_from
constraintoptionsline_sourcer   r    r!   r"   r#   r$    N)__name__
__module____qualname____firstlineno__	__slots__str__annotations__boolr   r   r   __static_attributes__r%       L/var/www/html/env/lib/python3.13/site-packages/pip/_internal/req/req_file.pyr   r   i   s?    I Od38n%%#r/   r   c                       \ rS rSr% Sr\\S'   \\S'   \\S'   \\S'   \	\S'   \
S\	4S	 j5       r\
S\\   4S
 j5       rSrg)
ParsedLine}   )filenamelinenoargsoptsr"   r4   r5   r6   r7   r"   returnc                 @    [        U R                  R                  5      $ N)r-   r7   	editablesselfs    r0   r    ParsedLine.is_editable   s    DII''((r/   c                     U R                   (       a  U R                   $ U R                  (       a  U R                  R                  S   $ g )Nr   )r6   r    r7   r;   r<   s    r0   r   ParsedLine.requirement   s4    999999&&q))r/   r%   N)r&   r'   r(   r)   r*   r+   r,   intr   r-   propertyr    r   r   r.   r%   r/   r0   r2   r2   }   sY    DIMK
I
L)T ) ) Xc]  r/   r2   r4   sessionr   finderr   r#   r"   r8   c              #      #    [        U5      n[        X5      nUR                  X5       H  n[        XsX!S9nUc  M  Uv   M     g7f)aU  Parse a requirements file and yield ParsedRequirement instances.

:param filename:    Path or url of requirements file.
:param session:     PipSession instance.
:param finder:      Instance of pip.index.PackageFinder.
:param options:     cli options.
:param constraint:  If true, parsing a constraint file rather than
    requirements file.
)r#   rD   rC   N)get_line_parserRequirementsFileParserparsehandle_line)	r4   rC   rD   r#   r"   line_parserparserparsed_line
parsed_reqs	            r0   r   r      sK       "&)K#G9F||H9 

 ! :s
   6A	Acontentc                 x    [        U R                  5       SS9n[        U5      n[        U5      n[	        U5      nU$ )zpSplit, filter, and join lines, and return a line iterator

:param content: the content of the requirements file
   )start)	enumerate
splitlines
join_linesignore_commentsexpand_env_variables)rN   
lines_enums     r0   
preprocessrX      s=    
  )););)=QGJJ'J ,J%j1Jr/   linec           	      "   SR                  U R                  (       a  SOSU R                  U R                  5      nU R                  c   eU R
                  (       a  [        nO[        n0 nU HY  nXPR                  R                  ;   d  M  U R                  R                  U   (       d  M>  U R                  R                  U   XE'   M[     SU R                   SU R                   3n[        U R                  U R
                  UU R                  UUS9$ )Nz{} {} (line {})z-cz-rline  of r   )formatr"   r4   r5   r   r    #SUPPORTED_OPTIONS_EDITABLE_REQ_DESTSUPPORTED_OPTIONS_REQ_DESTr7   __dict__r   )rY   r#   line_comes_fromsupported_destreq_optionsdestr$   s          r0   handle_requirement_linere      s    
 (..TO ''' <3K99%%%$))*<*<T*B*B $		 2 24 8K  $++d4==/:K$$$$"?? r/   r7   r5   c                   ^ U R                   (       a  [        R                  SUU5        T(       ab  U R                  (       a  U R                  Tl        U R                  (       a/  TR                  R                  U4S jU R                   5       5        U(       Ga  UR                  nUR                  nUR                  R                  nU R                  SL a  Sn/ nU R                  (       a  U(       d  U R                  /nU R                  (       a"  U(       d  UR                  U R                  5        U R                  (       a  U R                  S   n	[        R                  R                  [        R                  R                  U5      5      n
[        R                  R!                  X5      n[        R                  R#                  U5      (       a  Un	UR%                  U	5        U(       a  UR'                  U5        [)        UUUS9nXl        U R*                  (       a  UR-                  5         U R.                  (       a  UR1                  5         U(       a4  U R2                  =(       d    /  H  nSU SU 3nUR5                  XS9  M     g g g )	Nz>%s line %s has --hash but no requirement, and will be ignored.c              3   J   >#    U  H  oTR                   ;  d  M  Uv   M     g 7fr:   )features_enabled).0fr#   s     r0   	<genexpr>%handle_option_line.<locals>.<genexpr>   s"      ,0aW=U=U4U0s   #	#Tr   )
find_links
index_urlsno_indexr[   r\   )source)hashesloggerwarningrequire_hashesrh   extendrm   rn   search_scopero   	index_urlextra_index_urlsospathdirnameabspathjoinexistsappendupdate_index_urlsr   preset_allow_all_prereleasesprefer_binaryset_prefer_binarytrusted_hostsadd_trusted_host)r7   r4   r5   rD   r#   rC   rm   rn   ro   valuereq_dirrelative_to_reqs_filerv   hostrp   s       `          r0   handle_option_liner      s    {{L	
 %)%8%8G"  $$++ ,00, 
 &&
&&
&&//==D HJ>>(..)J  d334?? OOA&Eggoobggooh&?@G$&GGLL$@!ww~~344-e$%%j1"!!

 +88,,.$$&**0b0 XJ7(((= 1 O r/   c                     U R                   b  [        X5      nU$ [        U R                  U R                  U R
                  UUU5        g)a  Handle a single parsed requirements line; This can result in
creating/yielding requirements, or updating the finder.

:param line:        The parsed line to be processed.
:param options:     CLI options.
:param finder:      The finder - updated by non-requirement lines.
:param session:     The session - updated by non-requirement lines.

Returns a ParsedRequirement object if the line is a requirement line,
otherwise returns None.

For lines that contain requirements, the only options that have an effect
are from SUPPORTED_OPTIONS_REQ, and they are scoped to the
requirement. Other options from SUPPORTED_OPTIONS may be present, but are
ignored.

For lines that do not contain requirements, the only options that have an
effect are from SUPPORTED_OPTIONS. Options from SUPPORTED_OPTIONS_REQ may
be present, but are ignored. These lines may contain multiple options
(although our docs imply only one is supported), and all our parsed and
affect the finder.
N)r   re   r   r7   r4   r5   )rY   r#   rD   rC   rM   s        r0   rI   rI   $  sK    : #,T;
IIMMKK	
 r/   c                       \ rS rSrSSS\SS4S jrS\S	\S\\	SS4   4S
 jr
S\S	\S\\\\\   4      S\\	SS4   4S jrS\S	\S\\	SS4   4S jrSrg)rG   iP  rC   r   rJ   r8   Nc                     Xl         X l        g r:   )_session_line_parser)r=   rC   rJ   s      r0   __init__RequirementsFileParser.__init__Q  s    
  'r/   r4   r"   c              #      #    U R                  X[        R                  R                  U5      S0/5       Sh  vN   g N7f)z*Parse a given file, yielding parsed lines.N)_parse_and_recursery   rz   r|   )r=   r4   r"   s      r0   rH   RequirementsFileParser.parseY  s9      **BGGOOH$=t#D"E
 	
 	
s   6A >A parsed_files_stackc              #     #    U R                  X5       GH  nUR                  Gc  UR                  R                  (       d  UR                  R                  (       Ga^  UR                  R                  (       a  UR                  R                  S   nSnOUR                  R                  S   nSn[
        R                  U5      (       a   [        R                  R                  X5      nOt[
        R                  U5      (       dZ  [        R                  R                  [        R                  R                  [        R                  R                  U5      U5      5      nUS   nXW;   a   Xu   nUb  SU 3OSn	[        U SU U	 35      eUR!                  5       n
XU'   U R#                  XVU
/UQ5       S h  vN   GM  Uv   GM     g  N7f)Nr   FTz and again in  z" recursively references itself in )_parse_filer   r7   requirementsconstraints	SCHEME_REsearchurllibrH   urljoinry   rz   r|   r}   r{   r   copyr   )r=   r4   r"   r   rY   req_pathnested_constraintparsed_filesinitial_filetailnew_parsed_filess              r0   r   )RequirementsFileParser._parse_and_recursea  s     $$X:D'		&&$))*?*?*? 99))#yy55a8H(-%#yy44Q7H(,% ##H--%||33HGH"))(33  "wwGGOOH5$ H  2!4+#/#9L (3 )7 
 5#*$FxjQUPVW  $0#4#4#6 -5*222B1XEW1X   
Y ;Ps   F1G3G4Gc              #     #    [        XR                  5      u  p4[        U5      nU H*  u  pg U R                  U5      u  p[        UUUU	U5      v   M,     g ! [         a"  n
SU SU
R
                   3n[        U5      eS n
A
ff = f7f)NzInvalid requirement: 
)get_file_contentr   rX   r   OptionParsingErrormsgr   r2   )r=   r4   r"   _rN   rW   line_numberrY   args_strr7   er   s               r0   r   "RequirementsFileParser._parse_file  s      &h>
(
!+K6!%!2!24!8   ", & 6-dV2aeeW=0556s(   *BA B
B A==BB)r   r   )r&   r'   r(   r)   
LineParserr   r+   r-   r	   r2   rH   r   r   r   r   r   r.   r%   r/   r0   rG   rG   P  s    ((  ( 
	(

)-
	:tT)	*
22 2 !c8C=&8!9:	2
 
:tT)	*2h)-	:tT)	*r/   rG   c                 J   ^  S[         S[        [         [        4   4U 4S jjnU$ )NrY   r8   c                 ,  > [        5       nUR                  5       nS Ul        T	(       a  T	R                  Ul        [	        U 5      u  p4 [
        R                  " U5      nUR                  XR5      u  pxX74$ ! [         a  n[        SU 35      UeS nAff = f)NzCould not split options: )
build_parserget_default_valuesrw   format_controlbreak_args_optionsshlexsplit
ValueErrorr   
parse_args)
rY   rK   defaultsr   options_strr#   r   r7   r   rD   s
            r0   
parse_line#get_line_parser.<locals>.parse_line  s     ,,.!&,&;&;H# 24 8	Wkk+.G ##G6~  	W$'@%NOUVV	Ws   	A5 5
B?BB)r+   r   r   )rD   r   s   ` r0   rF   rF     s'     sF{!3 ( r/   c                 (   U R                  S5      n/ nUSS nU HS  nUR                  S5      (       d  UR                  S5      (       a    O&UR                  U5        UR                  S5        MU     SR	                  U5      SR	                  U5      4$ )zBreak up the line into an args and options string.  We only want to shlex
(and then optparse) the options, not the args.  args can contain markers
which are corrupted by shlex.
 N-z--r   )r   
startswithr   popr}   )rY   tokensr6   r#   tokens        r0   r   r     s    
 ZZ_FDQiGC  E$4$4T$:$:KKKKN  88D>388G,,,r/   c                   &    \ rS rSrS\SS4S jrSrg)r   i  r   r8   Nc                     Xl         g r:   r   r=   r   s     r0   r   OptionParsingError.__init__  s    r/   r   )r&   r'   r(   r)   r+   r   r.   r%   r/   r0   r   r     s    C D r/   r   c                      [         R                  " SS9n [        [        -   nU H  nU" 5       nU R	                  U5        M     S[
        S[        SS4S jnX@l        U $ )z/
Return a parser for parsing requirement lines
F)add_help_optionr=   r   r8   r   c                     [        U5      er:   )r   r   s     r0   parser_exit!build_parser.<locals>.parser_exit  s     %%r/   )optparseOptionParserr   r   
add_optionr   r+   exit)rK   option_factoriesoption_factoryoptionr   s        r0   r   r     sf     ""59F(+@@*!&! +&# &C &J &
 KMr/   rW   c              #     #    Sn/ nU  H  u  p4UR                  S5      (       a  [        R                  U5      (       a\  [        R                  U5      (       a  SU-   nU(       a/  UR                  U5        Uc   eUSR	                  U5      4v   / nM  X44v   M  U(       d  UnUR                  UR                  S5      5        M     U(       a  Uc   eUSR	                  U5      4v   gg7f)zJoins a line ending in '' with the previous line (except when following
comments).  The joined line takes on the index of the first line.
N\r   r   )endswith
COMMENT_REmatchr   r}   strip)rW   primary_line_numbernew_liner   rY   s        r0   rT   rT     s      H'}}T""j&6&6t&<&<%%Tz%*666)2778+<<<!''&1#OODJJt,- ($ "...!2778#444 s   C(C*c              #      #    U  H9  u  p[         R                  SU5      nUR                  5       nU(       d  M4  X4v   M;     g7f)z)
Strips comments and filter empty lines.
r   N)r   subr   )rW   r   rY   s      r0   rU   rU     s=      (~~b$'zz|4##	 (s
   3A
Ac              #      #    U  HX  u  p[         R                  U5       H5  u  p4[        R                  " U5      nU(       d  M$  UR	                  X55      nM7     X4v   MZ     g7f)a  Replace all environment variables that can be retrieved via `os.getenv`.

The only allowed format for environment variables defined in the
requirement file is `${MY_VARIABLE_1}` to ensure two things:

1. Strings that contain a `$` aren't accidentally (partially) expanded.
2. Ensure consistency across platforms for requirement files.

These points are the result of a discussion on the `github pull
request #3514 <https://github.com/pypa/pip/pull/3514>`_.

Valid characters in variable names follow the `POSIX standard
<http://pubs.opengroup.org/onlinepubs/9699919799/>`_ and are limited
to uppercase letter, digits and the `_` (underscore).
N)
ENV_VAR_REfindallry   getenvreplace)rW   r   rY   env_varvar_namer   s         r0   rV   rV     sY       (!+!3!3D!9GIIh'E<</D ":  (s   A A"urlc                    [         R                  R                  U 5      R                  nUS;   a7  SSKJn  UR                  U 5      nU" U5        UR                  UR                  4$  [        U S5       nUR                  5       nSSS5        [        WU 5      nX4$ ! , (       d  f       N= f! [         a  n[        SU 35      eSnAff = f)a
  Gets the content of a file; it may be a filename, file: URL, or
http: URL.  Returns (location, content).  Content is unicode.
Respects # -*- coding: declarations on the retrieved files.

:param url:         File path or url.
:param session:     PipSession instance.
)httphttpsfiler   )raise_for_statusrbNz"Could not open requirements file: )r   rH   urlsplitschemepip._internal.network.utilsr   getr   textopenreadOSErrorr   _decode_req_file)	r   rC   r   r   resprj   raw_contentexcrN   s	            r0   r   r   7  s     \\""3'..F**@{{3xx""L#t_&&(K 
 {C0G< _ L"DSE JKKLs6   (B- 4BB- 
B*&B- *B- -
C
7CC
datac                 ~   [          H:  u  p#U R                  U5      (       d  M  U [        U5      S  R                  U5      s  $    U R	                  S5      S S  H[  nUSS S:X  d  M  [
        R                  U5      nUc  M(  UR                  5       S   R                  S5      nU R                  U5      s  $     U R                  [        5      $ ! [         ad    [        R                  " S5      =(       d    [        R                  " 5       n[        R                  " SU[        UU5        U R                  U5      s $ f = f)	N   
   r   rP      #asciiFzunable to decode data from %s with default encoding %s, falling back to encoding from locale: %s. If this is intentional you should specify the encoding with a PEP-263 style comment, e.g. '# -*- coding: %s -*-')r   r   lendecoder   PEP263_ENCODING_REr   groupsDEFAULT_ENCODINGUnicodeDecodeErrorlocalegetpreferredencodingsysgetdefaultencodingloggingrs   )r   r   bomencodingrY   resultlocale_encodings          r0   r   r   U  s   ??3C
#**844  

5!"1%!9'..t4F!!==?1-44W={{8,, &,{{+,, , 55e<X@V@V@XA 		
 {{?++,s   9C A+D<;D<)NNFr:   )NNN)i__doc__codecsr	  r  r   ry   rer   r  urllib.parser   dataclassesr   r   typingr   r   r   r   r	   r
   r   r   r   r   pip._internal.clir   pip._internal.exceptionsr   r   !pip._internal.models.search_scoper   "pip._internal.index.package_finderr   pip._internal.network.sessionr   __all__rA   r+   ReqFileLinesr   compileIr   r   r   rw   extra_index_urlro   r   r   editablerm   	no_binaryonly_binaryr   rt   r   trusted_hostuse_new_featurer   Optionr,   global_optionshashconfig_settingsr   r   rd   r_   r^   BOM_UTF8	BOM_UTF32BOM_UTF32_BEBOM_UTF32_LE	BOM_UTF16BOM_UTF16_BEBOM_UTF16_LEr   bytesr  r  	getLoggerr&   rr   r   r2   r-   r   rX   re   r   rI   rG   rF   r   	Exceptionr   r   r   rT   rU   rV   r   r   )os   0r0   <module>r6     s7       	 	  
  !    ) R 9@8
 c3h(seU3;//0
JJ-rtt4	ZZ'
 ZZ>?
 NN; 4hoo!567 & OO? tHS(//%9:;  H Xc8??.B%C D  6KK5Jc!#((m5JK 9'9aCM9' # __gx +&+&x +&+&!d5  ZZ :;  			8	$ $  & $  4 )-)- _% hoo&	
   $,-6	 	 	 *.
hoo& L )-)-&*C>
C>C> C> _%	C>
 hoo&C> l#C> 
C>P *.(,&*	)
)hoo&) _%) l#	)
  )XZ ZzH_5 * 0-S -U38_ -" 
h++ .5< 5L 5>$ $ $ \  l  6#  sCx <,5 ,s ,s ,G L's   #!P!P