ML i9UdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl mZmZddlmZmZddlmZmZmZddlmZddlZddlZddlZddlm Z m!Z!m"Z"dd l#m$Z$m%Z%dd l&m'Z'dd l(m)Z)m*Z*dd l+m,Z,dd l-m.Z.ddl/m0Z0m1Z1m2Z2m3Z3ddl4m5Z5ddl6m7Z7m8Z8ddl9m:Z:m;Z;ddlm?Z?m@Z@ddlAmBZBdZCdeDd<e jdk(rddl mFZF d. d/dZGnd0d1dZH d. d/dZGdZIdeDd<d2dZJd3d ZKeLeMeMfZNd!eDd"<eOeNZPd!eDd#<eLePePfZQd!eDd$<Gd%d&ZRd'ZSdeDd(<d4d)ZT d5 d6d*ZUd7d+ZVd8d,ZW d9d-ZXy):zServer for mypy daemon mode. This implements a daemon process which keeps useful state in memory to enable fine-grained incremental reprocessing of changes. ) annotationsN)SequenceSet)redirect_stderrredirect_stdout)AnyCallableFinal) TypeAlias) WriteToConnreceivesend)InvalidSourceListcreate_source_list)FileSystemCache)FileDataFileSystemWatcher)InspectionEngine) IPCServer) BuildSourceFindModuleCache SearchPathscompute_search_paths)Options)FineGrainedBuildManagerrefresh_suppressed_submodules)SuggestionEngineSuggestionFailure)reset_global_state)FancyFormatter count_stats) __version__Fr MEM_PROFILEwin32) STARTUPINFOctjddd|dg}tj|j }|j dt j|jd|r|j d||r|j d|t}d |_ d |_ tj|d | y #tj$r}|jcYd }~Sd }~wwxYw)aCreate the daemon process via "dmypy daemon" and pass options via command line When creating the daemon grandchild, we create it in a new console, which is started hidden. We cannot use DETACHED_PROCESS since it will cause console windows to pop up when starting. See https://github.com/python/cpython/pull/4150#issuecomment-340215696 for more on why we can't have nice things. It also pickles the options to be unpickled by mypy. z-mz mypy.dmypyz --status-filedaemonz--options-data=""z --timeout=z --log-file=r) creationflags startupinfoN)sys executablepickledumpssnapshotappendbase64 b64encodedecoder%dwFlags wShowWindow subprocessPopenCalledProcessError returncode)options status_filetimeoutlog_filecommandpickled_optionsinfoes W/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/mypy/dmypy_server.py daemonizerE.s>>4 U]^ ,,w'7'7'9:)&*:*:?*K*R*R*T)UUVWX  NNZy1 2  NN[ 3 4}    WDd K,, <<  s5CC7! C2,C72C7ctjjtjjt j }|rDt j |d\}}|dz}|rtd|| S|dz }|r td||S t jt jdt jdtj}t j|dt j|dt j|d t j|t j }|rt jd|rlt|d d xt_t_tjj}t j|d t j|d|t jdy #t jdwxYw) zArrange to call func() in a grandchild of the current process. Return 0 for success, exit status for failure, negative if subprocess killed by signal. rzChild killed by signalzChild exit statusz /dev/nullr)a) bufferingN)r-stdoutflushstderrosforkwaitpidprintsetsidumaskopenO_RDWRdup2close_exitfileno)funcr?pidnpidstssigdevnullfds rD _daemonize_cbrcMs`  ggi  3*ID#*C.4t (C)3/J  IIK HHTNggk2995G GGGQ  GGGQ  GGGQ  HHW '')C *.x*JJ SZZZ&&(AA F HHQKBHHQKs EG22H cDtt|||j|S)zRun the mypy daemon in a grandchild of the current process Return 0 for success, exit status for failure, negative if subprocess killed by signal. )rcServerserve)r<r=r>r?s rDrErEzs VG['BHH(SSdmypyCONNECTION_NAMEcJtjjdg|zdd\}}|jr t d|j rt dd|_|j stjd|jdvrtjd |S) N-iFT)require_targetsserver_optionszRdmypy: Ignoring report generation settings. Start/restart cannot generate reports.zxdmypy: Ignoring report generation settings. Start/restart does not support --junit-xml. Pass it to check/recheck insteadz8dmypy: start/restart should not disable incremental mode)skiperrornormalz*dmypy: follow-imports=silent not supported) mypymainprocess_options report_dirsrS junit_xml incrementalr-exitfollow_imports)flags allow_sources_r<s rDprocess_start_optionsr|s** d+JAw bc  [ !    KL%@@ => Nrgc$|jdS)z=Can we skip looking for newly unsuppressed imports to module?z encodings.) startswithmodules rDignore_suppressed_importsrs   \ **rg _TypeAliasModulePathPairModulePathPairsChangesAndRemovalscFeZdZdd dZd!dZd"dZd#dZdd$dZd%dZ d&dZ d'd Z d( d)d Z d*d Z d"d Z d+d Zd,dZ d-dZ d. d/dZ d0 d1dZ d2dZ d3dZ d4dZ d5dZ d6 d7dZd8dZ d9dZd:dZ d;dZ ddZd?dZd%dZy)@reNc||_|j|_||_d|_t j j|rt j|t|_ d|_ d|_ d|_ d|_|jrd|_nt j"|_d|_||_t+t,j.t,j0|j2|_y)z2Initialize the server with the desired mypy flags.NT)r<r1options_snapshotr>fine_grained_managerrPpathisfileunlinkrfscacheraise_exceptionsrvfine_grained_incrementalshow_tracebackuse_fine_grained_cachecache_fine_grainedra cache_dirlocal_partial_typesr=r r-rMrOhide_error_codes formatter)selfr<r=r>s rD__init__zServer.__init__s ' 0 0 2 DH! 77>>+ & IIk "&( #' "+/(!%  ) )*.G & " G '+#&( CJJ@X@XYrgc|jjdd|jjd}|jj|dS)Nrr{r))platformpython_version)r<rr)r py_versions rD_response_metadatazServer._response_metadatasH 33A67q9T9TUV9W8XY  LL11ZPPrgcd}tt|j}tj}tj } t |jd5}tjtj|jd||jdddd |5t|}t|dtjj!t_t|dtj j!t_i}d|vrd d i}n>|d}t#|t$sd d i}n$|j'd} |j)||}d|d< |j5|j7t9|||dk(rt=tj>dddd#1swY%xYw#t*$rlt-j.tj0}d d d j3|zi}|j5|j7d|d<t9||wxYw#t:$rYwxYw#1swYxYw#|t_|t_|dk7rtj@|j |jCn#t:$rYnwxYwtj0} | dr| dtDurt-jF| wwwxYw)z2Serve requests, synchronously (no thread or fork).Nw)r]connection_name TrMrOr@rozNo command found in requestzCommand is not a stringzDaemon crashed! finalstopr)$rrir>r-rMrOrVr=jsondumprPgetpidrwriter r isatty isinstancestrpop run_command Exception tracebackformat_exceptionexc_infojoinupdaterrOSErrorrrwrcleanup SystemExitprint_exception) rr@server orig_stdout orig_stderrfdataresptbrs rDrfz Server.serves?DLL9jj jj 7 5d&&,  "))+&BXBXY[\]  $"6?D!,VXszz?P?P?R!SCJ!,VXszz?P?P?R!SCJ+-D , ')FG"&y/)'37$+-F#GD&*hhy&9G &'+'7'7'F%)DM D$;$;$=>VT*&(*, ?$  &$-&%.%?%?%P(/1Drwwr{1R'S $ D,C,C,E F04W $VT 2 %&#7$$D%CJ$CJ&  $**+    ||~H{x{*<))84 ={sIAF> I&B&I G I%+I$I4 I>GI A5II I IIIII;K3J+*K3+ J74K36J77runcheckrecheckis_ttyterminal_width)getattr __class__rdict)rr@rkeymethodrets rDrzServer.run_commandsuwd3 >5gYa@A A99N)*&&Cc4( ((Jrgc$i}|jt|ret|dr|jj ni}t j |}t|d5}|j|ddd|S|S#1swY|SxYw)zReturn daemon status. fswatcherrN) r get_meminfohasattrrdump_file_datarr0rVr)rfswatcher_dump_fileresrsrs rD cmd_statuszServer.cmd_status$sz!# ;=! 6=dK6P4>>002VXD 4 A)3/ 1   s   s 'BBcDtj|jiS)z Stop daemon.)rPrr=rs rDcmd_stopzServer.cmd_stop0s $""# rgc tj}tj} t|5t|5tj j dgt|zdd|jdtj\}} dddddd j|jsddiSt|k7rddiS|jri|jj} | j } tj"j%| | j&t(j*d \} } | | k7rdd iS|j7|||S#1swYxYw#1swYxYw#t,$r}d t/|d dcYd}~Sd}~wt0$r6}|j3|j3|j4dcYd}~Sd}~wwxYw)z6Check a list of files, triggering a restart if needed.rkTz mypy-daemon)rlrmrprogramheaderNrestartzconfiguration changedzmypy version changed) extra_pluginszplugins changedrrJouterrstatus)ioStringIOrrrqrrrslistrargparseSUPPRESScompare_stablerr"rmanagerplugins_snapshotbuild load_pluginserrorsr-rMrrrgetvaluecoder)rversionargs export_typesrrrOrMsourcesr<rstart_plugins_snapshotr{current_plugins_snapshotrrCs rDcmd_runzServer.cmd_run9s Z!( $V,'+yy'@'@d+(,'+ $ -'00 (A($GW ))$*?*?@!#:;;g%!#9::((33;;)0)A)A&.2jj.E.EW^^SZZr/F/++,/EE%'899 zz'<HH5  .! =c#h!< < Z!??,V__5FRSRXRXY Y Zsl E, E AEE &E,> E, A4E,E E  E)%E,, G 5F G  G +GG G c t||j|j}|j ||||S#t$r}dt |ddcYd}~Sd}~wwxYw)zCheck a list of files.rrJrN)rr<rrrr)rfilesrrrrrs rD cmd_checkzServer.cmd_checkdsW =( dllKGzz'<HH! =c#h!< < =s!7 AAAAc:tj}|jsddiS|j}|r6t|}|D cgc] } | js| j|vs| "}} |ru|j dd|D chc]} | js| j} } |D cgc] } | | vs|  } } t | |j|j} || z}tj}|jj}|jd ||z d d |jj}|jjxs||j_ |js|j|||| }n||J|j!|| }|j#||||}|j%|j'|||j_ |Scc} wcc} wcc} w#t$r}dt|ddcYd }~Sd }~wwxYw)zCheck the same list of files we checked most recently. If remove/update is given, they modify the previous list; if all are None, stat() is called for each file in the previous list. roz7Command 'recheck' is only valid after a 'check' commandcFtjj|dS)Nr))rPrsplitext)rs rDz$Server.cmd_recheck..sbgg&6&6q&9!&<rgT)rreverserrJrNz%fine-grained increment: cmd_recheck: .3frexplicit_export_types)timerprevious_sourcessetrsortrr<rrrrlogrfollowing_importsfine_grained_increment%fine_grained_increment_follow_importsincrement_output flush_caches update_stats)rrrrremovert0rremovalsrknownpadded added_sourcesrt1rold_export_typesmessagesrs rD cmd_recheckzServer.cmd_rechecknsYY[((VW W'' 6{H")OQQVVh8NqOGO  KKfn 44AA|BH##Hgv~N  #$4 ! =P 89% A!#c(a@@ AsHG)G)#G)G.G.) G33G3:!G88 HHHHc|jj}|jjxs||j_|js|j|||}nK|j s|j ||}n|j ||}|j||||}|j|j|||j_|S)zCheck using fine-grained incremental mode. If is_tty is True format the output nicely with colors and summary line (unless disabled in self.options). Also pass the terminal_width to formatter. r) r<rrinitialize_fine_grainedrrr r r r )rrrrrrrrs rDrz Server.checks <<44$(LL$=$=$M !((..wOC))+66wVb6cEE<F'''6>RC  #$4 ! rgc|jj|jr|jjyyN)rrNr flush_cachers rDr zServer.flush_cachess2   $ $  % % 1 1 3 %rgc|jr=|jj}|j|j|d<i|_yy)Nstats)rr dump_statsr)rrrs rDr zServer.update_statssA  $ $//77G    "==CLGM %rgc4|jjdk(S)zAre we following imports?rp)r<rxrs rDrzServer.following_importss||**h66rgc Nt|j|_tj}|j |tj} t j j ||j|j}|j} t||_t|} |j!r1t#|jj$|}|j |||_|j(r7tj} |jj$j+D]x}|j,}||j.J|jj1|j.t3t5|j6|j8|j:z|j=|\}}||j?|jj$tA|jjBjDz }|jj$j+D]H}|jGr|j.J|jI|jJ|j.fJtj}|jjM||} |j!r|jO|} tj}|jjBjQ||z | |z || z ||z t|t|zn|jj=tRrdd l*m+}|d tY| \}}}| r|t| krd nd}|j[| | ||} djd | Dd|dS#t jj$rG}djd|jD}|jr|d} } nd|} } | | ddcYd}~Sd}~wwxYw)N)rr<rrc3&K|] }|dz ywrNr.0rs rD z1Server.initialize_fine_grained..s:!QX:rJr)st_mtimest_sizehash)update_sources_time build_timefind_changes_timefg_update_time files_changedr)print_memory_profileF)run_gcr)c3&K|] }|dz ywr#rr$s rDr&z1Server.initialize_fine_grained..!:Aq4x:r').rrrrupdate_sourcesrqrr<r CompileErrorrr use_stdoutrrlenrfind_all_sources_in_buildgraphr used_cachevaluesmetar set_file_datarfloatmtimesizer* find_changedfind_added_suppressedrr search_pathsis_freshr2idrr  add_statsr#mypy.memprofiler0r!pretty_messages)rrrrrrresultrCoutputrrroriginal_sources_lent2stater<changedremovedt3t4r0__n_notesrs rDrzServer.initialize_fine_grainedsq+4<<8 YY[ G$ YY[ 9ZZ%%gt||UYUaUa%bF==$;F$C!"7|  ! ! #/0I0I0O0OQXYG    ( '   B2288??A zz<zz---,,JJeDJJ&7QUQZQZ[   $009 GW t11))//))11>> G2288??A ;~~' ::111NNEHHejj#9: ; B0077IH%%'EEgNB  % % - - 7 7$&G7"$r'!Bw!'lS\9 8  NN ' ' )  <  .%h/GR7S]#:''2FP^_ww:::2QWXX[{{'' 9WW:qzz::F||!2SvSsa8 8  9s6OP$|jJ|jj}tj}|(|&|j||j |\}}n|j ||xsg|xsg\}}|r t ||||j|jjt|jz }t||j|j|_ tj} |jd| |z dd|jj||} tj} |jd| | z dd|j!| |z | | z t#|t#|z||_| S)aPerform a fine-grained type checking increment. If remove and update are None, determine changed paths by using fswatcher. Otherwise, assume that only these files have changes. Args: sources: sources passed on the command line remove: paths of files that have been removed update: paths of files that have been changed or created explicit_export_types: --export-type was passed in a check command (as opposite to being set in dmypy start) &fine-grained increment: find_changed: rr fine-grained increment: update: )r-r.r/)rrrr4rAupdate_changedadd_all_sources_to_changedrBr9rrCrr<data_dirrrrFr7r) rrr rrrrrNrOrrrLs rDrzServer.fine_grained_increment#s&((444++33 YY[ >fn    (#009 GW $227FLb&,TVW GW  'w 84--  % % + +SUG4H4H   4GW__gN^N^_ YY[ .refresh_files"'../?d.S Srgr)rV)r-r.refresh_suppressed_timefind_added_suppressed_time cleanup_time)rrrrreturn list[str])#rrr9rrkeysr4rrArr<rYrCrrfind_reachable_changed_modulesadd_explicitly_newrXextendrcopyrdirect_importsitemsrrdepsrrBrr2fix_module_depsr8rrF)rrrrr9r orig_modules changed_pathsrsourceseenrN new_filesrworklistrsources2rLr^ module_idrM new_messagesrPnew_unsuppressedmodrrQ to_delete module_patht5rs @rDr z,Server.fine_grained_increment_follow_importsYsNYY[((444#88$**&..EJJL)  G$335 3GW__gN^N^_ YY[ \\^Fay%**659H.6S6d9RSHS!%!D!D%}" GY    *+227B2NH OOG $ YY[ T!%U[[] 3 ( Iu85::';'@'@%WcL''  (YY[#99%wG[G[\ #O_`SVSVdC`I` NN9 %    *+223CRRV2WH#3 , 4<t%9%>%>t||Ua   ++H  , YY[ % ;I%$#I.33 "...  )[!9:  ; +222yAH 9% @ D112 ##% YY[ 6rBwsm1EF 2g7$&G')Bwb  G54T8as#P1P6(P6%P;cg}g}|j}|jd|D|r |j}|j|vr,|j |j|j ||j |vr6|j J|j |j|j fn|j|vr||j} | jxsg} | j| zD]O} | |vs|j | |j t|| j || jdQ|r ||fS)aFollow imports within graph from given sources until hitting changed modules. If we find a changed module, we can't continue following imports as the imports may have changed. Args: roots: modules where to start search from graph: module graph to use for the search seen: modules we've seen before that won't be visited (mutated here!!). Needed to accumulate all modules encountered during update and remove everything that no longer exists. changed_paths: which paths have changed (stop search here and return any found) Return (encountered reachable changed modules, unchanged files not in sources_set traversed). c34K|]}|jywrr)r%ros rDr&z8Server.find_reachable_changed_modules..s9fFMM9sTr[) rhrrraddr2r ancestors dependenciesrrE) rrootsr9rprnrNrqrrnxtrMr~deps rDrez%Server.find_reachable_changed_moduless&. ::< 999,,.Czz%$  %xx=(xx+++ CHH56u$cjj)!OO1r  -- 9dC$   E#JOOU3Z]]]a(bcd !!rgc||d}|jDcgc]}t||j|dc}Scc}w)z9Return the direct imports of module not included in seen.rTr[)rrr)rrr9rMrs rDrizServer.direct_importss=fQi LQL^L^_S E#JOOS4@___s"<ct}|jD]}||jz}|Dchc]}||vr t|s|}}|Dchc]}|j ddd}}t |||j }t||j |j}g} |D]}|j ddd} | |vr|j|d} t| tsA||vsF|js| jdsh| j|| f|j|| Scc}wcc}w)a_Find suppressed modules that have been added (and not included in seen). Args: seen: reachable modules we've seen before (mutated here!!). Needed to accumulate all modules encountered during update and remove everything that no longer exists. Return suppressed, added modules. .r)rT) fast_path.pyi)rr;suppressed_setrsplit%filter_out_missing_top_level_packagesrrr< find_modulerrrendswithr2r}) rr9rprCall_suppressedrMrpackagesfinderfound top_level_pkgrIs rDrBzServer.find_added_suppressed sU\\^ 3E e22 2N 3) U"+DV+L   ;IIFLLa(+II8.Cr3r'r)rHr7r)rrrrrrs rDr zServer.increment_output>sDA''#g,Www:::2QWXXrgc|jjxr|}|jjxr|}|r|jj ||}|jj rgd}t |\}} } |r |jj|| ||}n,|r| t|k(r|jj||}|r||gz}|r(|D cgc]} |jj| }} |Scc} w)N)fixed_terminal_width) use_color) r< color_outputprettyrfit_in_terminal error_summaryr! format_errorr7format_successcolorize) rr n_sourcesrrr fit_widthsummaryn_errorsrSn_filesms rDrHzServer.pretty_messagesEsLL--8& LL''2F ~~55~6H << % %"&G)4X)> &Hgw..55gyI6CM!9..77 9M#wi/ A> BBc^|jj||}|j||Sr)rrW _find_changed)rrr rrns rDrWzServer.update_changedis-55ffE !!'=99rgcZ|jj}|j||Sr)rrAr)rrrns rDrAzServer.find_changedos'335 !!'=99rgcB|Dcgc]4}|jr&|j|vr|j|jf6}}|Dchc]}|j}}|jDcgc]}|j|vs|}}g}|D]/}|j}|sJ|j|j|f1|j |||jD cic]} | j| j} } |D]} | jsJ| j| vs | | j| jk7s=|j| | j| jf|j| j| jf||fScc}wcc}wcc}wcc} wr)rrrr2rf) rrrnrorNmodulesomittedrOrrlasts rDrzServer._find_changedss " {{v{{m;]]FKK (  077V6==77(,(=(=^fV]A]6^^ 2F;;DK4 NNFMM40 1 2 1+/*?*?@Q @@ 3A66M6vv~$qvv,!((":QVV aff56!&&12  35 8^As9F F'F;FFcF|jDchc]}|j}}t|}|j|Dcgc]N}|jr@|j|vr2|j|jf|vr|j|jfPc}ycc}wcc}wr)rrrrgr)rrrNroprevious_modules changed_sets rDrfzServer.add_explicitly_news 9=8M8MNfFMMNN'l & ;;MM)99]]FKK0 C  ,  O s BABc |jsddiSt|j||||||| } |jj} d|j_ |dk(r| j |} n5|dk(r| j |} n|dk(r| j |} nJd| |j_d | vr"t| d tsJ| d xxd z cc<| S#| |j_wxYw) z!Locate and inspect expression(s).rozWCommand "inspect" is only valid after a "check" command (that produces no parse errors)) verbositylimit include_span include_kindinclude_object_attrs union_attrs force_reloadTtypeattrs definitionzUnknown inspection kindrr) rrr< inspectionsget_type get_attrsget_definitionrr) rshowlocationrrrrrrrengineold_inspectionsrIs rD cmd_inspectzServer.cmd_inspects((3 "  % %%%!5#%  ,,22#'   7v~2))(3%..x8777u'6DLL $ F?fUmS1 11 5MT !M (7DLL $s A CC.c |jsddiSt|jfi|} |r|j|}n|j|}|sd}n|j ds|dz }|ddd|j S#t $r'}dt|icYd}~|j Sd}~wwxYw#|j wxYw) z#Suggest a signature for a function.rozWCommand 'suggest' is only valid after a 'check' command (that produces no parse errors)zNo suggestions rrrrN)rrsuggest_callsitessuggestrr rr)rfunction callsiteskwargsrrrs rD cmd_suggestzServer.cmd_suggests((3 "$";";FvF ..x8nnX.(\\$'t rQ7    ! 'SX& &     '    s5%A> B1> B. B)B.B1)B..B11Cc0tjdiS)z&Hang for 100 seconds, as a debug hack.d)rsleeprs rDcmd_hangzServer.cmd_hangs 3 rgr)r<rr=rr> int | NonerbNone)rbzdict[str, str])rbr)r@rrdict[str, object]rbr)r str | Nonerbr)rbr) rrr Sequence[str]rboolrrrintrbr) rrrrrrrrrbrNN) rrrrrrr list[str] | Nonerrrbr) rlist[BuildSource]rrrrrrrbdict[str, Any])rrrbr)rbr)rrrrrrrbr)NNF) rrr rrrrrrbrc)F)rrrrrbrc) rrr9mypy.build.Graphrpset[str]rnAbstractSet[str]rbz/tuple[list[tuple[str, str]], list[BuildSource]])rztuple[str, str]r9rrbr)r9rrprrCrrblist[tuple[str, str]]) rrcrrrrrrrbr)FN) rrcrrrrrrrbrc)rrrbr)rrr rcrrcrbr)rrrbr)rrrnrrbrrrrNrrbr)rrFFFFF)rrrrrrrrrrrrrrrrrrrbr)rrrrrrrbr) __name__ __module__ __qualname__rrrfrrrrrrrr r rrrr rerirBr rHr4rWrArrfrrrrrgrDreresZ@Q?5B " )I)I)I )I  )I  )I )IVI"I26I@DIVYI I$(#' 111 1 ! 1 ! 1 1f(8<FJ\_ 24 7 VY(VY26VYHKVY VYv$(#'&+ 4"4!4! 4 $ 4  4nIN|(|AE| ||*" *" *" *" ( *" 9 *"X`%`.>` `2%2-52EP2 2hY!Y,=YGKY]`Y Y%)   #   :0:(:2;:EN: : : ( 9I  @ ( 3H  ,""%*!",,, ,  ,  ,,#,,, ,\ 0rgreiMiBci} ddl}|j}|j}|jtz |d<|j tz |d<t jdk(r|jtz |d<|Sddl }|j|j}t jdk(rd}nd}|j|ztz |d<|S#t$r d |d <Y|SwxYw) Nrmemory_rss_mibmemory_vms_mibr$memory_maxrss_mibdarwinr)izXpsutil not found, run pip install mypy[dmypy] to install the needed components for dmypymemory_psutil_missing)psutilProcess memory_inforssrvmsr-r peak_wsetresource getrusage RUSAGE_SELF ru_maxrss ImportError)rrprocessmeminforrusagefactors rDrrsCG.."%%' ' c 1  ' c 1  <<7 "'.'8'83'>C# $ J ''(<(<=F||x''-'7'7&'@3'FC# $ J-   9 #$* J- sCC#"C#ct|}|Dchc]}|j}}|jD]/\}}||vs |jt |j |1|Scc}wr)rrrjr2rr)r9extrarIrorprrMs rDr8r8sh%[F(. /fFMM /D /;    MM+ejj&9 :; M 0sA)ct|}|j|Dcgc]@}|jr2|j|jf|vr|j|jfBc}ycc}w)zAdd all (explicit) sources to the list changed files in place. Use this when re-processing of unchanged files is needed (e.g. for the purpose of exporting types for inspections). N)rrgrr)rrNrbss rDrXrXs^ g,K NN wwBIIrww/{BYY   sAA(c|jD]y}g}g}|j|jzD])}||vr|j||j|+||_t ||_||_t ||_{y)zAfter an incremental update, update module dependencies to reflect the new state. This can make some suppressed dependencies non-suppressed, and vice versa (if modules have been added to or removed from the build). N)r;r suppressedr2rdependencies_setr)r9rMnew_suppressednew_dependenciesrs rDrlrl/s  3%%(8(88 +Ce| '',%%c*  + .!$%5!6)">2 3rgct}|j|jz|jz|jz}|D]u} |j |}|D]\}|jdr|dd}n-|jdr|dd}n|jdr|dd}||vsL|j|^w|S#t $rg}YrwxYw)aQuickly filter out obviously missing top-level packages. Return packages with entries that can't be found removed. This is approximate: some packages that aren't actually valid may be included. However, all potentially valid packages must be returned. z.pyNrz-stubsi) r python_path mypy_path package_path typeshed_pathlistdirrrr})rrCrrrrentriesentrys rDrrCs EE    !  # # $  $ $ % ! ooa(G !E~~e$cr 'cr )cr   %  ! !" L G sB:: CCr) r<rr=rr>rr?rrbrr)r\zCallable[[], None]r?rrbr)ryrcrzrrbr)rrrbr)rbr)r)r9rrzSequence[BuildSource]rbrr)r9rrbr)rrrCrrrrbr)Y__doc__ __future__rrr3rrrPr/r8r-rrcollections.abcrr AbstractSet contextlibrrtypingrr r typing_extensionsr r mypy.buildrq mypy.errors mypy.mainmypy.dmypy_utilr r rmypy.find_sourcesrr mypy.fscachermypy.fswatcherrrmypy.inspectionsrmypy.ipcrmypy.modulefinderrrrr mypy.optionsrmypy.server.updaterrmypy.suggestionsrrmypy.typestater mypy.utilr r! mypy.versionr"r#__annotations__rr%rErcrir|rtuplerrrrrrerrr8rXrlrrrgrDr%s #  87''566C(6-]] U@-1$ U<<7&`d  '* 5? R\  >+\`dTT'*T5?TR\T T! &+#38_ ,">22!&'G!HJHD D TU<=? $9  3(##&1#