
    i                     b   % S SK Jr  S SKJr  S SKJr  S SKrS SKJr  S SKrS SK	J
r
  S SK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  \
(       a   S SK	Jr  S SKJr  \\\\\\   4   4   rS\S'   SS jr    SS jr      SS jr      SS jrSS jr Sr!          SS jr"SS jr#g)     )annotations)Iterable)SequenceN)Path)TYPE_CHECKING   )
UsageError)failabsolutepath)
commonpathsafe_exists)Union)	TypeAliasr   
ConfigDictc                     [         R                  " [        U 5      5      $ ! [         R                   a  n[	        [        U5      5      UeSnAff = f)zParse the given generic '.ini' file using legacy IniConfig parser, returning
the parsed object.

Raise UsageError if the file cannot be parsed.
N)	iniconfig	IniConfigstr
ParseErrorr	   )pathexcs     W/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/_pytest/config/findpaths.py_parse_ini_configr      sC    ,""3t9-- ,S"+,s   ! AA

Ac                P   U R                   S:X  aA  [        U 5      nSU;   a  [        US   R                  5       5      $ U R                  S:X  a  0 $  gU R                   S:X  ac  [        U 5      nSUR
                  ;   a  [        US   R                  5       5      $ SUR
                  ;   a  [        [        R                  SS9SS	9  gU R                   S
:X  a  [        R                  S:  a  SSKnOSSKnU R                  SS9n UR                  U5      nUR#                  S0 5      R#                  S0 5      R#                  SS5      nUb0  SS jnUR                  5        VV	s0 s H  u  pX" U	5      _M     sn	n$ g! UR                   a  n[!        U  SU 35      UeSnAff = fs  sn	nf )zLoad pytest configuration from the given file path, if supported.

Return None if the file does not contain valid pytest configuration.
z.inipytest
pytest.iniz.cfgztool:pytest	setup.cfg)filenameF)pytracez.toml)      r   Nzutf-8)encodingz: toolini_optionsc                F    [        U [        5      (       a  U $ [        U 5      $ N)
isinstancelistr   )vs    r   make_scalar/load_config_dict_from_file.<locals>.make_scalarX   s    &q$//q;SV;    )r+   objectreturnzstr | list[str])suffixr   dictitemsnamesectionsr
   CFG_PYTEST_SECTIONformatsysversion_infotomllibtomli	read_textloadsTOMLDecodeErrorr	   get)
filepathr   r:   	toml_textconfigr   resultr,   kr+   s
             r   load_config_dict_from_filerE   )   s    & %h/	y 	(+11344 }},	 -J C 
F	"%h/	I...	-066899+++ #**K*@%P2 - 
G	#w&#&&&8		<]]9-F FB'++Hb9==mTR< 39,,.A.$!A{1~%.AA && 	<zC512;	< Bs   E9  F"9F	FFc                   / SQnU Vs/ s H&  n[        U5      R                  S5      (       a  M$  UPM(     nnU(       d  U /nSnU Hv  n[        U5      nU/UR                  Q7 HT  nU HK  nXx-  n	U	R	                  5       (       d  M  U	R
                  S:X  a  Uc  U	n[        U	5      n
U
c  MC  XyU
4s  s  s  $    MV     Mx     Ub  UR                  U0 4$ SS0 4$ s  snf )ztSearch in the list of arguments for a valid ini-file for pytest,
and return a tuple of (rootdir, inifile, cfg-dict).)r   z.pytest.inipyproject.tomlztox.inir   -NrG   )r   
startswithr   parentsis_filer4   rE   parent)invocation_dirargsconfig_namesxfound_pyproject_tomlargargpathbaseconfig_namep
ini_configs              r   locate_configrX   `   s    L :t!3q6#4#4S#9AtD:(,s#/w/D+&99;;vv!116J6R/0,!;A!>J!-#
22  , 0  '#**,@"DDr># ;s
   #CCc                   S nU H\  nUR                  5       (       d  M  Uc  UnM!  X#R                  ;   d  X2:X  a  M7  X2R                  ;   a  UnMJ  [        X25      nUc  MZ  UnM^     Uc  U nU$ UR                  5       (       a  UR                  nU$ r(   )existsrJ   r   rK   rL   )rM   pathscommon_ancestorr   shareds        r   get_common_ancestorr^      s     $(O{{}}""O,,.$2I000"&#D:%&,O  (  
	 	 	"	")00r.   c                   ^^ SS jmSS jmSS jnUU4S jU  5       nU Vs/ s H  n[        U5      (       d  M  U" U5      PM     sn$ s  snf )Nc                $    U R                  S5      $ )NrH   )rI   rP   s    r   	is_option%get_dirs_from_args.<locals>.is_option   s    ||C  r.   c                *    U R                  S5      S   $ )Nz::r   )splitra   s    r   get_file_part_from_node_id6get_dirs_from_args.<locals>.get_file_part_from_node_id   s    wwt}Qr.   c                H    U R                  5       (       a  U $ U R                  $ r(   )is_dirrL   )r   s    r   get_dir_from_path-get_dirs_from_args.<locals>.get_dir_from_path   s    ;;==K{{r.   c              3  d   >#    U  H%  nT" U5      (       a  M  [        T" U5      5      v   M'     g 7fr(   r   ).0rR   rf   rb   s     r   	<genexpr>%get_dirs_from_args.<locals>.<genexpr>   s/      C~ 	6/455s   00)rP   r   r0   bool)rP   r   r0   r   )r   r   r0   r   r   )rN   rj   possible_pathsr   rf   rb   s       @@r   get_dirs_from_argsrr      sK    ! N 1?T+dBS#d#TTTs
   A
A
z][pytest] section in {filename} files is no longer supported, change to [tool:pytest] instead.c                h   Sn[        U5      nU (       a1  [        U 5      nUn[        U5      =(       d    0 nUc  UR                  nO[	        X55      n	[        X9/5      u  pGnUcl  Uci  U	/U	R                  Q7 H  n
U
S-  R                  5       (       d  M  U
n  O8   XY/:w  a  [        X55      u  pGnUc  [	        X3U	/5      n[        U5      (       a  U	nU(       aL  [        [        R                  R                  U5      5      nUR                  5       (       d  [        SU S35      eUc   eXGU=(       d    0 4$ )al  Determine the rootdir, inifile and ini configuration values from the
command line arguments.

:param inifile:
    The `--inifile` command line argument, if given.
:param args:
    The free command line arguments.
:param rootdir_cmd_arg:
    The `--rootdir` command line argument, if given.
:param invocation_dir:
    The working directory when pytest was invoked.
Nzsetup.pyzDirectory 'z+' not found. Check your '--rootdir' option.)rr   r   rE   rL   r^   rX   rJ   rK   
is_fs_rootosr   
expandvarsri   r	   )inifilerN   rootdir_cmd_argrM   rootdirdirsinipath_inipathinicfgancestorpossible_rootdirs              r   determine_setupr      sA   & Gd#D('+H5;"ooG&~<#0#L &?6%-$A0@0@$A $z1::<<.G %B
 :%/<^/R,Gf?1&(BG "'**"*rww11/BC~~gY&QR  V\r))r.   c                z    [         R                  R                  [        U 5      5      S   [         R                  :H  $ )z{
Return True if the given path is pointing to the root of the
file system ("/" on Unix and "C:\\" on Windows for example).
r   )ru   r   
splitdriver   sep)rV   s    r   rt   rt      s+    
 77c!f%a(BFF22r.   )r   r   r0   ziniconfig.IniConfig)r@   r   r0   zConfigDict | None)rM   r   rN   Iterable[Path]r0   z+tuple[Path | None, Path | None, ConfigDict])rM   r   r[   r   r0   r   )rN   zIterable[str]r0   z
list[Path])
rw   
str | NonerN   zSequence[str]rx   r   rM   r   r0   z$tuple[Path, Path | None, ConfigDict])rV   r   r0   rp   )$
__future__r   collections.abcr   r   ru   pathlibr   r8   typingr   r   
exceptionsr	   _pytest.outcomesr
   _pytest.pathlibr   r   r   r   typing_extensionsr   r2   r   r*   r   __annotations__r   rE   rX   r^   rr   r6   r   rt    r.   r   <module>r      s    " $ $ 	  
    " ! ( & ' + !eCcN&;!;<J	<	,444n
 1B 
4U, u 3*3* 3*  	3*
 3* *3*l3r.   