Ë
    •KêjÔF  ã                  ó.  — U d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dl	Z	d dl
mZ d dlZd d	lmZ d d
lmZ d dlZddlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ  ed¬«       G d„ d«      «       Zeeef   Zded<   d0d„Z d1d„Z!d2d„Z"d2d„Z#d2d„Z$	 	 	 	 	 	 d3d„Z%	 	 	 	 	 	 d3d„Z&d2d„Z'd2d „Z(d2d!„Z)e'e'e"e"e)e#e$d"œZ*d#ed$<   e#e$e(d%œZ+d#ed&<   d4d'„Z,	 	 	 	 d5d(„Z-	 	 	 	 	 	 d6d)„Z.	 	 	 	 	 	 d7d*„Z/d8d+„Z0d9d,„Z1d-Z2	 	 	 	 	 	 	 	 	 	 	 	 d:d.„Z3d;d/„Z4y)<é    )Úannotations)ÚCallable)ÚIterable)ÚSequence)Ú	dataclass)ÚKW_ONLYN)ÚPath)ÚLiteral)Ú	TypeAliasé   )Ú
UsageError)ÚNodeId)Úfail)Úabsolutepath)Ú
commonpath©Úsafe_existsT)Úfrozenc                  ó:   — e Zd ZU dZded<   ded<   ded<   ded	<   y
)ÚConfigValuea8  Represents a configuration value with its origin and parsing mode.

    This allows tracking whether a value came from a configuration file
    or from a CLI override (--override-ini), which is important for
    determining precedence when dealing with ini option aliases.

    The mode tracks the parsing mode/data model used for the value:
    - "ini": from INI files or [tool.pytest.ini_options], where the only
      supported value types are `str` or `list[str]`.
    - "toml": from TOML files (not in INI mode), where native TOML types
       are preserved.
    ÚobjectÚvaluer   Ú_zLiteral['file', 'override']ÚoriginzLiteral['ini', 'toml']ÚmodeN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__© ó    ú]/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/_pytest/config/findpaths.pyr   r      s   … ñð ƒMØƒJØ'Ó'Ø
 Ô r"   r   r   Ú
ConfigDictc                ó    — 	 t        j                  t        | «      «      S # t         j                  $ r}t	        t        |«      «      |‚d}~ww xY w)zœParse 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     r#   Ú_parse_ini_configr,   0   sC   € ð,Ü×"Ñ"¤3 t£9Ó-Ð-øÜ×Ñò ,Üœ˜S›Ó"¨Ð+ûð,ús   ‚   A³AÁAc                óÒ   — t         j                  dk\  rddl}nddl}| j	                  d¬«      }	 |j                  |«      S # |j                  $ r}t        | › d|› �«      |‚d}~ww xY w)zvParse the given '.toml' file, returning the decoded document.

    Raise UsageError if the file cannot be parsed.
    )é   é   r   Nzutf-8)Úencodingz: )ÚsysÚversion_infoÚtomllibÚtomliÚ	read_textÚloadsÚTOMLDecodeErrorr   )r*   r3   Ú	toml_textr+   s       r#   Ú_parse_toml_filer9   <   sj   € ô
 ×Ñ˜7Ò"Üãà—‘¨�Ó0€Ið4Ø�}‰}˜YÓ'Ð'øØ×"Ñ"ò 4Ü˜D˜6  C 5Ð)Ó*°Ð3ûð4ús   °A ÁA&ÁA!Á!A&c           
     ó–   — t        | «      }d|v r3|d   j                  «       D ��ci c]  \  }}|t        |dd¬«      “Œ c}}S i S c c}}w )zÙLoad a dedicated pytest INI file (``pytest.ini``/``.pytest.ini``).

    These files are always the source of configuration, even if they lack a
    ``[pytest]`` section, in which case an empty config is returned.
    ÚpytestÚfileÚini©r   r   ©r,   Úitemsr   ©r*   r&   ÚkÚvs       r#   Ú_load_pytest_inirD   M   s_   € ô " $Ó'€Ià�9Ñð " (Ñ+×1Ñ1Ó3÷
