
    X-Ph                    0   U d Z ddlmZ ddlZddlZddlZddl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mZmZmZmZmZ dd	lmZmZmZmZ dd
lmZmZmZmZ ddl m!Z! ddl"m#Z# ddl$m%Z%m&Z& ddl'm(Z( ddl)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/ ddl0m1Z1m2Z2m3Z3 ddl4m5Z5 ddl6m7Z7 erddl8m9Z9 ej:        Z;de<d<   dZ=de<d<   dZ>de<d<   dsdZ?dej@        ejA        dddtd(ZBdud2ZCdvd8ZD G d9 d:ejE                  ZFd;d<gZGde<d=<   i ZHd>e<d?<   eGD ]\  ZIZJeJeHeI<   eIeHeJ<   dwdAZK G dB dCeL          ZMdxdEZNdydHZOdzdKZPdLZQde<dM<   dNZRde<dO<   dPZSde<dQ<    G dR dSejT                  ZU G dT dUejV                  ZWdddVdddWeQfd{d_ZXd|dbZYd}dcZZd~diZ[ddlZ\ddoZ]dddpddrZ^dS )z$Mypy type checker command line tool.    )annotationsN)defaultdict)Sequence)gettext)TextIOWrapper)IOTYPE_CHECKINGAnyFinalNoReturnTextIO)builddefaultsstateutil)get_config_module_namesparse_config_fileparse_versionvalidate_package_allow_list)OUTPUT_CHOICES)CompileError)InvalidSourceListcreate_source_list)FileSystemCache)BuildSourceFindModuleCacheModuleNotFoundReasonSearchPathsget_search_dirs	mypy_path)INCOMPLETE_FEATURES	BuildTypeOptions)SplitNamespace)__version__)SupportsWriter   	orig_statFMEM_PROFILEi @  RECURSION_LIMITpathstrreturnos.stat_resultc                    	 t          |           }t          d| |j        |j        |j        fz             |S # t
          $ r}t          d| d|             d }~ww xY w)Nz1stat(%r) -> (st_mode=%o, st_mtime=%d, st_size=%d)zstat(z) -> )r'   printst_modest_mtimest_sizeOSError)r*   sterrs      I/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/mypy/main.py
stat_proxyr7   0   s    
t__
 	?RZbj9:	
 	
 	
 	    (d((3(()))s   8 
AAA)argsstdoutstderr
clean_exitr8   list[str] | Noner9   r   r:   r;   boolNonec                   t          j        d           t          j                    }t          j        t
                     | t          j        dd         } t          |t                    r!|j	        dk    r|
                    d           t                      }t          | |||          \  }}|rd|_        t          j        |||j        t!          |j                  	          }|j        r|j        st)          d
||           |j        r-|t          j        us|t          j        urt)          d||           |j        r|j        st)          d||           |j        r|j        st)          d||           |j        r|j        t)          d||           |j        r|st+          |||j                   dS t7          ||||||          \  }	}
}|j        rwt9          |j        d          }|rMt+          ||dd           |                                 t?                       t7          ||||||          \  }	}
}tA          |
|||           tB          rddl"m#}  |             d}t          j$        |
          \  }}}|
r|tK          |
          k     r|rdnd}|j&        r|rE|'                    ||tK          |          ||j(                  }|)                    |dz              nS|
r|tK          |
          k    r>|)                    |*                    tK          |          |j(                  dz              |                                 |j        r;|j        s4t+          ||dd          }|rt?                       t?          d           d}|j        rt          j+        |           n|rt          j,        |           t[          |	g           dS )zMain entry point to the type checker.

    Args:
        args: Custom command-line arguments.  If not given, sys.argv[1:] will
            be used.
        clean_exit: Don't hard kill the process on exit. This allows catching
            SystemExit.
    mypyN   strictbackslashreplace)errors)r9   r:   fscacheFhide_successzNerror: --local-partial-types must be enabled if using --allow-redefinition-newzAerror: --install-types not supported in this mode of running mypyz?error: --non-interactive is only supported with --install-typeszCerror: --install-types not supported with incremental mode disabledzOerror: --install-types not supported without python executable or site packages)non_interactiveT)	after_runrI   rH   r   )print_memory_profile   )blockers	use_color
