Ë
    pPêj…  ã                  óX   — d 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„Z
dd„Zdd	„Zy)a¥  This module makes it possible to use mypy as part of a Python application.

Since mypy still changes, the API was kept utterly simple and non-intrusive.
It just mimics command line activation without starting a new interpreter.
So the normal docs about the mypy command line apply.
Changes in the command line version of mypy will be immediately usable.

Just import this module and then call the 'run' function with a parameter of
type List[str], containing what normally would have been the command line
arguments to mypy.

Function 'run' returns a Tuple[str, str, int], namely
(<normal_report>, <error_report>, <exit_status>),
in which <normal_report> is what mypy normally writes to sys.stdout,
<error_report> is what mypy normally writes to sys.stderr and exit_status is
the exit status mypy normally returns to the operating system.

Any pretty formatting is left to the caller.

The 'run_dmypy' function is similar, but instead mimics invocation of
dmypy. Note that run_dmypy is not thread-safe and modifies sys.stdout
and sys.stderr during its invocation.

Note that these APIs don't support incremental generation of error
messages.

Trivial example of code using this module:

import sys
from mypy import api

result = api.run(sys.argv[1:])

if result[0]:
    print('
Type checking report:
')
    print(result[0])  # stdout

if result[1]:
    print('
Error report:
')
    print(result[1])  # stderr

print('
Exit status:', result[2])

é    )ÚannotationsN)ÚCallable)ÚStringIO)ÚTextIOc                ó   — t        «       }t        «       }	  | ||«       d}|j                  «       |j                  «       |fS # t        $ r2}t        |j                  t        «      sJ ‚|j                  }Y d }~ŒWd }~ww xY w)Nr   )r   Ú
SystemExitÚ
isinstanceÚcodeÚintÚgetvalue)Úmain_wrapperÚstdoutÚstderrÚexit_statusÚsystem_exits        úM/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/mypy/api.pyÚ_runr   6   st   € Ü‹Z€FÜ‹Z€Fð'Ù�V˜VÔ$Øˆð
 �?‰?Ó˜fŸo™oÓ/°Ð<Ð<øô	 ò 'Ü˜+×*Ñ*¬CÔ0Ð0Ð0Ø!×&Ñ&�ûð'ús   –A Á	A=Á(A8Á8A=c                ó0   ‡ ‡— ddl mŠ t        ˆ ˆfd„«      S )Nr   ©Úmainc                ó   •—  ‰‰| |d¬«      S )NT)Úargsr   r   Ú
clean_exit© )r   r   r   r   s     €€r   ú<lambda>zrun.<locals>.<lambda>I   s   ø€ ™t¨°fÀVÐX\Ô]€ ó    )Ú	mypy.mainr   r   )r   r   s   `@r   Úrunr   D   s   ù€ åäÜ]óð r   c                ó6   ‡ ‡— ddl mŠ dˆ ˆfd„}t        |«      S )Nr   r   c                óæ   •— t         j                  }t         j                  }	 | t         _        |t         _         ‰‰«       |t         _        |t         _        y # |t         _        |t         _        w xY w)N)Úsysr   r   )r   r   Ú
old_stdoutÚ
old_stderrr   r   s       €€r   Úfzrun_dmypy.<locals>.fT   sO   ø€ Ü—Z‘Zˆ
Ü—Z‘Zˆ
ð	$ØŒCŒJØŒCŒJÙ�ŒJà#ŒCŒJØ#ŒC�Jøð $ŒCŒJØ#ŒC�Jús   £A ÁA0)r   r   r   r   ÚreturnÚNone)Úmypy.dmypy.clientr   r   )r   r$   r   s   ` @r   Ú	run_dmypyr(   M   s   ù€ Ý&ö	$ô �‹7€Nr   )r   z Callable[[TextIO, TextIO], None]r%   útuple[str, str, int])r   z	list[str]r%   r)   )Ú__doc__Ú
__future__r   r!   Úcollections.abcr   Úior   Útypingr   r   r   r(   r   r   r   ú<module>r/      s+   ðñ+õZ #ã 
Ý $Ý Ý ó=óôr   