á��1ð Œ{˜1 V°%Ô8Ñ8ó
ð 	
ð €Iùó	
s   ¦Ac           
     ó”   — t        | «      }d|v r3|d   j                  «       D ��ci c]  \  }}|t        |dd¬«      “Œ c}}S yc c}}w )zoLoad a generic '.ini' file (e.g. ``tox.ini``).

    Only considered if it contains a ``[pytest]`` section.
    r;   r<   r=   r>   Nr?   rA   s       r#   Ú_load_ini_filerF   ]   s]   € ô
 " $Ó'€Ià�9Ñð " (Ñ+×1Ñ1Ó3÷
á��1ð Œ{˜1 V°%Ô8Ñ8ó
ð 	
ð ùó	
s   ¦Ac           
     ó  — t        | «      }d|j                  v r3|d   j                  «       D ��ci c]  \  }}|t        |dd¬«      “Œ c}}S d|j                  v r!t	        t
        j                  d¬«      d¬	«       y
c c}}w )znLoad a '.cfg' file (e.g. ``setup.cfg``).

    Only considered if it contains a ``[tool:pytest]`` section.
    ztool:pytestr<   r=   r>   r;   ú	setup.cfg)ÚfilenameF)ÚpytraceN)r,   Úsectionsr@   r   r   ÚCFG_PYTEST_SECTIONÚformatrA   s       r#   Ú_load_cfg_filerN   l   sŒ   € ô
 " $Ó'€Ià˜	×*Ñ*Ñ*ð " -Ñ0×6Ñ6Ó8÷
á��1ð Œ{˜1 V°%Ô8Ñ8ó
ð 	
ð 
�Y×'Ñ'Ñ	'ô 	Ô×&Ñ&°Ð&Ó<ÀeÕLØùó
s   °A=c           
     ó4  — d|v r3|d   j                  «       D ��ci c]  \  }}|t        |dd¬«      “Œ c}}S |j                  «       D ��cg c]  \  }}t        |t        «      rŒ|‘Œ }}}|r t	        | › ddj                  |«      › d�«      ‚yc c}}w c c}}w )	zåReturn the configuration in the ``[pytest]`` table of a parsed TOML
    document, or None if it has none.

    Raise UsageError for options written outside of any table, which is the
    usual way of getting the table wrong.
    r;   r<   Útomlr>   zP: pytest configuration must be under a [pytest] table (found top-level options: ú, ú)N)r@   r   Ú
isinstanceÚdictr   Újoin)r*   ÚconfigrB   rC   Úkeyr   Útop_level_optionss          r#   Ú_config_from_pytest_tablerY      s»   € ð �6Ñð ˜xÑ(×.Ñ.Ó0÷
á��1ð Œ{˜1 V°&Ô9Ñ9ó
ð 	
ð %Ÿl™l›n÷Ù��U´J¸uÄdÕ4KŠðÐñ ñ ÜØˆfð 8à�y‰yÐ*Ó+Ð,¨Að/ó
ð 	
ð
 ùó
ùó
s   ›BÁBÁ$Bc           
     óâ  — |j                  di «      j                  di «      }|j                  «       D ��ci c]  \  }}|dk7  sŒ||“Œ }}}|j                  dd«      }|r|rt        | › d�«      ‚|r0|j                  «       D ��ci c]  \  }}|t        |dd¬«      “Œ c}}S |�:dd	„}|j                  «       D ��ci c]  \  }}|t         ||«      dd