z@note: Run mypy again for up-to-date results with installed types).r   check_python_versiontimesyssetrecursionlimitr)   argv
isinstancer   rD   reconfigurer   process_options	fast_exitFancyFormatterhide_error_codesr=   outputallow_redefinition_newlocal_partial_typesfailinstall_typesr9   r:   rH   incrementalpython_executable	run_buildread_types_packages_to_install	cache_dirflushr/   show_messagesr(   mypy.memprofilerK   count_statslenerror_summaryformat_errorcolor_outputwriteformat_success	hard_exitexitlist)r8   r9   r:   r;   t0rE   sourcesoptions	formatterresmessagesrM   missing_pkgsrK   coden_errorsn_notesn_filessummaryresults                       r6   mainr   >   sk    	f%%%	B/***|x| &-(( 6V]h-F-F"4555G&tF6SZ[[[GW "!#0tGN?S?S  I % 
g.I 
\	
 	
 	
  c&
":":fCJ>V>VPRXZabbb aw'< aNPVX_``` 
W%8 
QSY[b	
 	
 	
  
!:!B]	
 	
 	
  W i':QRRRR''2vvVVC8 <5g6GSWXXX 	_)WdSSSSMMOOOGGG&/'2vW]&^&^#C8h	7;;; 888888D!%!1(!;!;Hgw $Gc(mm++#qq! 	 	^,,'3w<<(gNb -  G LL4(((( 	^WH55LL11#g,,@TUUX\\]]] W%< y'TSXYYY 	GGGTUUUD  	t	  	#KKKKK    rs   list[BuildSource]rt   r#   rE   r   rr   float0tuple[build.BuildResult | None, list[str], bool]c                   t          j        j        t          j                            g t          t                    dfd
}d}d}d }		 t          j        | d ||          }	n"# t          $ r}
d}|
j	        sd}Y d }
~
nd }
~
ww xY wj
        ruj        rnj        sgj        s`t          d                    j        t#          j        fdj                                        D                                            t)          t+          j                    |z
  |           |	|fS )NrF   filename
str | Nonenew_messages	list[str]seriousr=   r,   r>   c                    j         r                    |          }                    |           |r|                              |           j        rd S |rn	}t	          ||           d S N)prettyfit_in_terminalextendrH   rf   )
r   r   r   fru   rw   messages_by_filert   r:   r9   s
       r6   flush_errorszrun_build.<locals>.flush_errors   s    > 	C$44\BBL%%% 	<X&--l;;;" 	F)FF6lAy':::::r   FTz$Warning: unused section(s) in {}: {}c                &    g | ]}|j         v |S  )unused_configs).0globrt   s     r6   
<listcomp>zrun_build.<locals>.<listcomp>   s1        7#999 999r   )file)r   r   r   r   r   r=   r,   r>   )r   rY   rZ   r=   r[   r   rq   r   r   
use_stdoutwarn_unused_configsr   r`   rH   r/   formatconfig_filer   per_module_optionskeysmaybe_write_junit_xmlrQ   )rs   rt   rE   rr   r9   r:   r   r   rM   rv   eru   rw   r   s    `  ``     @@@r6   rb   rb      s    #0tGN?S?S  I H"4((
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; GH
C k'7D,QWXX   | 	G
 	#
"
 #
 '	
 	299#''   $+$>$C$C$E$E   
 
 	
 	
 	
 	
 $)++*GX?OQXYYY(""s   A9 9
BBBrw   r   r   ru   util.FancyFormatterc                    | D ]6}|j         r|                    |          }|                    |dz              7|                                 d S NrO   )rl   colorizerm   re   )rw   r   ru   rt   msgs        r6   rf   rf      s[        	*$$S))C	d
GGIIIIIr   c                  ,     e Zd Zd fdZd fdZ xZS )AugmentedHelpFormatterprogr+   kwargsr
   r,   r>   c                @     t                      j        d|dd| d S )N   )r   max_help_positionr   )super__init__)selfr   r   	__class__s      r6   r   zAugmentedHelpFormatter.__init__   s-    CdbCCFCCCCCr   textwidthintindentc                    d|v r#t                                          |||          S t          j                            | |||          S r   )r   
_fill_textargparseHelpFormatter)r   r   r   r   r   s       r6   r   z!AugmentedHelpFormatter._fill_text   sG    4<<77%%dE6::: )44T4OOOr   )r   r+   r   r
   r,   r>   )r   r+   r   r   r   r+   r,   r+   )__name__
__module____qualname__r   r   __classcell__r   s   @r6   r   r      sk        D D D D D DP P P P P P P P P Pr   r   )allowdisallow)showhideflag_prefix_pairszFinal[dict[str, str]]flag_prefix_mapflagc                    | dd                               dd          }t          |          dk    r,|\  }}|t          v rdt          |          d| S |dk    rd| S d| dd           S )NrL   -rA   --noz--no-)splitri   r   )r   r   prefixrests       r6   invert_flag_namer     s    HNN3""E
5zzQ_$$8/88$888t^^;;48r   c                      e Zd ZdZdS )PythonExecutableInferenceErrorzHRepresents a failure to infer the version or executable while searching.N)r   r   r   __doc__r   r   r6   r   r     s        RRRRr   r   vc                <    t           j        dk    rdd|  gS d|  gS )Nwin32pyr   python)rR   platform)r   s    r6   python_executable_prefixr   !  s/    
|w
 g!gg~r   python_versiontuple[int, int]c                   t           j        d d         | k    rt           j        S d                    t	          t
          |                     }	 t          j        t          |          ddgz   t          j	                  
                                                                }|S # t          j        t          f$ r(}t          d                    |                     |d }~ww xY w)NrL   .-cz!import sys; print(sys.executable))r:   zofailed to find a Python executable matching version {}, perhaps try --python-executable, or --no-site-packages?)rR   version_info
executablejoinmapr+   
subprocesscheck_outputr   STDOUTdecodestripCalledProcessErrorFileNotFoundErrorr   r   )r   str_versys_exer   s       r6   _python_executable_from_versionr   ,  s    
~--~hhs3//00G#(11T;^4__!(   VXXUWW 	 )+<=   ,GGMvnG]G]
 
 	s   AB& &C$<#CC$special_optsargparse.Namespacec                x    |j         p| j         }|"|j        s| j        st          | j                  }|| _         dS )zInfer the Python executable from the given version.

    This function mutates options based on special_opts to infer the correct Python executable
    to use.
    N)ra   no_executableno_site_packagesr   r   )rt   r   ra   s      r6   infer_python_executabler   A  sQ     %6S':S ) 	X'2J 	X ?@V W W 1Gr   zt%(prog)s [-h] [-v] [-V] [more options; see below]
            [-m MODULE] [-p PACKAGE] [-c PROGRAM_TEXT] [files ...]HEADERa  
Mypy is a program that will type check your Python code.

Pass in any files or folders you want to type check. Mypy will
recursively traverse any provided folders to find .py files:

    $ mypy my_program.py my_src_folder

For more information on getting started, see:

- https://mypy.readthedocs.io/en/stable/getting_started.html

For more details on both running mypy and using the flags below, see:

- https://mypy.readthedocs.io/en/stable/running_mypy.html
- https://mypy.readthedocs.io/en/stable/command_line.html

You can also use a config file to configure mypy instead of using
command line flags. For more details, see:

- https://mypy.readthedocs.io/en/stable/config_file.html
DESCRIPTIONzEnvironment variables:
  Define MYPYPATH for additional module search path entries.
  Define MYPY_CACHE_DIR to override configuration cache_dir path.FOOTERc                  T     e Zd ZdZd fdZdddZdddZdddZdddZddZ	 xZ
S )CapturableArgumentParserzOverride ArgumentParser methods that use sys.stdout/sys.stderr directly.

    This is needed because hijacking sys.std* is not thread-safe,
    yet output must be captured to properly support mypy.api.run.
    r8   r
   r   r,   r>   c                    |                     dt          j                  | _        |                     dt          j                  | _         t	                      j        |i | d S )Nr9   r:   )poprR   r9   r:   r   r   )r   r8   r   r   s      r6   r   z!CapturableArgumentParser.__init__|  sS    jj3:66jj3:66$)&)))))r   Nr   SupportsWrite[str] | Nonec                h    || j         }|                     |                                 |           d S r   )r9   _print_messageformat_usager   r   s     r6   print_usagez$CapturableArgumentParser.print_usage  s6    <;DD--//66666r   c                h    || j         }|                     |                                 |           d S r   )r9   r   format_helpr   s     r6   
print_helpz#CapturableArgumentParser.print_help  s6    <;DD,,..55555r   messager+   c                J    |r || j         }|                    |           d S d S r   )r:   rm   )r   r   r   s      r6   r   z'CapturableArgumentParser._print_message  s8     	 |{JJw	  	 r   r   statusr   r   r   c                h    |r|                      || j                   t          j        |           d S r   )r   r:   rR   rp   )r   r  r   s      r6   rp   zCapturableArgumentParser.exit  s8     	6555r   c                    |                      | j                   | j        |d}|                     dt	          d          |z             dS )zerror(message: string)

        Prints a usage message incorporating the message to stderr and
        exits.

        If you override this in a subclass, it should not return -- it
        should either exit or raise an exception.
        )r   r   rL   z%(prog)s: error: %(message)s
N)r   r:   r   rp   r   )r   r   r8   s      r6   errorzCapturableArgumentParser.error  sQ     	%%%	g66		!W=>>EFFFFFr   )r8   r
   r   r
   r,   r>   r   )r   r   r,   r>   )r   r+   r   r   r,   r>   )r   N)r  r   r   r   r,   r   )r   r+   r,   r   )r   r   r   r   r   r   r   r   rp   r  r   r   s   @r6   r   r   u  s         * * * * * *7 7 7 7 7
6 6 6 6 6
             
G G G G G G G Gr   r   c                  N     e Zd ZdZej        ej        ddfd fdZ	 dddZ xZS )CapturableVersionActionat  Supplement CapturableArgumentParser to handle --version.

    This is nearly identical to argparse._VersionAction except,
    like CapturableArgumentParser, it allows output to be captured.

    Another notable difference is that version is mandatory.
    This allows removing a line in __call__ that falls back to parser.version
    (which does not appear to exist).
    z&show program's version number and exitNoption_stringsSequence[str]versionr+   destdefaulthelpr9   IO[str] | Noner,   r>   c                    t                                          |||d|           || _        |pt          j        | _        d S )Nr   )r  r  r  nargsr  )r   r   r
  rR   r9   )r   r  r
  r  r  r  r9   r   s          r6   r   z CapturableVersionAction.__init__  sM     	)gQUY 	 	
 	
 	
 *
r   parserargparse.ArgumentParser	namespacer   valuesstr | Sequence[Any] | Noneoption_stringr   r   c                    |                                 }|                    | j                   |                    |                                | j                   |                                 d S r   )_get_formatteradd_textr
  r   r   r9   rp   )r   r  r  r  r  ru   s         r6   __call__z CapturableVersionAction.__call__  s`     ))++	4<(((i3355t{CCCr   )r  r	  r
  r+   r  r+   r  r+   r  r+   r9   r  r,   r>   r   )
r  r  r  r   r  r  r  r   r,   r   )	r   r   r   r   r   SUPPRESSr   r  r   r   s   @r6   r  r    s~          %(<!%+ + + + + + +( %)
 
 
 
 
 
 
 
 
r   r  Tr@   TextIO | Nonerequire_targetsserver_optionsFileSystemCache | Noneprogramheader!tuple[list[BuildSource], Options]c                "-  12345 |pt           j        }|pt           j        }t          ||t          t
          dt          d||	  	        2t           j        dk    rd2_        g 4g 3dddddd234fd}2	                    d          }	|	
                    dddd           |	
                    ddddd !           t                              d"          rd#nd$}
|	
                    d%d&t          d't          z   d(|
 d)z   d*|+           |	
                    d,d-d.d/t          0           2	                    d1d23          }|
                    d4d5d6                    t"          j        t"          j        z              d)7            |d8ddd9|:           2	                    d;d<3          } |d=d>dd?|@           |
                    dAdBdC           |
                    dDdBdE           |
                    dFg dGdHdIJ           |
                    dKdLdMdNdOP           |
                    dQdBdRdS!           |
                    dTdBdU           2	                    dVdW3          }|
                    dXt(          dYdZd[\           |
                    d]dLd^d_`           |
                    dadbdcg dde           |
                    dfdbdcg dge           2	                    dhdi3          }|
                    djddBdkl           |
                    dmddBdnl           |
                    doddBdpl            |dqdddr|:            |dsddt|u            |dvdddw|:           2	                    dxdy3          } |dzddd{|:           |
                    d|d}dcg d~e            |dddd|:            |dddd|:            |dddd|:            |dddd|:           2	                    dd3          } |ddd|u           |
                    ddBt*          j                   |
                    dddd!            |ddt*          j        |u            |ddt*          j        |u           2	                    dd3          } |dddd|:            |dddd|:            |dddd|@            |dddd|:            |dddd|:            |dddd|:           |
                    dd}dcg de           2	                    d          } |dddd|:            |dddd|:            |dddt*          j        |:            |ddddd|            |dddd|:            |dddd|:            |dddd|:           d                    d6                    4                    }|
                    ddBd|!           |
                    ddbdcg de           |
                    ddbdcg de           2	                    dd3          } |dddd|            |ddd|u            |ddd|u            |ddd|u            |ddd|u            |ddd|u            |dddd|@            |dddd|@            |ddd|u           |
                    dt"          j        t2          dt*          j        Ԧ           2	                    dd֬3          }|
                    dddBt*          j                   |
                    dddd۬!           |
                    ddLddޠ                    t"          j                  `            |ddd|u           |
                    ddBd           |
                    ddBd           |
                    ddBd           2	                    dd3          }|
                    ddBd           |
                    dddBd           |
                    ddBd           |
                    dd}dd           |
                    ddBd           |
                    ddBt*          j                   2
                    ddcdd                    t7          t8                              z   dz   d`           |
                    ddd            |ddd |u           |
                    dddddcd           |
                    ddBt*          j                   |
                    ddd	t*          j        !            |d
dt*          j        |u           |
                    ddBt*          j                   2	                    dd3          }t7          t"          j                  D ]B}|dvr;|
                    d|                    dd           ddݐd| d           C|
                    ddt>          dt*          j                   |
                    dddBt*          j                   2	                    d          }|
                    dt*          j        7           |
                    dd7           |
                    d d!d"gd!d#J           |
                    d$d%d&d'           |
                    d(dBd)            |d*ddd+|:            |d,ddd-|d./           |r6|
                    d0dBd1d2!           |
                    d3dBd4           2
                    d5dBd6t*          j        !           2
                    d7dBd8t*          j        !           2
                    d9dBt*          j                   2
                    d:d;t*          j        <           2
                    d=d>t*          j        <           2
                    d?dBt*          j                   2
                    d@dBt*          j                   2
                    dAdBt*          j                   2
                    dBdBt*          j                   2
                    dCdBt*          j                    |dDdt*          j        E           2
                    dFdBt*          j                   2
                    dGdBt*          j                   2
                    dHdIdcg t*          j        e           2
                    dJdKdLt*          j        M           2
                    dNdBt*          j                   2
                    dOdBt*          j                   2
                    dPdBt*          j                   2
                    dQdBt*          j                   2	                    dRdS3          } |dTddU|u            |dVdt*          j        |u           |
                    dWdcdXg dYZ            |d[dd\|u           |
                    d]d^dcd}g d_d`a           |
                    dbdcdcddg dedfa           |
                    dgdhdcdidjdkl           |
                    dmdndodpq           t+          j                     }2!                    | |           |j"        }|r:tF          j$        %                    |          s2&                    dr| ds           tO                      1d5d135fdt}tQ          1||||           tS          |d          r
 |             tG          j*        dudv          }|+                                r|1_,        tF          j$        -                    1j,                  1_,        t+          j                     }2!                    | t]          1|d                     |j/        p1j/        1_/        1j/        dwk     r2&                    dx           	 ta          1|           n9# tb          $ r,} 2&                    t?          |                      Y d} ~ nd} ~ ww xY w|j2        s1j3        rd1_4        |j5        sG|j6        s@|j7        s91j5        r1j5        |_5        1j6        r1j6        |_6        1j7        r1j7        |_7        |rvtq          dy |j7        |j6        z   |j9        |j5        fD                       }!|!dzk    r1j:        s2&                    d{           n|!d|k    r2&                    d}           1j;        r1j<        s2&                    d~           t{          1j>                  t{          1j?                  z  }"|"r92&                    dd6                    t7          |"                    z             t          1jA                   t          1jB                   1C                    2j&                   1D                    2j&        t                     1jF        )tF          j$        G                    1jF                  1_H        |jI        rt          |jI        K                    d                    }#t          |#          dk     r2&                    d           t          |#          dk    r2&                    d           |#t          _I        t          |          O                                D ]J\  }$}%|$                    d          r/|%-|$dd                             dd          }|%}&|&1jP        |<   K1jQ        rt          |21           |jS        r.1jT        r2&                    d           t          2|1           1V                                 1jW        rd1_X        1jY        rd1_Z        1j[        rd1_W        1j\        rt          d           1j]        r5st          d           |j7        |j6        z   rt          j_        1_`        t          1j4                  \  }'}(t          tG          jc                    ft          t                      1jd        z             t          |'          d          })g }*t          |)|1          }+|j6        D ]},tF          jf        |,v stF          jg        r%tF          jg        |,v rt          d|, d|1           |+i                    |,          }-|-sR|+j                    |,          }.|.t          jl        u rt          d|, d|1           nt          d|, ds|1           |*m                    |-           |j7        D ]&}/|*n                    t          d|/d                     '|*1fS |j9        r@t          jp        1_`        t          ddd                    |j9                            g}*|*1fS 	 t          |j5        1|          }*n5# t          $ r(}0t          t?          |0          |1           Y d}0~0nd}0~0ww xY w|*1fS (  zParse command line arguments.

    If a FileSystemCache is passed in, and package_root options are given,
    call fscache.set_package_root() to set the cache's package root.
    @F)	r   usagedescriptionepilogfromfile_prefix_charsformatter_classadd_helpr9   r:   )      TN)inverser  strict_flaggroupr   r+   r-  r   r  r=   r  r  r.  r/  !argparse._ActionsContainer | Noner,   r>   c               `   |t          |           }|}|t          j        ur	|d| dz  }|                    | |rdnd||          }|j        }|                    ||rdnd|t          j                   |r3|J 
                    |            	                    || f           d S d S )Nz (inverse: )store_false
store_trueactionr  r  )r   r   r  add_argumentr  append)r   r-  r  r  r  r.  r/  argr  strict_flag_assignmentsstrict_flag_namess           r6   add_invertible_flagz,process_options.<locals>.add_invertible_flag  s    ?&t,,G=Ex(((,',,,,D  'C|$UY ! 
 
 x#*=<<"	 	 	
 	
 	
  	@###$$T***#**Dg++>?????	@ 	@r   zOptional arguments)titlez-hz--helpzShow this help message and exit)r6  r  z-vz	--verbosecount	verbosityzMore verbose messagesr5  .pyr   yesz-Vz	--versionz	%(prog)s z (compiled: r2  z&Show program's version number and exit)r6  r
  r  r9   z-Oz--outputFORMATzSet a custom output format)metavarr  choiceszConfig filezUse a config file instead of command line arguments. This is useful if you are using many flags or want to set different options per each module.)r=  r&  z--config-filez<Configuration file, must have a [mypy] section (defaults to z, )r  z--warn-unused-configszQWarn about unused '[mypy-<pattern>]' or '[[tool.mypy.overrides]]' config sections)r  r.  r  r/  zImport discoveryz2Configure how imports are discovered and followed.z--no-namespace-packagesnamespace_packageszBDisable support for namespace packages (PEP 420, __init__.py-less))r  r  r  r/  z--ignore-missing-importsr4  z*Silently ignore imports of missing modulesz--follow-untyped-importsz2Typecheck modules without stubs or py.typed markerz--follow-imports)normalsilentskipr  rF  z%How to treat imports (default normal))rD  r  r  z--python-executablestore
EXECUTABLEzQPython executable used for finding PEP 561 compliant installed packages and stubszspecial-opts:python_executable)r6  rC  r  r  z--no-site-packageszspecial-opts:no_executablez6Do not search for installed PEP 561 compliant packagesz--no-silence-site-packagesz=Do not silence errors in PEP 561 compliant installed packageszPlatform configurationzType check code assuming it will be run under certain runtime conditions. By default, mypy assumes your code will be run using the same operating system and Python version you are using to run mypy itself.z--python-versionzx.yz9Type check code assuming it will be running on Python x.yzspecial-opts:python_version)typerC  r  r  z
--platformPLATFORMzRType check special-cased code for the given OS platform (defaults to sys.platform))r6  rC  r  z--always-trueNAMEr8  z;Additional variable to be considered True (may be repeated))rC  r6  r  r  z--always-falsez<Additional variable to be considered False (may be repeated)zDisallow dynamic typingzDDisallow the use of the dynamic 'Any' type under certain conditions.z--disallow-any-exprz+Disallow all expressions that have type Any)r  r6  r  z--disallow-any-decoratedzRDisallow functions that have Any in their signature after decorator transformationz--disallow-any-explicitz'Disallow explicit Any in type positionsz--disallow-any-genericszLDisallow usage of generic types that do not specify explicit type parametersz--disallow-any-unimportedz4Disallow Any types resulting from unfollowed imports)r  r  r/  z--disallow-subclassing-anyz?Disallow subclassing values of type 'Any' when defining classeszUntyped definitions and callszConfigure how untyped definitions and calls are handled. Note: by default, mypy ignores any untyped function definitions and assumes any calls to such functions have a return type of 'Any'.z--disallow-untyped-callszXDisallow calling functions without type annotations from functions with type annotationsz--untyped-calls-excludeMODULEzeDisable --disallow-untyped-calls for functions/methods coming from specific package, module, or classz--disallow-untyped-defszXDisallow defining functions without type annotations or with incomplete type annotationsz--disallow-incomplete-defsztDisallow defining functions with incomplete type annotations (while still allowing entirely unannotated definitions)z--check-untyped-defsz=Type check the interior of functions without type annotationsz--disallow-untyped-decoratorsz;Disallow decorating typed functions with untyped decoratorszNone and Optional handlingzAdjust how values of type 'None' are handled. For more context on how mypy handles values of type 'None', see: https://mypy.readthedocs.io/en/stable/kinds_of_types.html#no-strict-optionalz--implicit-optionalz9Assume arguments with default values of None are Optionalz--strict-optionalz--no-strict-optionalr3  strict_optionalz;Disable strict Optional checks (inverse: --strict-optional)z--force-uppercase-builtinsz--force-union-syntaxzConfiguring warningsz7Detect code that is sound but redundant or problematic.z--warn-redundant-castsz5Warn about casting an expression to its inferred typez--warn-unused-ignoresz-Warn about unneeded '# type: ignore' commentsz--no-warn-no-returnwarn_no_returnz6Do not warn about functions that end without returningz--warn-return-anyzDWarn about returning values of type Any from non-Any typed functionsz--warn-unreachablez?Warn about statements or expressions inferred to be unreachablez--report-deprecated-as-notezHReport importing or using deprecated features as notes instead of errorsz--deprecated-calls-excludez`Disable deprecated warnings for functions/methods coming from specific package, module, or classzMiscellaneous strictness flagsz--allow-untyped-globalsz6Suppress toplevel errors caused by missing annotationsz--allow-redefinitionzEAllow restricted, unconditional variable redefinition with a new typez--allow-redefinition-newz--no-implicit-reexportimplicit_reexportz'Treat imports as private unless aliased)r  r.  r  r  r/  z--strict-equalityzKProhibit equality, identity, and container checks for non-overlapping typesz--strict-bytesz>Disable treating bytearray and memoryview as subtypes of bytesz--extra-checkszEnable additional checks that are technically correct but may be impractical in real code. For example, this prohibits partial overlap in TypedDict updates, and makes arguments prepended via Concatenate positional-onlyz,Strict mode; enables the following flags: {}z--strictzspecial-opts:strictz--disable-error-codezDisable a specific error codez--enable-error-codezEnable a specific error codezConfiguring error messagesz4Adjust the amount of detail shown in error messages.z--show-error-contextshow_error_contextz7Precede errors with "note:" messages explaining context)r  r  r  r/  z--show-column-numbersz%Show column numbers in error messagesz--show-error-endzVShow end line/end column numbers in error messages. This implies --show-column-numbersz--hide-error-codesz"Hide error codes in error messagesz--show-error-code-linksz&Show links to error code documentationz--prettyz{Use visually nicer output in error messages: Use soft word wrap, show source code snippets, and show error location markersz--no-color-outputrl   zDo not colorize error messagesz--no-error-summaryrj   zDo not show error stats summaryz--show-absolute-pathzShow absolute paths to filesz--soft-error-limitmany_errors_threshold)r  rK  r  r  zIncremental modezAdjust how mypy incrementally type checks and caches modules. Mypy caches type information about modules into a cache to let you speed up future invocations of mypy. Also see mypy's daemon mode: mypy.readthedocs.io/en/stable/mypy_daemon.html#mypy-daemonz-iz--incrementalz--no-incrementalr`   z-Disable module cache (inverse: --incremental)z--cache-dirDIRzRStore module cache info in the given folder in incremental mode (defaults to '{}')z--sqlite-cachez(Use a sqlite database to store the cachez--cache-fine-grainedzLInclude fine-grained dependency information in the cache for the mypy daemonz--skip-version-checkz/Allow using cache written by older mypy versionz--skip-cache-mtime-checksz5Skip cache internal consistency checks based on mtimezAdvanced optionsz#Debug and customize mypy internals.z--pdbzInvoke pdb on fatal errorz--show-tracebackz--tbzShow traceback on fatal errorz--raise-exceptionszRaise exception on fatal errorz--custom-typing-modulecustom_typing_modulezUse a custom typing module)rC  r  r  z--old-type-inferencez1Disable new experimental type inference algorithmz--new-type-inferencez--enable-incomplete-feature{,}zDEnable support of incomplete/experimental features for early previewz--custom-typeshed-dirzUse the custom typeshed in DIR)rC  r  z--warn-incomplete-stubz}Warn if missing type annotation in typeshed, only relevant with --disallow-untyped-defs or --disallow-incomplete-defs enabledz--shadow-filerL   )SOURCE_FILESHADOW_FILEshadow_filezWWhen encountering SOURCE_FILE, read and type check the contents of SHADOW_FILE instead.)r  rC  r  r6  r  z--fast-exitz--no-fast-exitrX   z--allow-empty-bodiesz--export-ref-infozReport generationz*Generate a report in the specified format.>   
memory-xmlr   _r   z-reportzspecial-opts:_report)rC  r  z-amypyc_annotation_file)r  rK  r  r  z--skip-c-genmypyc_skip_c_generation)r  r6  r  Miscellaneousz--quickstart-filez--junit-xmlz!Write junit.xml to the given filez--junit-formatglobalper_filez}If --junit-xml is set, specifies format. global: single test with all errors; per_file: one test entry per file with failuresz--find-occurrenceszCLASS.MEMBERzspecial-opts:find_occurrencesz5Print out all usages of a class member (experimental)z--scripts-are-modulesz-Script x becomes module x instead of __main__z--install-typesz8Install detected missing library stub packages using pipz--non-interactivezSInstall stubs without asking for confirmation and hide errors, with --install-typesz--interactive)r  r.  r  r/  r-  z--experimentalfine_grained_incrementalz$Enable fine-grained incremental modez--use-fine-grained-cachez.Use the cache in fine-grained incremental modez--statsdump_type_statsz--inferstatsdump_inference_statsz--dump-build-statsz--timing-statstiming_stats)r  r  z--line-checking-statsline_checking_statsz--debug-cachez--dump-depsz--dump-graphz--semantic-analysis-onlyz
--test-envz--local-partial-types)r  r  z--logical-depsz--bazelz--package-rootROOTz--cache-map+zspecial-opts:cache_map)r  r  r  z--debug-serializez--disable-bytearray-promotionz--disable-memoryview-promotionz--strict-concatenatezRunning codez{Specify the code you want to type check. For more details, see mypy.readthedocs.io/en/stable/running_mypy.html#running-mypyz--explicit-package-baseszLUse current directory and MYPYPATH to determine module names of files passedz--fast-module-lookupz	--excludePATTERNzRegular expression to match file names, directory names or paths which mypy should ignore while recursively discovering files to check, e.g. --exclude '/setup\.py$'. May be specified more than once, eg. --exclude a --exclude b)r6  rC  r  r  z--exclude-gitignorezhUse .gitignore file(s) to exclude files from checking (in addition to any explicit --exclude if present)-mz--modulezspecial-opts:modulesz.Type-check module; can repeat for more modules)r6  rC  r  r  r  z-pz	--packagePACKAGEzspecial-opts:packagesz/Type-check package recursively; can be repeatedr   z	--commandPROGRAM_TEXTzspecial-opts:commandz&Type-check program passed in as string)r6  rC  r  r  files*zspecial-opts:filesz%Type-check given files or directories)rC  r  r  r  zCannot find config file ''c                 >    dD ]\  } }t          | |           d S )NT)setattr)r  valuert   r:  strict_option_sets     r6   set_strict_flagsz)process_options.<locals>.set_strict_flagsM  s;     2 	* 	*KD%GT5))))	* 	*r   MYPY_CACHE_DIR )r+  zrMypy no longer supports checking Python 2 code. Consider pinning to mypy<0.980 if you need to check Python 2 code.c              3  4   K   | ]}t          |          V  d S r   )r=   )r   cs     r6   	<genexpr>z"process_options.<locals>.<genexpr>  s<       
 
 GG
 
 
 
 
 
r   r   z2Missing target module, package, files, or command.rA   z;May only specify one of: module/package, files, or command.zCan only use --explicit-package-bases with --namespace-packages, since otherwise examining __init__.py's is sufficient to determine module names for filesz;You can't make a variable always true and always false (%s))error_callback)r|  warning_callbackr   z+Can only find occurrences of class members.z6Can only find occurrences of non-nested class members.iz/--cache-map is incompatible with --sqlite-cachezlWarning: --new-type-inference flag is deprecated; new type inference algorithm is already enabled by defaultzGWarning: --strict-concatenate is deprecated; use --extra-checks insteadr   zPackage name 'z' cannot have a slash in it.z	Package 'z' cannot be type checked due to missing py.typed marker. See https://mypy.readthedocs.io/en/stable/installed_packages.html for more detailszCan't find package 'rO   )r   r+   r-  r   r  r=   r  r   r  r+   r.  r=   r/  r0  r,   r>   )r,   r>   )srR   r9   r:   r   r   r   r   r   coloradd_argument_groupr7  __file__endswithr  r%   r   r   r   CONFIG_NAMESSHARED_CONFIG_NAMESr   r   r  r   MANY_ERRORS_THRESHOLDr   	CACHE_DIRsortedr!   REPORTER_NAMESreplacer+   	Namespace
parse_argsr   osr*   existsr  r#   r   getattrgetenvr   rd   
expanduserr$   r   r   r   r   r   ra   ro  packagesmodulessumcommandr_   explicit_package_basesrE  setalways_truealways_falser   untyped_calls_excludedeprecated_calls_excludeprocess_error_codesprocess_incomplete_featuresr/   custom_typeshed_dirabspathabs_custom_typeshed_dirfind_occurrencestupler   ri   r   varsitemsreport_dirspackage_rootprocess_package_roots	cache_mapsqlite_cacheprocess_cache_mapprocess_strict_bytescache_fine_grainedr]   show_error_endshow_column_numberslogical_depsnew_type_inferencestrict_concatenater"   rN  
build_typer   r   getcwdr    r   sepaltsepr^   find_modules_recursivefind_moduler   FOUND_WITHOUT_TYPE_HINTSr   r8  r   rn  r   r   )6r8   r9   r:   r  r  rE   r   r!  r<  general_groupcompilation_statusconfig_groupimports_groupplatform_groupdisallow_any_groupuntyped_group
none_group
lint_groupstrictness_groupstrict_helperror_groupincremental_groupinternals_groupreport_groupreport_typeother_group
code_groupdummyr   rv  environ_cache_dirr   r   code_methodsoverlap_find_occurrencesr   val
report_dirsys_pathr]  search_pathstargetscachep	p_targetsreasonme2rt   r  r:  r;  ru  s6                                                    @@@@@r6   rW   rW     s    !szF!szF%!.
 
 
F 7""#%68
 #!37@ @ @ @ @ @ @ @ @ @x --4H-IIMhv,M     k'BY     "*!2!25!9!9Du&k),P;M,P,P,PP5     )     ,,4 -  L _ IIh&;h>Z&Z[[_ _ _     `    -- .b .  M !!Q    "9    
 "A    
 5554	     `-     )E	     $L     ..&4 /  N H*      a	      J      K       22'Z 3   ##:	 $    ##"a	 $    ##!6	 $    ![     #C 	    $N     --- .  M "0    !3     !/    $B    L    'J    ***W +  J H	    /8K\]]]J	     $e(:KS]    H4EZ    **$M +  J  D    <    E    S    N    %W    $3      007W0XX!E    T    "      6    Z    M    H     AGG		#$$ K !!<.C+ "    !!, "    !!+ "    ++*J ,  K !F    4	    .    1	    !5	    +     -    .    +	    .$     11 E 2   ""ol9J #    ""<	 #    ""#VH$677 #    7	    ""[ #   
 ""> #   
 ""#D #    // .S 0  O   D_ ```  F<>] !      \8X !       #)	 !      @ !      |(:K !    %chhv&9::;;;cAS	       5U !     I      ./ !      |(J[ \\\  [xGX !   
 H4E_      !4\PXPa bbb,,!/[ -  L h566  n,,%%;[((c22;;;9[999 &    *dIZ    
 6|RZRc     ++/+BBK0x7HIII]1TUUU:& M	     ,D	     <     G    - 
 
 
 
  
  +7	 	! 	
 	
 	
 	  &A 	! 	
 	
 	
 ,->XEV     |2HxO`     ,\HYZZZ
(~HDUVVV &;(BS     8CTUUU
lARSSS
|(BSTTT
2<hN_```
\@QRRR /XEVWWWW (HDUVVV
	,X=NOOO &2HL]     S'?hFW    
 +LxGXYYY
'8CT     (HDU     .|(J[\\\ **G +  J
 "[	    H4EZ    K  
 
 
 A     #=     $>     #5     !4	       E
dE"""#K  A27>>+66 A????@@@iiG* * * * * * * * g/ffMMM u+,,  	"2B77   .-**7+<==G %''L
dN7L/RRSSS *8RG<RG$$Q	
 	
 	
6666)   SVV ! )W%= )$(!  3,"7 3<;O 3= 	/!(L 	5$+$4L!? 	3#*?L   X 
 
 $|'<<$"
 
 
 
 
 1W%:LLMNNNNALLVWWW% 
g.H 
X	
 	
 	
 '%&&W-A)B)BBG 
Iiiw(()	
 	
 	

   =>>> @AAAv|<<<''v|V['\\\ ".*,'//':U*V*V' $ 3!,"?"E"Ec"J"JKK !!A%%LLFGGG !!Q&&LLQRRR!2 ,''--// : :	c==## 	:ss)++C55KJ/9G,  8gvw777  9 	LLLJKKK&,888   """ ! +&*#  +&*#  *%)"! 
J	
 	
 	

 ! Y*; YWXXX l33 ' &-%g&?@@!"Y[[NE)++0A"ABBE(OOUW
 
 gw??& 	& 	&Av{{bi{BINNEaEEEvwWWW44Q77I 	G**1--1JJJ sA  s  s  s    4444fgFFFNN9%%%%% 	7 	7ANN;tQ556666		  &3tT499\5I+J+JKKL	+();WgNNGG ! 	+ 	+ 	+R&'********	+s@   A)AA: A:
AB0B"AB+B+AB0YAY Y
AZ
Y"AZZAZ
r  r  c                   | |                     d           | J t          j                            t          j                              \  }}t          j        }t          j        t          j        z   }t          j        t          j        z   }||h}g }	|j        D ]}
t          j        	                    |
          r|                     d|
           t          j                            |
          \  }}
|r!||k    r|                     d||
z              |
rt          j        
                    |
          }
|
                    t          j                  s|
t          j        z   }
|
                    |          r|                     d|
           |
|v rd}
|	                    |
           |	|_        |                     |	           dS )z$Validate and normalize package_root.Nz.--package-root does not work here (no fscache)z!Package root cannot be absolute: z'Package root must be on current drive: z0Package root cannot be above current directory: rx  )r  r  r*   
splitdriver  curdirr  pardirr  isabsrelpathr  
startswithr8  set_package_root)rE   r  rt   current_driver]  dotdotslashdotdotslashtrivial_pathsr  rootdrives               r6   r  r    s    EFFFw))")++66M1
)Cy26!H)bf$K(OML$ " "7== 	GLLETEEFFFg((..t 	UUm++LLS54<SSTTT 	7??4((D==(( %bf}{++ ZXPTXXYYY}$$D!!!!'G\*****r   c                T   t          |j                  }|dz  dk    r|                     d           t          d|d          D ]}|j        ||dz            \  }}}||j        v r|                     d| d           |                    d          s.|                    d          s|                     d| d	           |                    d
          s|                     d|z             |                    d          s|                     d|z             ||f|j        |<   dS )z3Validate cache_map and copy into options.cache_map.r+  r   z5--cache-map requires one or more triples (see source)zDuplicate --cache-map source r2  r@  z.pyizInvalid --cache-map source z (triple[0] must be *.py[i])z
.meta.jsonz@Invalid --cache-map meta_file %s (triple[1] must be *.meta.json)z
.data.jsonz@Invalid --cache-map data_file %s (triple[2] must be *.data.json)N)ri   r  r  ranger  )r  r   rt   nisource	meta_file	data_files           r6   r  r  '  si    	L"##A1uzzLMMM1a^^ ; ;'3'=a!a%i'H$	9W&&&LLBBBBCCCu%% 	]foof.E.E 	]LL[v[[[\\\!!,// 	LLRU^^   !!,// 	LLRU^^   &/	$:&!!; ;r   tdr   all_messagesr   dict[str | None, list[str]]c                   |j         rx|j        d          d|j        d          }|j        dk    r+t          j        | ||rd |ini |j         ||j                   d S t          j        | |||j         ||j                   d S d S )Nr   r]  rA   rb  )	junit_xmlr   junit_formatr   write_junit_xmlr   )r  r   r  r   rt   
py_versions         r6   r   r   ?  s      .q1OOG4J14MOO
8++ (4<|$$"!       G-w/@*gN^     r   r   r   c                    |                     |  d           t          dd| gd| gi|           t          j        d           dS )zFail with a serious error.rO   g        TN)r   r  r   rt   rL   )rm   r   rR   rp   )r   r:   rt   s      r6   r^   r^   X  sX    
LLCTuW^    HQKKKKKr   rd   rI   c                   t           j                            |           sA|s t          j                            d           nt          j                            d           t          j        |           }t           j                            |          sg S t          |          5 }d |D             cd d d            S # 1 swxY w Y   d S )Nzkerror: Can't determine which types to install with no files to check (and no cache from previous mypy run)
zTerror: --install-types failed (an error blocked analysis of which types to install)
c                6    g | ]}|                                 S r   )r   )r   lines     r6   r   z2read_types_packages_to_install.<locals>.<listcomp>q  s     +++

+++r   )
r  r*   isdirrR   r:   rm   r   missing_stubs_fileisfileopen)rd   rI   fnamr   s       r6   rc   rc   a  s   7==## 	 	J<   
 Jg   #I..D7>>$ 		d ,q+++++, , , , , , , , , , , , , , , , , ,s   %B>>CCrJ   rH   c                  t          |j        |          }|sdS |r|st                       t          d           |j        s
J d            |j        dddg|z   }t          |                     d                    |          dd	
                     t                       |st          d          }|                                r'|                                	                    d          s9t          |                     ddd	
                     t          j        d           t                       t          j        |           d	S )zDInstall stub packages using pip if some missing stubs were detected.Fz!Installing missing stub packages:z+Python executable required to install typesrl  pipinstall noneT)boldzInstall? [yN] yzmypy: Skipping installationredrL   )rc   rd   r/   ra   styler   inputr   lowerr  rR   rp   r   run)ru   rt   rI   rH   r  cmdxs          r6   r_   r_   t  s:    .g.?KKH u  	
-...$SS&SSSS$dE9
=
HC	)//#((3--d/
;
;<<<	GGG "##wwyy 			 4 4S 9 9 	)//"?T/RRSSSHQKKKN34r   )r*   r+   r,   r-   )
r8   r<   r9   r   r:   r   r;   r=   r,   r>   )rs   r   rt   r#   rE   r   rr   r   r9   r   r:   r   r,   r   )
rw   r   r   r   ru   r   rt   r#   r,   r>   )r   r+   r,   r+   )r   r+   r,   r   )r   r   r,   r+   )rt   r#   r   r   r,   r>   )r8   r   r9   r  r:   r  r  r=   r  r=   rE   r  r   r+   r!  r+   r,   r"  )rE   r  r  r  rt   r#   r,   r>   )r  r  r   r   rt   r#   r,   r>   )r  r   r   r=   r  r   r   r  rt   r#   r,   r>   )r   r+   r:   r   rt   r#   r,   r   )rd   r+   rI   r=   r,   r   )
ru   r   rt   r#   rI   r=   rH   r=   r,   r=   )_r   
__future__r   r   r  r   rR   rQ   collectionsr   collections.abcr   r   ior   typingr   r	   r
   r   r   r   r@   r   r   r   r   mypy.config_parserr   r   r   r   mypy.error_formatterr   mypy.errorsr   mypy.find_sourcesr   r   mypy.fscacher   mypy.modulefinderr   r   r   r   r   r    mypy.optionsr!   r"   r#   mypy.split_namespacer$   mypy.versionr%   	_typeshedr&   statr'   __annotations__r(   r)   r7   r9   r:   r   rb   rf   RawDescriptionHelpFormatterr   r   r   abr   	Exceptionr   r   r   r   r   r   r   ArgumentParserr   Actionr  rW   r  r  r   r^   rc   r_   r   r   r6   <module>r%     sg   * * * " " " " " "  				     



  # # # # # # $ $ $ $ $ $             B B B B B B B B B B B B B B B B - - - - - - - - - - - -            0 / / / / / $ $ $ $ $ $ C C C C C C C C ( ( ( ( ( (                A @ @ @ @ @ @ @ @ @ / / / / / / $ $ $ $ $ $ ('''''' 7	                 "ZZq q q q q qh;# ;# ;# ;#|   P P P P PXA P P P 23CD  D D D D)+ + + + +  DAqOAOA	 	 	 	S S S S SY S S S      *2 2 2 2(F F F F F    .E E E E E
2G 2G 2G 2G 2Gx6 2G 2G 2Gj$ $ $ $ $ho $ $ $R !   &*p  p  p  p  p f! +  +  +  +F; ; ; ;0   2   , , , ,. !       r   