¬«      “Œ c}}S yc c}}w c c}}w c c}}w )zoReturn the configuration in the ``[tool.pytest]`` tables of a parsed
    TOML document, or None if it has none.Útoolr;   Úini_optionsNzó: Cannot use both [tool.pytest] (native TOML types) and [tool.pytest.ini_options] (string-based INI format) simultaneously. Please use [tool.pytest] with native TOML types (recommended) or [tool.pytest.ini_options] for backwards compatibility.r<   rP   r>   c                ó<   — t        | t        «      r| S t        | «      S ©N)rS   Úlistr(   )rC   s    r#   Úmake_scalarz-_config_from_tool_pytest.<locals>.make_scalar¹   s   € Ü" 1¤dÔ+�1Ð7´°Q³Ð7r"   r=   )rC   r   Úreturnzstr | list[str])Úgetr@   r   r   )r*   rV   Útool_pytestrB   rC   Útoml_configÚ
ini_configr`   s           r#   Ú_config_from_tool_pytestrf   ›   s  € ð
 —*‘*˜V RÓ(×,Ñ,¨X°rÓ:€Kð %0×$5Ñ$5Ó$7×N™D˜A˜q¸1ÀÓ;M�1�a‘4ÐN€KÑNà—‘ °Ó5€Já‘zÜØˆfð Hð Hó
ð 	
ñ ð $×)Ñ)Ó+÷
á��1ð Œ{˜1 V°&Ô9Ñ9ó
ð 	
ð
 Ðó	8ð
 #×(Ñ(Ó*÷
á��1ð Œ{™; q›>°&¸uÔEÑEó
ð 	
ð
 ùó= Oùó
ùó
s   ¶CÁCÂC%Â;C+c                ó8   — t        | t        | «      «      }|�|S i S )zÖLoad a dedicated pytest TOML file (``pytest.toml``/``.pytest.toml``).

    Configuration is read from the ``[pytest]`` table in TOML mode. These files
    are always the source of configuration, even if empty.
    )rY   r9   )r*   rV   s     r#   Ú_load_pytest_tomlrh   Ä   s&   € ô ' tÔ-=¸dÓ-CÓD€FØÐ'ˆ6Ð/¨RÐ/r"   c                ót   — t        | «      }t        | |«      }|€t        | |«      S d|v rt        | › d�«      ‚|S )aª  Load a TOML file with an arbitrary name, as passed via ``-c``.

    Such a file reads its configuration from ``[pytest]``, like ``pytest.toml``
    does -- the table pytest documents for its own files (#14705). The
    ``pyproject.toml`` tables ``[tool.pytest]``/``[tool.pytest.ini_options]``,
    which arbitrary TOML files used to be parsed with exclusively, keep
    working; using both styles in one file is an error.
    r;   zØ: Cannot use both [pytest] and [tool.pytest]/[tool.pytest.ini_options] in the same file. Please use [pytest], which is what pytest's own configuration files use; the [tool.pytest] tables are meant for pyproject.toml.)r9   rf   rY   r   )r*   ÚdocumentÚtool_pytest_configs      r#   Ú_load_custom_tomlrl   Î   s\   € ô   Ó%€Hä1°$¸ÓAÐØÐ!Ü(¨¨xÓ8Ð8à�8ÑÜØˆfð Að Aó
ð 	
ð Ðr"   c                ó,   — t        | t        | «      «      S )z™Load a ``pyproject.toml``-style file.

    Configuration is read from ``[tool.pytest]`` (TOML mode) or
    ``[tool.pytest.ini_options]`` (INI mode).
    )rf   r9   ©r*   s    r#   Ú_load_pyproject_tomlro   ç   s   € ô $ DÔ*:¸4Ó*@ÓAÐAr"   )zpytest.tomlz.pytest.tomlz
pytest.iniz.pytest.iniúpyproject.tomlztox.inirH   z.dict[str, Callable[[Path], ConfigDict | None]]ÚCONFIG_LOADERS_BY_NAME)z.iniz.cfgz.tomlÚCONFIG_LOADERS_BY_SUFFIXc                ó†   — t         j                  | j                  «      }|€t        j                  | j                  «      }|S )z9Return the loader responsible for the given path, if any.)rq   rb   Únamerr   Úsuffix©ÚfilepathÚloaders     r#   Ú_get_config_loaderry     s4   € ä#×'Ñ'¨¯©Ó6€FØ€~Ü)×-Ñ-¨h¯o©oÓ>ˆØ€Mr"   c                ó.   — t        | «      }|€y || «      S )z�Load pytest configuration from the given file path, if supported.

    Return None if the file does not contain valid pytest configuration.
    N)ry   rv   s     r#   Úload_config_dict_from_filer{     s!   € ô   Ó)€FØ€~ØÙ�(ÓÐr"   c                ób  — t        t        «      }|D �cg c]  }t        |«      j                  d«      rŒ|‘Œ! }}|s| g}d}g }|D ]Ì  }t	        |«      }|g|j
                  ¢­D ]¬  }t        t        j                  «       «      D ]Š  \  }	\  }
}||
z  }|j                  «       sŒ|j                  dk(  r|€|} ||«      }|€Œ=||	dz   d D ]8  }||z  }|j                  «       sŒt        |   |«      €Œ(|j                  |«       Œ: ||||fc c c S  Œ® ŒÎ |�|j                  |i g fS ddi g fS c c}w )a	  Search in the list of arguments for a valid ini-file for pytest,
    and return a tuple of (rootdir, inifile, cfg-dict, ignored-config-files), where
    ignored-config-files is a list of config basenames found that contain
    pytest configuration but were ignored.ú-Nrp   r   )r_   rq   r(   Ú
startswithr   ÚparentsÚ	enumerater@   Úis_filert   ÚappendÚparent)Úinvocation_dirÚargsÚconfig_namesÚxÚfound_pyproject_tomlÚignored_config_filesÚargÚargpathÚbaseÚindexÚconfig_namerx   Úpre   Ú	remainderÚp2s                   r#   Úlocate_configr’   !  s|  € ô Ô.Ó/€LØÖ:�!¤3 q£6×#4Ñ#4°SÕ#9ŠAÐ:€DÐ:ÙØÐˆØ(,ÐØ&(Ðàò IˆÜ˜sÓ#ˆØÐ/˜wŸ™Ñ/ò 	IˆDÜ09Ü&×,Ñ,Ó.ó1ò IÑ,�Ñ,˜ Vð ˜;Ñ&�Ø—9‘9•;Ø—v‘vÐ!1Ò1Ð6JÐ6RØ/0Ð,Ù!'¨£�JØ!Ñ-Ø)5°e¸a±i°kÐ)Bò G˜IØ!%¨	Ñ!1˜Bà "§
¡
¥Ü$:¸9Ñ$EÀbÓ$IÑ$Uà 4× ;Ñ ;¸IÕ FðGð  $ Q¨
Ð4HÐHÖHñ!Iñ	IðIð( Ð'Ø#×*Ñ*Ð,@À"ÀbÐHÐHØ��r˜2ÐÐùò9 ;s
   ”D,´D,c                óô   — d }|D ]N  }|j                  «       sŒ|€|}Œ||j                  v s||k(  rŒ-||j                  v r|}Œ>t        ||«      }|€ŒM|}ŒP |€| }|S |j                  «       r|j                  }|S r^   )Úexistsr   r   r�   rƒ   )r„   ÚpathsÚcommon_ancestorr*   Úshareds        r#   Úget_common_ancestorr˜   I  s£   € ð $(€OØò -ˆØ�{‰{Œ}ØØÐ"Ø"‰Oà $§,¡,Ñ.°$¸/Ò2IØØ˜×0Ñ0Ñ0Ø"&‘ä# D¨/Ó:�ØÑ%Ø&,‘Oð-ð ÐØ(ˆð Ðð 
×	 Ñ	 Ô	"Ø)×0Ñ0ˆØÐr"   c                óx   ‡— dd„Šdd„}ˆfd„| D «       }|D �cg c]  }t        |«      sŒ ||«      ‘Œ c}S c c}w )Nc                ó$   — | j                  d«      S )Nr}   )r~   )r‡   s    r#   Ú	is_optionz%get_dirs_from_args.<locals>.is_optiond  s   € Ø�|‰|˜CÓ Ð r"   c                ó>   — | j                  «       r| S | j                  S r^   )Úis_dirrƒ   rn   s    r#   Úget_dir_from_pathz-get_dirs_from_args.<locals>.get_dir_from_pathg  s   € Ø—{‘{”}ˆtÐ5¨$¯+©+Ð5r"   c              3  ó€   •K  — | ]5  } ‰|«      rŒt        t        j                  |«      j                  «      –— Œ7 y ­wr^   )r   r   Úparser*   )Ú.0rŠ   r›   s     €r#   ú	<genexpr>z%get_dirs_from_args.<locals>.<genexpr>k  s0   øè ø€ ò Ø14ÁIÈcÅNŒ”V—\‘\ #Ó&×+Ñ+×,ñùs   ƒ>‘->)r‡   r(   ra   Úbool)r*   r	   ra   r	   r   )r…   rž   Úpossible_pathsr*   r›   s       @r#   Úget_dirs_from_argsr¥   c  s?   ø€ ó!ó6óØ8<ô€Nð 1?ÖT¨Ä+ÈdÕBSÑ˜dÕ#ÒTÐTùÒTs   ™7ª
7c                ó°   — i }| xs dD ])  }	 |j                  dd«      \  }}t        |dd¬«      ||<   Œ+ |S # t        $ r}t        d|›d�«      |‚d	}~ww xY w)
z•Parse the -o/--override-ini command line arguments and return the overrides.

    :raises UsageError:
        If one of the values is malformed.
    r!   ú=r   Úoverrider=   r>   z3-o/--override-ini expects option=value style (got: z).N)Úsplitr   Ú
ValueErrorr   )Úoverride_iniÚ	overridesre   rW   Úuser_ini_valueÚes         r#   Úparse_override_inir¯   r  sŠ   € ð €Ið #Ò( bò Xˆ
ð	XØ",×"2Ñ"2°3¸Ó":ÑˆC�ô )¨À
ÐQVÔWˆI�cŠNðXð Ðøô ò 	ÜØEÀjÀ^ÐSUÐVóàðûð	ús   �7·	AÁ AÁAz][pytest] section in {filename} files is no longer supported, change to [tool:pytest] instead.c                óÆ  — d}t        |«      }g }| ràt        | «      }|j                  «       st        d|› d�«      ‚|j	                  «       rt        d|› d�«      ‚|}	t        |«      }
|
� |
|«      xs i }nB|j                  «       r0dj                  t        t        «      «      }t        d|› d|› d�«      ‚i }|€¹|j                  «       r|j                  }nœt        ||«      }t        |«      r…|}n‚t        ||«      }t        ||g«      \  }}	}}|€b|€`|g|j                  ¢­D ]  }|dz  j                  «       sŒ|} n5 ||gk7  rt        ||«      \  }}	}}|€t        |||g«      }t        |«      r|}|rGt        t        j                   j#                  |«      «      }|j	                  «       st        d	|› d
�«      ‚t%        |«      }|j'                  |«       |€J ‚||	||fS )a  Determine the rootdir, inifile and ini configuration values from the
    command line arguments.

    :param inifile:
        The `--inifile` command line argument, if given.
    :param override_ini:
        The -o/--override-ini command line arguments, 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.

    :raises UsageError:
    NzConfig file 'z2' not found. Check your '-c/--config-file' option.z7' is a directory. Check your '-c/--config-file' option.rQ   z7' has an unsupported format. Supported extensions are: ú.zsetup.pyzDirectory 'z+' not found. Check your '--rootdir' option.)r¥   r   r”   r   r�   ry   r�   rU   Úsortedrr   rƒ   r˜   Ú
is_fs_rootr’   r   Úosr*   Ú
expandvarsr¯   Úupdate)Úinifiler«   r…   Úrootdir_cmd_argr„   ÚrootdirÚdirsr‰   Úinipath_Úinipathrx   ÚinicfgÚ	supportedÚancestorÚpossible_rootdirr   Úini_overridess                    r#   Údetermine_setuprÂ   ‹  sH  € ð0 €GÜ˜dÓ#€DØ*,ÐáÜ Ó(ˆØ�‰Ô ÜØ ˜zð *8ð 9óð ð �?‰?ÔÜØ ˜zð *8ð 9óð ð  (ˆÜ# HÓ-ˆØÐÙ˜HÓ%Ò+¨‰FØ×ÑÔØŸ	™	¤&Ô)AÓ"BÓCˆIÜØ ˜zð *-Ø-6¨K°qð:óð ð ˆFØÐ"Ø×ÑÔ!Ø"Ÿ/™/‘ô .¨n¸dÓC�Ü˜gÔ&Ø,‘Gä& ~°tÓ<ˆÜ9FØ˜X˜Jó:
Ñ6ˆ�˜&Ð"6ð ˆ?˜Ð6Ø%-Ð$A°×0@Ñ0@Ñ$Aò +Ð Ø$ zÑ1×:Ñ:Õ<Ø.�GÙð+ð
 ˜H˜:Ò%Ü2?ÀÐPTÓ2UÑ/�G˜W f¨aØ�?Ü1Ø&¨¸Ð(Bó�Gô " 'Ô*Ø"*˜ÙÜœrŸw™w×1Ñ1°/ÓBÓCˆØ�~‰~ÔÜØ˜g˜YÐ&QÐRóð ô ' |Ó4€MØ
‡M�M�-Ô àÐÐÐØ�G˜VÐ%9Ð9Ð9r"   c                óz   — t         j                  j                  t        | «      «      d   t         j                  k(  S )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   )r´   r*   Ú
splitdriver(   Úsep)r�   s    r#   r³   r³   ð  s+   € ô
 �7‰7×Ñœc !›fÓ% aÑ(¬B¯F©FÑ2Ð2r"   )r*   r	   ra   ziniconfig.IniConfig)r*   r	   ra   údict[str, object])r*   r	   ra   úConfigDict | None)r*   r	   rV   rÆ   ra   rÇ   )rw   r	   ra   z*Callable[[Path], ConfigDict | None] | None)rw   r	   ra   rÇ   )r„   r	   r…   úIterable[Path]ra   z:tuple[Path | None, Path | None, ConfigDict, Sequence[str]])r„   r	   r•   rÈ   ra   r	   )r…   zIterable[str]ra   z
list[Path])r«   úSequence[str] | Nonera   r$   )r·   ú
str | Noner«   rÉ   r…   zSequence[str]r¸   rÊ   r„   r	   ra   z3tuple[Path, Path | None, ConfigDict, Sequence[str]])r�   r	   ra   r£   )5Ú
__future__r   Úcollections.abcr   r   r   Údataclassesr   r   r´   Úpathlibr	   r1   Útypingr
   r   r&   Ú
exceptionsr   Ú_pytest.nodeidr   Ú_pytest.outcomesr   Ú_pytest.pathlibr   r   r   r   rT   r(   r$   r    r,   r9   rD   rF   rN   rY   rf   rh   rl   ro   rq   rr   ry   r{   r’   r˜   r¥   r¯   rL   rÂ   r³   r!   r"   r#   ú<module>rÔ      sÑ  ðÞ "å $Ý $Ý $Ý !Ý Û 	Ý Û 
Ý Ý ã å "Ý !Ý !Ý (Ý &Ý 'ñ �$Ô÷!ð !ó ð!ð( ˜S +Ð-Ñ.€
ˆIÓ .ó	,ó4ó"ó óð&Ø
ðØ)ðàóð8&Ø
ð&Ø)ð&àó&óR0óó2Bð %Ø%Ø"Ø#Ø*ØØñJÐ ÐFó ð" ØØñLÐ ÐHó óð
Øð
àó
ð%Øð%à
ð%ð @ó%ðPØðàðð 
óó4Uóð, uÐ ðb:àðb:ð 'ðb:ð ð	b:ð
  ðb:ð ðb:ð 9ób:ôJ3r"   