ML i%AUdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlmZmZmZmZddlmZmZmZmZmZmZmZmZmZddlm Z!ddl"Z#ddl$m%Z%ddl&m'Z'dd l(m)Z)m*Z*dd l+m,Z,m-Z-m.Z.m/Z/dd l0m1Z1m2Z2m3Z3dd l4m5Z5dd l6m7Z7ddl8m9Z9m:Z:m;Z;mZ>m?Z?ddl@mAZAddlBmCZCddlDmEZEddlFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQerddlRmSZSddl#mTZUddlVmWZWddlXmYZYddlZm[Z[ddl\m]Z]ddl^m_Z_m`Z`maZaddlbmcZcmdZdmeZemfZfmgZgmhZhmiZiddl8mjZjddlkmlZlddlmmnZnddlompZpmqZqmrZrddlsmtZtdd lumvZvmwZwdd!lxmyZydd"lzm{Z{m|Z|dd#l}m~Z~dd$lmZmZdd%lFmZmZdd&lmZd'Zd(ed)<hd*Zd(ed+<d,Zeed-fZd.ed/<Gd0d1Z d dd2Z dd3Zdd4Zdd5ZGd6d7eZGd8d9eZdd:Zd;Zd(ed<<d=Zd(ed><d?Zd(ed@<dAZd(edB<dCZd(edD<dEZd(edF<ddGZ ddHZ ddIZddJZddKZGdLdMZddNZdOZd(edP<dQZd(edR<dSZd(edT< ddUZddVZddWZdXZd(edY<ddZZdd[Z dd\Zdd]Zdd^Z dd_Zdd`ZddaZddbZddcZdddZddeZ ddfZddgZ ddhZddiZ GdjdkeZGdld-Z d ddmZddnZddoZddpZddqZ ddrZ ddsZddtZdduZddvZGdwdxZddyZddzZddd{Z d dd|Zdd}Zefdd~ZddZddZdef ddZddZddZddZddZ ddZy)aFacilities to analyze entire programs, including imported modules. Parse and analyze the source files of a program in the correct order (based on file dependencies), and collect the results. This module only directs a build, which is performed in multiple passes per file. The individual passes are implemented in separate modules. The function build() is the main interface to this module. ) annotationsN)IteratorMappingSequenceSet) TYPE_CHECKINGAnyCallableClassVarFinal NamedTupleNoReturnTextIO TypedDict) TypeAlias)Buffer) TypeChecker)OUTPUT_CHOICESErrorFormatter) CompileError ErrorInfoErrorsreport_internal_error) prepare_sccsstrongly_connected_componentstopsort)TypeIndirectionVisitor)MessageBuilder)Import ImportAll ImportBase ImportFromMypyFile SymbolTableTypeInfo) PossiblyUndefinedVariableVisitor)SemanticAnalyzer)SemanticAnalyzerPreAnalysis) DecodeErrordecode_python_encodingget_mypy_comments hash_digestis_stub_package_fileis_sub_path_normabsis_typeshed_file module_prefix read_py_filetime_ref time_spent_usReports) errorcodes)parse_mypy_comments) fixup_module) free_tree)FileSystemCache)FilesystemMetadataStore MetadataStoreSqliteMetadataStore) BuildSourceBuildSourceSetFindModuleCacheModuleNotFoundReasonModuleSearchResult SearchPathscompute_search_paths) Expression)Options)parse) ChainedPluginPluginReportConfigContext) DefaultPlugin)LimitedVariableRenameVisitorVariableRenameVisitor)dump_type_stats)%is_module_from_legacy_bundled_packagestub_distribution_name)Type)reset_global_state type_state) json_dumps json_loads) __version__Fr DEBUG_FINE_GRAINED> collections.abcabcsystypestypingbuiltins _typeshed collectionsmypy_extensions_collections_abctyping_extensionsCORE_BUILTIN_MODULESState _TypeAliasGraphceZdZdZddZy) BuildResultaPThe result of a successful build. Attributes: manager: The build manager. files: Dictionary from module name to related AST node. types: Dictionary from parse tree node to its inferred type. used_cache: Whether the build took advantage of a pre-existing cache errors: List of error messages. c||_||_|j|_|j|_|j |_g|_yN) managergraphmodulesfiles all_typesr[ cache_enabled used_cacheerrors)selfrlrms P/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/mypy/build.py__init__zBuildResult.__init__s<  __ && !//!# N)rl BuildManagerrmrgreturnNone)__name__ __module__ __qualname____doc__rvrwruriris $rwric 8 g d fd }|xs|}|xstj}|xstj}|xsg} t||||||||} | _| S#t $r.} | j } |d| j|  | _d} ~ wwxYw)agAnalyze a program. A single call to build performs parsing, semantic analysis and optionally type checking for the program *and* all imported modules, recursively. Return BuildResult if successful or only non-blocking errors were found; otherwise raise CompileError. If a flush_errors callback is provided, all error messages will be passed to it and the errors and messages fields of BuildResult and CompileError (respectively) will be empty. Otherwise those fields will report any error messages. Args: sources: list of sources to build options: build options alt_lib_path: an additional directory for looking up library modules (takes precedence over other directories) flush_errors: optional function to flush errors after a file is processed fscache: optionally a file-system cacher c(j|yrk)extend)filename new_messages is_seriousmessagess rudefault_flush_errorsz#build..default_flush_errorss  %rwN)r str | Noner list[str]rboolryrz)rZstdoutstderr_buildrsr use_stdoutr) sourcesoptions alt_lib_path flush_errorsfscacherr extra_pluginsrresulteseriousrs @rubuildrsDH&&,5&CG& &  7#7L  !szzF  !szzF!'RM WlL'66S` !   ll"T1::w/  sA"" B+)BBc tjdk(rtjdddt }|xs t }t ||||} d} |jrddlm } | ||j} t|} |jt|fd} t|| ||\}}tjj!|j"}t%|| tj&| | |t(||| |j*dnt-j.|j*||||}|j1d k\r|j3t5|t7 t9|||}|j:st=j>|j@tC|j@||jDtG|jD|tI||tKjJ}|jLjO|jQtKjJ|z |jSd tKjJ|jTz tW|jX|jZj]fz|j_| | ja|sStjj!|j"r*tc|j"te|j"tjj!|j"r!tg|j"|jhSS#tKjJ}|jLjO|jQtKjJ|z |jSd tKjJ|jTz tW|jX|jZj]fz|j_| | ja|sStjj!|j"r*tc|j"te|j"tjj!|j"r!tg|j"|jhwwxYw) NCPythoni@ rr4ct|Srk)r1)path cached_reads ruz_build..sl46Urw) read_source) ignore_prefix source_setreportsr version_idpluginplugins_snapshotrserror_formatterrrrr)cache_commit_timez=Build finished in %.3f seconds with %d modules, and %d errors)5platformpython_implementationgc set_thresholddefault_data_dirr:rD report_dirs mypy.reportr5r?readr load_pluginsosrisdir cache_dirrxgetcwdrVoutputrget verbositytracereprrRdispatchfine_grained_incrementalrSreset_all_subtype_caches timing_statsdump_timing_statsline_checking_statsdump_line_checking_statsritime metastorecommit add_statslog start_timelenrnrs num_messages dump_statsfinishadd_catch_all_gitignoreexclude_from_backupsrecord_missing_stub_packagesmissing_stub_packages)rrrrrrrrdata_dir search_pathsrr5rrsrsnapshotcache_dir_existedrlrmt0rs @rurrs%%'94 R,!H**G'(LQLG'(G$7$78(J,,K G)U VF#GVV]KFH g&7&78 iik! ' 6Nd|wxYw)zLoad all configured plugins. Return a list of all the loaded plugins from the config file. The second return value is a snapshot of versions/hashes of loaded user plugins (for cache validation). rNmypypluginsrdcPjd|jdy)NrF)r)report raise_error)messagerslines ru plugin_errorz.load_plugins_from_config..plugin_errors$ dAw'e,rwr:.pyzCan't find plugin ""z[\\/]zPlugin "z" does not have a .py extensionzError importing plugin "z": z5Plugin "{}" does not define entry point function "{}"z1Error calling the plugin(version) entry point of  filezFType object expected as the return value of "plugin"; got {!r} (in {})zKReturn value of "plugin" must be a subclass of "mypy.plugin.Plugin" (in {})z&Error constructing plugin instance of )rrryr) importlib config_filefind_config_file_line_numberset_filer rrbasenamersplitendswithjoinrisfilerrZinsertresearch import_module ExceptionhasattrformatgetattrrVprint isinstancetype issubclassrIappendtake_module_snapshotr{)rrsrrrrcustom_plugins plugin_path func_name plugin_dirfnam module_namemoduleexc plugin_typers ` @ruload_plugins_from_configr<s@!H   8| '(;(;VY OD rz-$&N OOG''w7=  !% "''"";/ /%0%7%7Q%? "K    &'',,rwww7J7J'K[YK77>>+.3K=BC)EFJ77##K0Ds)K HHOOAz * YYx -77##K0D 8D6)HI J%K ,,[9F%xx{j000HHQKvy) GNN   4'&)4[AK +t, X__  +v.  &-    ! !+g"6 7$8$@H[ !u=~ 8 ##M K 3K=C5I J J K%xx{j000HHQK&  Ek]RTU\b c  $  :;;O;O:PPRSZ` a  sB0K$L98%M$ L-L;LLL.L69M&M>crt|||\}}||z }t|}|s||fSt|||gz|fS)aLoad all configured plugins. Return a plugin that encapsulates all plugins chained together. Always at least include the default plugin (it's last in the chain). The second return value is a snapshot of versions/hashes of loaded user plugins (for cache validation). )r<rKrH)rrsrrr3rdefault_plugins rurrsU 8PNHm#N*73N x'' .N3C"C Dh NNrwct|drG|jJt|jd5}t|j }dddnd}t |dd}|dS#1swYxYw)zTake plugin module snapshot by recording its version and hash. We record _both_ hash and the version to detect more possible changes (e.g. if there is a change in modules imported by a plugin). rNrbunknownrVnoner)r*ropenr,rr,)r9fdigestvers rur2r2s~ vz"*** &//4 ( +A *F + + &- 0CU!F8   + +s A**A3cd} g}t|d5}t|D]\}}|j}|jdr*|j dr|ddj}||k(}Q|sTt j |d|sn|j|dz d d d t|dk(r|d S y#1swYxYw#t$rYywxYw) zReturn the approximate location of setting_name within mypy config file. Return -1 if can't determine the line unambiguously. FzUTF-8)encoding[]rdrz\s*=Nr) rC enumeratestrip startswithr"r&matchr1rOSError) rsection setting_namein_desired_sectionresultsrDircurrent_sections rurrs    $ ) *Q$Q< *4zz|??3'DMM#,>&*1Rj&6&6&8O)8G)C&'BHHd5KT,RNN1q5)  * * w<1 1:    * *    s5C AC3C C$C C C CCceZdZdZ d ddZddZddZddZddZddZ dd Z dd Z dd Z dd Z dd Zd dZd!dZd!dZd!dZd"dZd#dZy)$rxaK This class holds shared state for building a mypy program. It is used to coordinate parsing, import processing, semantic analysis and type checking. The actual build steps are carried out by dispatch(). Attributes: data_dir: Mypy data directory (contains stubs) search_paths: SearchPaths instance indicating where to look for modules modules: Mapping of module ID to MypyFile (shared by the passes) semantic_analyzer: Semantic analyzer, pass 2 all_types: Map {Expression: Type} from all modules (enabled by export_types) options: Build options missing_modules: Set of modules that could not be imported encountered so far stale_modules: Set of modules that needed to be rechecked (only used by tests) fg_deps_meta: Metadata for fine-grained dependencies caches associated with modules fg_deps: A fine-grained dependency map version_id: The current mypy version (based on commit id when possible) plugin: Active mypy plugin(s) plugins_snapshot: Snapshot of currently active user plugins (versions and hashes) old_plugins_snapshot: Plugins snapshot from previous incremental run (or None in non-incremental mode and if cache was not found) errors: Used for reporting all errors flush_errors: A function for processing errors after each SCC cache_enabled: Whether cache is being read. This is set based on options, but is disabled if fine-grained cache loading fails and after an initial fine-grained load. This doesn't determine whether we write cache files or not. quickstart_state: A cache of filename -> mtime/size/hash info used to avoid needing to hash source files when using a cache with mismatching mtimes stats: Dict with various instrumentation numbers, it is used not only for debugging, but also required for correctness, in particular to check consistency of the fine-grained dependency cache. fscache: A file system cacher ast_cache: AST cache to speed up mypy daemon Nci|_| |_||_tj|_||_| |_|j j|||_||_ ||_ ||_ ||_ ||_ i|_t|_i|_i|_t'|t(s t)||g}||_t|_t/|j|j |j,|j |j*|_i|_t5|_t|_t|_| |_|duxr |j>}|j@xr |jB xs |jDxr| |_#| |_$tK|j|jH|j|j|_&tND]}|jPr|jLjS|d}t'|tTstWd|dgtY|jZ|s t]|rotWdt^j`jc|d|dd |d gte||_3i|_4|jjj$tm|jjj|_4i|_7||_| |_8ts||_:tw||j|_<g|_=t|_>i|_?d |_@y) N)rT fast_pathzFailed to find builtin module z, perhaps typeshed is broken?zmypy: "z" shadows library module "rz1note: A user-defined top-level module with name "z" is not supportedr)Astatsrrrrrrsset_ignore_prefixrrrrrrrnsetmissing_modules fg_deps_metafg_depsr.rHrincomplete_namespacesr'semantic_analyzerrprindirection_detector stale_modulesrechecked_modulesr reporters incrementalruse_fine_grained_cacherqrr@find_module_cachercuse_builtins_fixtures find_modulerrr/abs_custom_typeshed_dirr-rrrcreate_metastorer shadow_map shadow_filedictshadow_equivalence_maprread_plugins_snapshotold_plugins_snapshotread_quickstart_filequickstart_stateprocessed_targetsr ast_cachegc_freeze_cycles)rtrrrrrrrrrrsrrrrr has_reportersr9rs rurvzBuildManager.__init__Vs$&(   ))+    %%m4.($  $,. ),24 -/ &-0"7VH5F 03u"!1 LL   & & KK KK " 24$:$<!'*u+.5(t+A0A0A    "555W9W9W "!!   !0   t||T\\doo" + F,,))55f5MDdC("5fX=Z[\  ? ?FJ^Kbggood344NvhVWXGxOab  (*'2+- << # # /"4<<#;#;D//58d} At || stnt }|j|| |jft|t st |t}|j||||jf|j#d|S) aFind all reachable import statements in a file. Return list of tuples (priority, module id, import line number) for all modules imported in file; lower numbers == higher priority. Can generate blocking errors on bogus relative imports. c2j}|j}|dk(r |jStjj jj dr|dz}|dk7r$dj|jdd| }|jr|dz|jzn|}|sdjjjjjjj|jddd|S) z)Function to correct for relative imports.rz __init__.rd.Nz2No parent module -- cannot perform relative importTblocker)fullnamerelativerrrr rMr#splitrsrnamerrr)rfile_idrelnew_idrrts rucorrect_rel_impzBBuildManager.all_imported_modules_in_file..correct_rel_impsmmG,,Caxvv ww *55kBqax((7==#5et#<=/2vvWs]SVV+7F $$TYY 4<<H ""HHa!U_c#MrwrNrTFc,|djd S)Nrdr)count)xs rurz;BuildManager.all_imported_modules_in_file..<s! 3/rwr)rzImportFrom | ImportAllryr)importsis_unreachabler.rr rridsr1rrr#r"names is_modulerr sort)rtrrresrpri ancestor_prir_ancestor_parts ancestorspartcur_idall_are_submodulesr__sub_ids`` ruall_imported_modules_in_filez)BuildManager.all_imported_modules_in_files (+-<<! FC%%c6*)#w7C#23#@L!$VA CSXX#67)+#s);$& $2VD%,,T2JJ chhy6I388'TUV V Z0,S1F)-&)#w7C$'II7b!'#!4>>&1JJVSXX'>?16. 7*#?QxW^_CJJVSXX67Y/)#x8CJJ_S%9388DEC! FR /0 rwct||duS)z>Is there a file in the file system corresponding to module id?N)find_module_simple)rtrs rurzBuildManager.is_module?s!"d+477rwc8tj}|r%|jjj|t ||||j|}||_|j dt|j t|jtj|z |jjr+|jd|jj|jj||j||S)zoParse the source of a file with the given name. Raise CompileError if there is a parse error. rrd) files_parsedmodules_parsed stubs_parsed parse_timezBailing due to parse errors)rrs ignored_filesaddrG _fullnamerris_stub is_blockersrrset_file_ignored_lines ignored_lines)rtrrr ignore_errorsrrtrees ru parse_filezBuildManager.parse_fileCsYY[  KK % % ) )$ /VT2t{{GD 4<</0T\\*yy{R'   ;; " " $ HH2 3 KK # # % **41C1C]S rwcjtj}||jvr5t|jj |j|d}ni}|j Dcic]\}}|t |}}}|jtj|z |Scc}}w)Nrload_fg_deps_time)rr^rUrrr~r\r)rtrrdepskvvals ruload_fine_grained_depsz#BuildManager.load_fine_grained_deps]s YY[ "" "dnn11$2C2CB2G2OPQDD%)ZZ\2TQq#a&y22 r)9: 3s-B/c|jE|jj|r)|jj||j||yyyrk)rr is_sourcerrn)rtrtype_maprs ru report_filezBuildManager.report_filehsD << #(A(A$(G LL  dDLL(G D)H #rwc.|jjSrk)rrrs rurzBuildManager.verbosityns||%%%rwc|jdk\rM|rtdg|d|jint|j|jjyy)NrdzLOG: rrrr-rflushrtrs rurzBuildManager.logqsK >> q g::dkk:4;;' KK    !rwcddl}|jdk\r|jdg|y|jjrI|rt |d|j int |j |j jyy)Nrrdz fine-grained:rr) mypy.buildrrrrWr-rr)rtrr s rulog_fine_grainedzBuildManager.log_fine_grainedysi >> q DHH_ /w / ZZ * *w1T[[14;;' KK    +rwc|jdk\r4tdg|d|ji|jjyy)NrzTRACE:rrrs rurzBuildManager.traces< >> q ( 7W 74;; 7 KK    !rwc |jD]:\}}||jvr|j|xx|z cc<,||j|<<yrk)r~rZ)rtkwdsrrs rurzBuildManager.add_statssF**, (JCdjj  35("' 3  (rwc|jSrk)rZrs rur}zBuildManager.stats_summarys zzrwrk) rrrrCrrrr?rzReports | NonerrFrrrrIrzdict[str, str]rsrr-Callable[[str | None, list[str], bool], None]rr:rrrrrzErrorFormatter | Noneryrzryrzryr)rrryr)rrryzos.stat_result | None)rrryr)rr#ryzlist[tuple[int, str, int]])rrryr) rrrrrrrrrrFryr#)rrrydict[str, set[str]])rr#rdict[Expression, Type]rrFryrz)ryr)rrryrz)rr ryrz)ryzMapping[str, object])r{r|r}r~rvrrgrrrrrrrrrrrrrr}rrwrurxrx,sl'r26!t"t""t" t" # t"  t"t"t"t")t"t"Dt"!t"t"t" /!t"" #t"l0 J4$P 6HT8 *->BMT 4 EE(>EIPE E &    (rwrxc zt|jDcic]\}}|t|c}}Scc}}wrk)rTr~list)rrrs ru deps_to_jsonrs- aggi8daq$q'z8 998s7 z@deps.meta.jsonDEPS_META_FILEz@root.deps.jsonDEPS_ROOT_FILEz@rootFAKE_ROOT_MODULEc|j}d}|jj}|D]}|tk7r)t |||j |j \}}}nt}|sJ|jd||jj|t||s|jd|d}||j|d||<i} |jD]H\}} | jr | j} n%| jr| jj} nd} | | |<J| |d} |jt t#| s|jdt d}|rZ|j$j't)|j d |j |j$j+d d d d y y ) aWrite cache files for fine-grained dependencies. Serialize fine-grained dependencies map for fine-grained mode. Dependencies on some module 'm' is stored in the dependency cache file m.deps.json. This entails some spooky action at a distance: if module 'n' depends on 'm', that produces entries in m.deps.json. When there is a dependency on a module that does not exist in the build, it is stored with its first existing parent module. If no such module exists, it is stored with the fake module FAKE_ROOT_MODULE. This means that the validity of the fine-grained dependency caches are a global property, so we store validity checking information for fine-grained dependencies in a global cache file: * We take a snapshot of current sources to later check consistency between the fine-grained dependency cache and module cache metadata * We store the mtime of all the dependency files to verify they haven't changed FzWriting deps cachez*Error writing fine-grained deps JSON file T)rrr)r deps_metaz/Error writing fine-grained deps meta JSON file Nrz-Error writing fine-grained dependencies cacher)rr^copyrget_cache_namesxpathrrrwriterrr~ source_hashrrrrTrsr_cache_dir_prefixr) rdepsrlrmrerrorr^rr deps_json meta_snapshotstrrs ruwrite_deps_cachers,!!I E'',,.L Y ! !-b%)//7??SOAq)&Iy ()4  &&y,uRy2IJ KKDYKP QE(1G>>>Dwwww|| b !&L AD ??>:d+; < EnEUVW  1'// BD'//Za$S]ab rwcvddlm}|jDcic]\}}|js|i}}}|jD]i\}}t |||}|r||jst }|j |i} | j |tj|k|Scc}}w)aSSplits fine-grained dependencies based on the module of the trigger. Returns a dictionary from module ids to all dependencies on that module. Dependencies not associated with a module in the build will be associated with the nearest parent module that is in the build, or the fake module FAKE_ROOT_MODULE if none are. r)trigger_to_target) mypy.server.targetrr~rr0r setdefaultr\update) rrmrrrrtriggertargetsr9 mod_rdepss ru invert_depsrs5 CH++-,[BSUSZSZRV,[E,[ JJL=u&7&@AU6]//%F$$VR0 Wce,33G< = L-\s B5B5cddlm}t|j|}|j D]\}}|j |}|||!|S)a&Generate fine-grained dependencies into a form suitable for serializing. This does a couple things: 1. Splits fine-grained deps based on the module of the trigger 2. For each module we generated fine-grained deps for, load any previous deps and merge them in. Returns a dictionary from module ids to all dependencies on that module. Dependencies not associated with a module in the build will be associated with the nearest parent module that is in the build, or the fake module FAKE_ROOT_MODULE if none are. rmerge_dependencies)mypy.server.depsrrr_r~r)rlrmrrr9mdepsold_depss rugenerate_deps_for_cachersU4  /E , 11&98U+, Lrwz@plugins_snapshot.jsonPLUGIN_SNAPSHOT_FILEcrt|j}|jjt|s|j j tjk7rZ|jjt|j d|j |jjddddyyy)zBWrite snapshot of versions and hashes of currently active plugins.NrzError writing plugins snapshotTr) rTrrrrrrrdevnullrsrrrrlrs ruwrite_plugins_snapshotr s'223H    # #$8( C OO % % 3 1'// BD'//Za$DdS 4 Drwctt|dd}|yt|ts|j dt |y|S)zIRead cached snapshot of versions and hashes of plugins from previous run.zPlugins snapshot z!Could not load plugins snapshot:  log_success log_errorNz6Could not load plugins snapshot: cache is not a dict: )_load_json_filerr.rorr/rs rurqrq*sO'5 H  h % LTRZ^L\]^ Orwcdd}|jrdi} t|jd5}t|j}dddi}|j D]\}\}}}|||f||< |S|S#1swY4xYw#t $r%} t dt| d|Yd} ~ |Sd} ~ wwxYw)Nr@z)Warning: Failed to load quickstart file: rr)quickstart_filerCrUrr~r)r-r) rr quickstartraw_quickstartrDrryzrs rursrs:s<@J*, Wg--t4 6!+AFFH!5 6J#1#7#7#9 -iq!Q$%q!9 4  - : 6 6  W =c!fXRHv V V  Ws.BA5.B5A>:B B/ B**B/c tt|dd}|y|d |jDcic]\}}|j||j!c}} t j t j z}t fd|Dr|jdy|d}t|tsJ|jjsK|jD]8} |j|d |d k(}|r!|jd |d y|Scc}}w#t$rd }Y2wxYw) zRead and validate the fine-grained dependencies cache. See the write_deps_cache documentation for more information on the details of the cache. Returns None if the cache was invalid in some way. z Deps meta z1Could not load fine-grained dependency metadata: r Nrc34K|]}||k7ywrkr).0rcurrent_meta_snapshotrs ru z"read_deps_cache..gs! Kb=  5b 9 9 Ksz6Fine-grained dependencies cache inconsistent, ignoringrrrFz,Invalid or missing fine-grained deps cache: )rrr~meta_source_hashr\keysanyrr.rorskip_cache_mtime_checksvaluesrFileNotFoundError) rlrmrrrcommonmodule_deps_metasrmatchedrrs @@ruread_deps_cacher#NsV  E I j)M /4kkm$*Br?R?R?^B  ##% &-B-G-G-I)J JF KF KK LM!+. ' .. . ?? 2 2%,,. D !**4<8DMI J4PV<.YZ  - %  sD-D-4D33 EEctj} |jj|}|j tj|z |S#t$r|j ||zYywxYw)Nmetastore_read_time)rrrrOrr)rrlr rdatas ru _load_ff_filer({sp B  %%d+ $))+*:; K  I$%sAA:9A:c8tj} |jj|}|j tj|z |j dk\r0|j||jjz tj}t|}|j tj|z t|tsJ|S#t$r|j ||zYywxYw#tj$rm|jj!|d|j"|jj%dddj'|j"j(d YywxYw) z1A simple helper to read a JSON file with logging.Nr%r)data_json_load_timerzpError reading JSON file; you likely have a bad cache. Try removing the {cache_dir} directory and run mypy again.rTr)rrrrOrrrrrstripdecoderUr.rojsonJSONDecodeErrorrsrrrr+r)rrlr r rr't1rs rurrs] B  %%d+ $))+*:;a kDKKM$8$8$::; YY[D!diikB.>?&$''' 3  I$%    dGOO<   #$*6GOO4M4M6#N   s%C6AD6DDA=FFc|jrtjS|j}|j}tj j |d|z}|S)z5Get current cache directory (or file if id is given).z%d.%d)rrcurdirrpython_versionrr#)rr pyversionbases rurrsG}}yy!!I&&I 77<< 7Y#6 7D Krwctjj|d} t|d5}t d|t d|dddy#1swYyxYw#t $rYywxYw)zdAdd catch-all .gitignore to an existing directory. No-op if the .gitignore already exists. z .gitignorerz# Automatically created by mypyr*N)rrr#rCr-FileExistsError) target_dir gitignorerDs rurrsf  Z6I )S ! Q 3! < #A        s. AA AAAA A*)A*ctjj|d} t|d5}|j ddddy#1swYyxYw#t $rYywxYw)zExclude the directory from various archives and backups supporting CACHEDIR.TAG. If the CACHEDIR.TAG file exists the function is a no-op. z CACHEDIR.TAGrzSignature: 8a477f597d28d172789f06886806bc55 # This file is a cache directory tag automatically created by mypy. # For information about cache directory tags see https://bford.info/cachedir/ N)rrr#rCrr8)r9 cachedir_tagrDs rurrsb 77<< N;L  , $  GG        s. AA A AAA A! A!cr|jrtt|}|Stt|}|S)z&Create the appropriate metadata store.) sqlite_cacher=rr;)rmdss rurlrls901B71KL J&&7&@A Jrwcf|jr&|jjt||}nd}|Rt|}tj j |d|tj j |d|dfSt j j|jd}tj j|jd}|r tj j|d}d}|jr|dz}|jrd}nd }|d z||z|fS) aGReturn the file names for the cache files. Args: id: module ID path: module path cache_dir: cache directory pyversion: Python version (major, minor) Returns: A tuple with the file names to be used for the meta JSON, the data JSON, and the fine-grained deps JSON, respectively. Nrrdr __init__.pyrvz .deps.jsonz.data.ffz .data.jsonz .meta.json) cache_maprrrrrrr#rr rMcache_fine_grainedfixed_format_cache) rrrpairrootprefix is_packager data_suffixs rurrs  $$XdG%<=  !)Q.Q0NPTUU WW\\288C= )F!!$'22=AJfj1I!!\) !! " \ !6K#7 CCrwc t|||j\}}}|jd|d|tj}t ||d|dd|d}tj}|yt |t s!|jd|d t|yt||} tj} |j| |z ||z | |z | j|k7s0| j$| j| j | j|jd |d y| j |j k7r|jj"r| jt%| jt%| j&zt%| j(k7sAt%| jt%| j&zt%| j*k7r|jd |d y| j} |jj-|j/} |jj"r| d| d<d| vr| d=| | k7r|jd |d|jj0dk\rt3t5| t5| zD]f} | j7| | j7| k7s'|jdj9| | j7| | j7| hy|j:r;|j<r/|j<|j:k7r|jd |dyt?tA|jBjEtG||d}| jH|k7r|jd |dy|jd| S)aFind cache data for a module. Args: id: module ID path: module path manager: the build manager (for pyversion, log/trace, and build options) Returns: A CacheMeta instance if the cache data was found and appears valid; otherwise None. z Looking for z at zMeta  zCould not load cache for : r Nz: meta cache is not a dict: )load_meta_timeload_meta_load_timeload_meta_from_dict_timeMetadata abandoned for z: attributes are missingz: new attributes are missingr debug_cachez: options differrz {}: {} != {}z: plugins differTis_checkz: plugin configuration differsrd) fresh_metas)%rrrrrr.rorrrrrrrrrrskip_version_checkrrrrclone_for_moduleselect_options_affecting_cacherr|r\rr+rrrrUrTrreport_config_datarJr)rrrl meta_jsonrrrrr0mt2cached_optionscurrent_optionsrrs rufind_cache_metar^s{.b$HIy! MMLD 45 B 7%t1 C\]_\``bAc D B | dD ! /t3OPTUYPZ|\]T9-A B BwBGVX[]V]  77? 66> >> ! <<  -bT1IJK ++ +GOO4V4V 99  q~~ Q\\!2 2c!++6F F q~~ Q\\!2 2c!++6F F -bT1MNOYYNoo66r:YY[O))%4Z%@z"& = )( -bT1ABC ?? $ $ )c.1C4HHI !%%c*o.A.A#.FFMM*11!3!3C!8/:M:Mc:R ##(@(@  # #w'C'C C KK1"5EF G7>>445HT\`5abcK }} # -bT1OPQ !$ Hrwc ||jd|y|jr|s|jd|dytj}|jj}|Jd|jj sA |j |j}||jk7r|jd|dy|rt||j}|j|}|ytj|js8tj|js|jd|d|d y|j!tj|z |j#} |j$} | |j&k7r|s| s|jd|d |d y|rd nt)|j*} |s| |j,k7s||j.k7r|j0ro||j0vra|j0|\} } }t)| | k(r@| | k(r;||j2k(r,|jd|d ||j5| |}|Stj} tj|jrd}n|j6j9|}|j!tj|z ||j2k7r4| r|jd|d ||S|jd|d |dytj}|j5| |}||| | ||j|j>|j@|jjC|jE|jF|jH|jJ|jL|j|jNd}tQ||jjR}tU|||j\}}}|jdjW||||j,tj}|jXj[|||j!tj|z ||z |S|jd|d ||S#t$r|jd|dYywxYw#tt:t<f$rYywxYw)aChecks whether the cached AST of this module can be used. Returns: None, if the cached AST is unusable. Original meta, if mtime/size matched. Meta with mtime updated to match source file, if hash/size matched but mtime/path didn't. NzMetadata not found for rPz : errors were previously ignoredz0Internal error: meta was provided without a pathz: failed to stat data_jsonz: data cache is modifiedz: file or directory z does not exist)validate_stat_timez: file z has different sizerz#Metadata fresh (by quickstart) for )rrr)validate_hash_timezUsing stale metadata for z has different hashrrrrrrrrrrrrrrrz1Updating mtime for {}: file {}, meta {}, mtime {})validate_update_timevalidate_munging_timezMetadata fresh for ).rrrrrrrrrOrrrstatS_ISDIRst_modeS_ISREGrrgst_sizerrst_mtimerrrtr_replacerr,UnicodeDecodeErrorr)rrrVrWrrrrrrTrQrr+rr)rrrrrlrrrrfine_grained_cacherrqmtimeqsizeqhashr meta_dict meta_bytesrYrr0s ru validate_metarses | -bT23 z -bT1QRS B OO ! !E  OOO  ?? 2 2  ))$..9J  ( KK1"5MN O goo.   $ B z << #DLL,D -bT1EdV?[\ r)9:!779 ::D tyy/A -bT>QRSAC ,E etzz)TTYY->  # #0H0H(H $+#;#;D#A FE56{e# %499:L A"WTFST}}5t}< YY[ ||BJJ' %oo99$?  TYY[2-=> $)) #! 7t74&IJ  5bTFYZ[B==u4=8D#"oo $ 1 1"oo#OO<?  ))( 7%%' ~~goo&A&AB  ,N..334GD[`4abK   $ B z *4&12#I. H  (#  t##^+ rd-89 rd,78y*5 KK7 {C D"4' '$%%i0 AC ,E ::D oo..r2G  "" " $ 99;((( " D&$ ; ;.s0Mq10MszError deleting cache file rLN) rrrr#rr{rOerrnoENOENTstrerror) rrrl meta_path data_pathr cache_pathsrrs ru delete_cachers.b$HIy!i(K KK)B4qa0MK0M(M'NOPS S    $ $X .S Sww%,,& 8 "QZZLQR SsA44 C=>CCceZdZdZy)ModuleNotFoundz=Control flow exception to signal that a module was not found.N)r{r|r}r~rrwrurr&sGrwrceZdZUdZded<dZded<ded<d ed <d Zd ed <d Zd ed<d ed<d Zd ed<d Z d ed<d Z d ed<d Z ded<d Z d ed<d Z ded<ded<ded<ded<ded<ded<ded <d Zd!ed"<d#ed$<d Zd%ed&<dZd'Zd(Zd ed)<d*ed+<d,Zd,Zd-ed.<d Zd/ed0<d,ZdZded1<d2ed3< dY dZd4Zed[d5Zd\d6Zd]d7Zd]d8Zd\d9Zd,d:d^d;Zd\d<Z e!jDd_d`d=Z#dad>Z$dbdcd?Z%d\d@Z&d,dAdcdBZ'dddCZ(d\dDZ)dedEZ*dedFZ+d\dGZ,d\dHZ-dfdIZ.dgdJZ/d]dKZ0d\dLZ1d\dMZ2d\dNZ3dhdOZ4dadPZ5didQZ6djdRZ7d\dSZ8dbdkdTZ9dldUZ:dldVZ;d\dWZr)validate_meta_time temporaryz(Deferring module to fine-grained update  ());rlrerrr caller_linerrr1rrrrVrrfind_module_and_diagnoserr]rris_silent_import_modulerrrrqr^rrrrrrr add_ancestorsr_ defaultdictrrrrsrrrr\rrrrrziprrr load_treergexist_added_packagesrcompute_dependenciesr)rtrrrrlrr ancestor_for root_sourcerfollow_importsrall_depsrrs rurvzState.__init__ws$ !3 X5X X3  q (( (& "."="="B"B"DD     & & (:(:K'H I"$D " 77@ !> !> '?LL  "+ ($n)"& -gt<["DO 77??40DL'Z FNt||'A'A'w?DIyy$&*ii&>&>#(, % FNt||';';'A'A$'GF  )4)@)@)E& YY[!$))TWWdiiRYZ  $))+2BC 99!%TYY%;%; LL   + + - -rwc #,K|jjj}|jjj|j d|jjj||r|jyy#t$rt $rk}t ||jd|jj|j|jj|jjYd}~d}~wwxYww)aTemporarily change the error import context to match this state. Also report an internal error if an unexpected exception was raised and raise an exception on a blocking error, unless check_blockers is False. Skipping blocking error reporting is used in the semantic analyzer so that we can report all blocking errors for a file (across multiple targets) to maintain backward compatibility. Nr) rlrsrset_import_contextrr)rrrrrr)rtrsave_import_contexterrs ru wrap_contextzState.wrap_contexts#ll11@@B ..t/B/BC   ../BC     !     !  ##  ## ##   s1ADB9DD&A!D D DDcL|jj|jSrk)rlrrrs rurzState.load_fine_grained_deps9s||22477;;rwc|jJd|jjr,t|jj|j d}n,t |jj|j dd}|ytj}t|tr&t|}tj||_ ntj||_ tj}|j j||z |sJ|j|j j |j"<|j jdyy)NzBInternal error: this method must be called only for cached moduleszCould not load tree: z Load tree )deserialize_timerd) fresh_trees)rrrDr(rrlrrr.bytesrr#rr deserializerrnr)rtrr'rr}r0s rurzState.load_tree<s II ! P O P ! << * * !4!4dllD[\D" ##T\\yy$a&aa$ TYY 4 4dll6Y6YZrwrc ( |jy|j}|j|jv}|j}|s-|j d|j d|jdn,|j d|j d|jdt}|j5|j}d|_ |jrc|a |j|j}t|jj|}|jj||_nY|jr9|jjj=|jr d}d|_n|Jt?||_|jA||s\|jC|j|j ||jDxs|jFjH|jF|_n~|j|jd|_|jJjM|j |jjN|jDxs|jFjHddd|xjPtQ|z c_(|s?tS|jJjTjW|j g|_,n!|j|jd|_,|s|j||j<|s|j[|s|j]|j|jXf|j|j<y#t"$r}|j$Jt'dj)|jj+t-j.t,j0zdt-j2|j$g|j|d}~wt4t6f$re} |jj9d rd |jd } nd |jd t;| } t'| g|j| d} ~ wwxYw#1swY xYw)zParse file and run first pass of semantic analysis. Everything done here is local to the file. Don't depend on imported modules in any way. Also record module dependencies based on imports. NzParsing rrzUsing cached AST for zmypy: can't read file '{}': {}r)module_with_blockerz.pydz,mypy: stubgen does not support .pyd files: ''zmypy: can't decode file 'z': )rrrrd)/rrlrrvrnrrr2rrrrr*rrr,rrOrrr+replacerrseprrlr)r"rrrwparse_inline_configurationrrrrrsrrr3rerror_info_maprrsemantic_analysis_pass1r) rtrrlcachedrnrrrioerr decodeerrrs rurzState.parse_file`s 99 ,,G---// KK(4::,b ; < KK/ |2dggYaH I Z    5 [[FDKyyV^Z"==diiHD3GOO4H4H4NOF'.'B'B4'HD$,t||3399$))D#% )))#/#7  + +F 3#..GGJJ"&//"OT\\5O5O LL / $--dgg6q9 55JJII++OOAt||'A'Ac5 n mB//!%W^^%B%B%F%FtzzSU%V WD  ' 1 1$'' :1 =D #yyGDGG   ( ( *    !&*ii1B1B%C$''"E! !;;222&<CC $ 1 1"))+2F K " EKK 8 -1GG!!+K8Zyy))&1 LTYYKWXY 9$))CIGWX&u$''JPYY Z/5 5 s@3"RAM35ER3 RDL LL   ( (TWWdll K!. =  ##**61e< = rwc|j}|jJt}t}|j 5|j |j|j |j|ddd|jjj|j |jjt|j_ |jjsh|jjs#|jj!t#|j$r#|jj!t'|xj(t)|z c_y#1swYxYw)zPerform pass 1 of semantic analysis, which happens immediately after parsing. This pass can't assume that any other modules have been processed yet. N)rrr2r(r visit_filerrrlrsset_skipped_lines skipped_linesr$rrallow_redefinition_newacceptrLallow_redefinitionrMr3)rtrranalyzers rurzState.semantic_analysis_pass1s ,,yy$$$ Z/0     I    4::tww H I --djj$)):Q:QR%- yy  <<66   !=!?@))   !6!89 mB// I Is 3E44E>c||jvr6|jj||jj|||jvr7|j j ||jj |yyrk)rrr1rrrr{rtdeps ruadd_dependencyzState.add_dependencysq d++ +    $ $S )  ! ! % %c * $%% % OO " "3 '    & &s + &rwc||jvr6|jj||jj|||jvr7|jj ||jj |yyrk)rrr{rrr1rrs rusuppress_dependencyzState.suppress_dependencysq $'' '    $ $S )  ! ! ( ( - d)) ) OO " "3 '    # #C ( *rwc|j}|jJg|_t|_g|_t|_i|_i|_|j|j|jjj|jz}|D]|\}}}t||jj|t|j|<||jk(rN|j!|||jvsn||j|<~|jdk7r|j!d|j#y)zCompute a module's dependencies after parsing it. This is used when we parse a file that we didn't have up-to-date cache information for. When we have an up-to-date cache, we just use the cached info. Nr])rlrrr\rrrrrrrget_additional_depsminrrrrr)rtrl dep_entriesrrrs rurzState.compute_dependenciess(,,yy$$$ #!e:: II LL   3 3DII >? ) -MCT"%c4??+>+>r7+K"LDOOB TWW}    #***(,!!"%  - 77j    + rwc|jjryt}|j5|j j ddd|xj t |z c_y#1swY(xYwrk)rsemantic_analysis_onlyr2r type_checkercheck_first_passr3)rtrs rutype_check_first_passzState.type_check_first_pass# se << . .  Z     3     0 0 2 3 mB// 3 3s A88Bc (|js{|jJd|j}t|j|j |j |j|j|j|j|_|jS)Nz2Internal error: must be called on parsed file only) rrrlrrsrnrrrrrtrls rurzState.type_checker+ sx!!99( ^*^ ^(llG!,   .."D !!!rwct|jjdk(sJ|jjdS)Nrdr)rr _type_mapsrs rurzState.type_map: s@4$$&112a777  "--a00rwc |jjryt}|j5|j j }ddd|xj t |z c_S#1swY)xYw)NF)rrr2rrcheck_second_passr3)rtrrs rutype_check_second_passzState.type_check_second_pass@ sl << . . Z     =&&(::,> U >> / /  $ $ ^^ 1 1%2G2G H II  0"7>>7??CMMOLLIIOO  Irwc D|jJd|j}|jjryt }|j 5|j}|j r)|jj|jt|jj}|jjD] \}}}|j|j|jt|j t"sJ|j%|j j&|j j(r%|j|j j(|j j*r%|j|j j*|j j,s|j|j j,#|j/|j1j2||jj4rFt7|j|j8|jj:d|j|j=|j|j|j|j?|jj@|jjBr0tE||jF|j|j|jI|jjJs+|jjLstO|jddd|xjPtQ|z c_(y#1swY(xYw)NrT)rninferredtypemap))rrlrrr2r export_typesrprrrrlocal_definitionsr/r1r.noder%rbasesmetaclass_typetypeddict_type tuple_type_patch_indirect_dependenciesr module_refsdump_inference_statsrNrrnrupdate_fine_grained_depsr_export_ref_infowrite_undocumented_ref_infor free_stater preserve_astsr9r3)rtrlrrrprsyms ru finish_passeszState.finish_passes\ syy$a&aa$,, << . .  Z    + %ooG##!!((9 T]]_3356I!YY88: > 388'$$SXX.chh1$$SXX^^4xx..!(()@)@Axx..!(()@)@Axx**!(()<)<= >  - -d.?.?.A.M.My Y||00IIJJ LL00! MMO     4==?DLL I  ) )$,,*>*> ?..+'++W__dmmo OO ??;;GOODaDa$))$W+ %X mB//Y+ %+ %sC NB1NFNNc`|jr"|jjd|_yyrk)rresetrs rurzState.free_state s*       $ $ &!%D  rwcd|vsJ|j}|jjj||z}||z }t |D]}||jj vr||j vr=||jjvr%|j|t|j|<g||j vsv||jjvs|j|yrk) valid_referencesrlrb find_modulesr|rnrr]rrrr)rtrr[valid encounteredextrars rurz"State._patch_indirect_dependencies s5   %%'ll77DDUKkY e#%= .C$,,...$---#T\\=Y=Y2Y##C('3$D///C4<<;W;W4W((- .rwc|jJ|jdvriSddlm}||j|j |j j |jj S)N)r]r\r[rZr^r)get_dependencies)targetrr3r)rrrr#rrr3rl)rtr#s rucompute_fine_grained_depszState.compute_fine_grained_deps s`yy$$$ 77I II599]]_<<66LL((   rwc|jj}|js |jr3ddlm}||j |tj|yy)Nrr) rlrrCrrrr%rSupdate_protocol_deps)rtrrrs rurzState.update_fine_grained_deps sL,,&&  % %)I)I ; t==? F  + +D 1 *Jrwc|jJt|j|jz|jz}|j |j d|vr|j d|S)Nrzos.path)rr\rrrr)rt valid_refss rurzState.valid_references s^~~)))**T__|j \}|_||j<k(r*|jjAd |jd y|jjAd |jd |j)||_y#t$r0td|j|jj wxYw) NrzError serializing rTrz$Duplicates in dependencies list for rrzCached module z has same interfacez has changed interface)!rrrrrrrdebug_serializerlrDrrrzr)r-rrtransitive_errorrrrdependency_prioritiesdependency_linesrrr\rrrrrrr)rtr' is_errorsrrnew_interface_hashs rurzState.write_cache scyy$a&aa$ ||%%3||44||++||++>>%x -   ++- ))  $))T\\ :DI  % % % 5 ..0 ))+ +++3t(()*c   /   R 1$''"T=N=NB>O>ORVRaRa>abs##C2bbbs'Ac|j|jzDcgc]}|jj|d c}Scc}w)Nrd)rrrrrs rur.zState.dependency_lines. s89=9J9JT__9\]#!!%%c1-]]]s#Acf|jjs&tj|jjvrutj|jj vrN|j r|jd|jjj|jyyy)NT)r3) rwarn_unused_ignoresr UNUSED_IGNOREenabled_error_codesdisabled_error_codesrr6rlrsgenerate_unused_ignore_errorsrrs rugenerate_unused_ignore_notesz"State.generate_unused_ignore_notes1 s LL , ,""dll&F&FF!!)J)JJyy(((> LL   = =djj I KGrwc|jjjtjrE|jjj |j |jjyyrk) rlrsrrIGNORE_WITHOUT_CODE#generate_ignore_without_code_errorsrrr:rs ru"generate_ignore_without_code_notesz(State.generate_ignore_without_code_notes= sQ <<   4 4U5N5N O LL   C C DLL<<  PrwNrNFF)rrrrrrrlrxrrrrrrrrrrryrz)ryrrr)rrryrz)T)rrryzIterator[None])ryr)F)rrryrz)rrryrz)rrryrz)ryr)ryr)rrr[z list[Type]ryrz)rrryrz)ryr)r3rryrz)ryr)>r{r|r}r~rrrrrrrrr'rrrrrrrr,rfine_grained_deps_loadedr3rvpropertyrrrrrrr contextlibcontextmanagerrrrrrrrrrrrrrrrrrrr%rrrr6r-r.r?rCrrwrurere*s #$M=$ J GD*GZ JFJ"K"#'j'!D !D* D/ ! #'I&*)"&L,%KONCJ"!)-M%,$M3 .-&*%)!  l( l(l( l(  l( # l(l(#l(l(l( l(\#  $49>4 . ""><28[/4`DD=0B,)$L0 "1 &20h& .  (215f+Zc^ Jrwct||}t|tr|j} |s%|j dr |j r|t vrd} |rn~| dk(r|jd|d|dn`| dk(s| dk(rV||jvr|jd |d|d| dk(r%|rt||||tt|||||tt||r|sd} || fS|j} |jj} t|r"| r |j s|t"j$urd } |rt|r#| st'||st)|||||t|rt+d |d gt) aFind a module by name, respecting follow_imports and producing diagnostics. If the module is not found, then the ModuleNotFound exception is raised. Args: id: module to find options: the options for the module being loaded caller_state: the state of the importing module, if applicable caller_line: the line number of the import ancestor_for: the child module this is an ancestor of, if applicable root_source: whether this source was specified on the command line skip_diagnose: skip any error diagnosis and reporting (but ModuleNotFound is still raised if the module is missing) The specified value of follow_imports for a module can be overridden if the module is specified on the command line or if it is a stub, so we compute and return the "effective" follow_imports of the module. Returns a tuple containing (file path, target's effective follow_imports setting) .pyinormalrz Silencing rrskiprz Skipping Fzmypy: can't find module 'r)find_module_with_reasonr.rrr"follow_imports_for_stubsrcrr]skipping_ancestorskipping_modulerrr2rrO!ignore_missing_imports_per_modulerAAPPROVED_STUBS_NOT_INSTALLEDin_partial_packagemodule_not_foundr) rlrrrrrrrrrr2global_ignore_missing_importss rurrG s<%R 1F&# !// '88))%N   x ' KK*VHBrd!4 5 v %7)B000 ixr"Q78(%gr6<H! $G[,FS "7F 3K%N'' ")!?!? )0(N(N% 1" 5-==.KKK%* "  *.@W.M +|RP ";B4q ABC C rwc|D]]}||jjvrt||}|s+|jdk(r|j dr |j rXd|vs]yy)zFind if there are any newly added packages that were previously suppressed. Exclude everything not in build for follow-imports=skip. rLrJrATF)rsource_modulesrrr"rN)rrlrrrs rurr su  '$$33 3 !#w/   ! !V + f%)I)I  D  rwctj}|jj|d}|jtj|z dt |t ry|S)z>Find a filesystem path for module `id` or `None` if not found.TrXrdfind_module_timefind_module_callsN)rrhrjrr.rArrlrrs rurr sY B!!--bD-AA tyy{R'71M!)* Hrwctj}|jj|d}|jtj|z d|S)zGFind a filesystem path for module `id` or the reason it can't be found.FrXrdrY)rrhrjrr\s rurMrM sK B!!--bE-BA tyy{R'71M Hrwcd|vre|jdd\}}||jvr|j|}n t|dd|d}|j}| |j S|}d|vrey#tt f$rd}Y)wxYw)zCheck if a missing module can potentially be a part of a package. This checks if there is any existing parent __init__.pyi stub that defines a module-level __getattr__ (a.k.a. partial stub package). rrdNT)rrrrlrF)r!rnrerrris_partial_stub_package)rrlrr parent_mod parent_sts rurSrS s )IIc1%  W__ $*1//&*AJ ,!DwRV '^^  !55 5 # )$ #L1 "!  "sA++A?>A?c |j}|j}|j|j|j|j|j |j |dk(r'|j|ddd|jn.|j j}|j|\}} |tjk(rtj} nG|tjk(s|tj k(rtj"} ntj$} |j|d|j'|| t)|} | D]3} d| vr| J| j'| } |j|d| d d| 5|tj ur| J|j*j-| |j|y) Nr]rz7Cannot find 'builtins' module. Typeshed appears broken!Tr)r9)codez {stub_dist}) stub_distnote)severity only_oncerc)rsrrrrrrrrrerror_message_templatesrA NOT_FOUNDrIMPORT_NOT_FOUNDFOUND_WITHOUT_TYPE_HINTSrRIMPORT_UNTYPEDIMPORTr+rPrr) rlrrr$reasonrsrdaemonmsgnotesrcdistres rurTrT s^^F //1 l99: OOL&& 9M9MN  !NX\   9933F; U )33 3))D *CC C-JJJ''D<Q NN  K  NN%%&9:rwc8|jjg|jj|j|j|j |jj ddd|ddd|jj dddddy ) zFProduce an error for an ancestor ignored due to --follow_imports=errorrzAncestor package "rtrTrvz@(Using --follow-imports=error, submodule passed on command line)reN)rsrrrrrr)rlrrrs rurOrO, s  NN%%b) NNL.. Q NN B$RD 2WPT NN  J rwc |jj}|rtjj |}|j dt fd|xsdfd|jjxsdfdtjfd|jjfdttjd  fd |jjfg}|D]\}}|j |d zd | |D]}|j d d ||jj!j#D]K\}}|s|j%d||j%|d |D]} |j%d| My)z8Output useful configuration information to LOG and TRACEz Mypy Versionz Config FileDefaultzConfigured ExecutablerzzCurrent Executablez Cache DirCompiledrExcluderrzz Found source:zNo z N)rrrrrrrVpython_executablerZ executablerrrr"excluderasdictr~r) rlrrconfiguration_vars conf_name conf_valuer path_typepathspths rulog_configurationr@ s//--Kggook2  KKM % 1 3 '//"C"C"MvN s~~. goo//0 SX..u5567 GOO++,"49 : y3r*:,7895 r*6(345$00779??A( 5 MMC {+ ,   1o& (C MMD, ' ((rwcpt||tj}t||}|jr>t |dt |zkr$|j dd|_t||}tj}|jt |td|jD||z t |jj|std||S|j dt |d ||z d d |jjrt|||S|jjs|jrtj}t!||}|jtj|z |||_no|j$j'd ddkDrP|j$j)|j dd|_|j dt+|||S|jst-||t/||j0|_|jjs|jj4rNt7j8|j:|jj4st=||}t?||||jj@rCddl!m"} | |jF|jH|jjJ|j|S)Ng?z=Redoing load_graph without cache because too much was missingFc3rK|]/}|jduxr|jjd1yw)NrJ)rr")rgs rurzdispatch..{ s._1d*Fqvvv/FF_s57) graph_size stubs_foundgraph_load_time fm_cache_sizezNothing to do?!rzLoaded graph with z nodes (z.3fz sec)rrTrzDError reading fine-grained dependencies cache -- aborting cache loadz.Falling back to full run -- reloading graph...)dump_all_dependencies)&rr load_graphrgrrrqrsumrrhrSr-r dump_graphrCr#r^rZrclearr process_graphr rrrrrSadd_all_protocol_depsr_rr dump_depsrrrnrpr3) rrlrrrmr0r[r^rrs rurrg sgw' B w (E%%'CJG 9L,L ST %7G, B u:_PUP\P\P^__b'33;;<   f-  KK$SZLb UKL!!5&! ))W-K-K-M YY[&w6 DIIK",<=  ##/G ]]  }a 01 4 MM   ! KK^ _$)G ! KKH IGWf5 5  ) ) +eW%w''.'?'?$ ?? - -1Y1Y  , ,W__ =??;;/? 7  : OOW..0N0NPWP_P_  Lrwc eZdZdZddZddZy)NodeInfoz,Some info about a node in the graph of SCCs.cBd|z|_||_i|_i|_y)Nzn%d)node_idsccsizesr)rtindexrs rurvzNodeInfo.__init__ s"u} %' $& rwc t|jj}djt j |j t j |t j |jt j |jt j |jS)zConvert to JSON string.z[{}, {}, {}, {}, {}]) rrrr+r.dumpsrrr)rt total_sizes rurzNodeInfo.dumps sx**,- 188 JJt|| $ JJz " JJtxx JJtzz " JJtyy !   rwN)rrrrryrzryr)r{r|r}r~rvrrrwrurr s6'  rwrct|d5}t|D]&}|j|d||jd( dddy#1swYyxYw)z3Dump timing stats for each file in the given graph.wrKrN)rCr|rr3)rrmrDrs rurr sY dC9A- 9B GGrd!E"I334B7 8 9999s 5A  Ac Ft|d5}t|D]q}||js|j|dt||jD]0}||j|}|j|dd|dz dd2s dddy#1swYyxYw) z-Dump per-line expression type checking stats.rz: z>5rKiz8.1frN)rCr|rr)rrmrDrr line_times rurr s dC>A- >B966 GGrd#J uRyBBC >!"I??E 4)1Yt^D$9<= >  >>>>s BBB c:|xstj}g}t|}t|D].\}}t ||}t ||}|j |0i}|D]"}|jD]} |j|| <$|D]}|jD]} || } d} | jr* tjj| j} | |j| <| jD]j} | | jvs| j| } | |vs&|| }||jk7s;||j vs| |j |ks\| |j |<lt#ddj%d|Dzdz|y#t$rYwxYw)zDump the graph as a JSON string to stdout. This copies some of the work by process_graph() (sorted_components() and order_ascc()). rrIz, c3<K|]}|jywrk)r)rr s rurzdump_graph.. s;TDJJL;sz ]rN)rZrsorted_componentsrK order_asccrr1rrrrgetsizerOrrrrr-r#)rmrnodessccsrTasccrr  inv_nodesmodr4rrrdep_ids rurr s  !szzF E U #DT?4%3 TI*88 *C!\\IcN **488 4C#JEDzz77??5::6D#DJJsO)) 4%*****3/Ci'!*3!T\\1"$))3sTYYv=N7N03DIIf- 4 44& # ;U;; ;e C&Qs/)F FFc < ||ni}||ng}t}|D]`} t|j|j|j||j }|j|vr|jj|j|j|j|jjddd|jd||jjdd|jjddd d |jjddd d |jj|||j<|j||j|jc|j!Dcic]}|js|j"|} }|D]r}|j$J|j&D cgc]'} |j(j+| t,k7s&| )} } |j/s'|j0D cgc]} t3| |s| } } ng} |j$| z|j0zD]} | |j4vxr| |v} | r!| | vr|j6j| nk| |vrf | |j$vrt| dd|| }n+t| dd|||j8j+| d}|jrt:jj#|j}|| vr|jjdddj=| |j|jd|jjddd d |jjdddd |jj|| |<|j|vsJ|j|||j<|j|| |vs| |j4vs|jC| u|jDjG|jH|S#t $rYDwxYwcc}wcc} wcc} w#t $r"| |j>vr|jA| YwxYw)aGiven some source files, load the full dependency graph. If an old_graph is passed in, it is used as the starting point and modified during graph loading. If a new_modules is passed in, any modules that are loaded are added to the list. This is an argument and not a return value so that the caller can access it even if load_graph fails. As this may need to parse files, this can raise CompileError in case there are syntax errors. N)rrrrlrrzDuplicate module named "z " (also at "z")TrzgSee https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules for more inforeruzCommon resolutions include: a) using `--exclude` to avoid checking one of them, b) adding `__init__.py` somewhere, c) using `--explicit-package-bases` or adjusting MYPYPATH)rrrrlrrd)rrrrlrrrzCSource file found twice under different module names: "{}" and "{}"zxCommon resolutions include: a) adding `__init__.py` somewhere, b) using `--explicit-package-bases` or adjusting MYPYPATH)%r\rer9rrvfollowedrrrsrrrrrr1rrrrrrrrrgrrrr]rrr+rrrr set_modulesrn)rrl old_graph new_modulesrmnew entry_pointsbsr seen_filesrraddedignorednewst newst_paths rurr sq&!* 592E %0+bC UL&$ 99WWww " O B 55E> NN # #BHHbeeW__ E NN ! !*255'eBEEl>P>P=QQST "  NN ! !  "  NN ! !% "  NN & & (bee  2#M&$T,1<<>ERRWW"**b.EJET'||'''(*a"--:K:KC:PT`:`a a--/ %'MMVS5GW5USVEV E<<,.>; 'CR...J3l3JG3e+''++C0E!3&bll*!&"dGZ\!!&"!%#'$+)+(*(;(;C(C !zz%'WW__UZZ%@ %3#NN11 " !!006z*7M7P7PRWRZRZ0[(, 2$NN11 " !!0)/ 2$NN11 " !!\)/ 2$NN66816 :. 8850:%((:0&+E%((OJJu%e|r'8'8 8!!#&w; '3T'j NNw/ Lw   BF"b W6&4b111..s34sH9QQ!!Q!'Q&<Q& Q+2Q+A Q0 QQ0(RRc x t}|jdt|td|Dfzg}|D]t }dvr/t |d}|j d|jd|jjdk\rD|D]?|jddd jfd jDA|Dchc]}|jr|}}| }t}|D] |jj"|z}|Dchc]}|vs|j!r|} }|xr| }t} |r<|D] | jj""| j%z} | rd }|rt'fd |D} | Dchc]}|j(|} }| sdntfd| D} |jjdk\rt | zfd}|D]w|vr"j*j,| krd}n$d}n!j*j,| kDrd}nd}|jd|j*j,fzy| | kr d }d| | z dd}nd}n| rdd jt | d}nl|rLd}|k7r!|dd jt |dz }| r@|d d jt | dz }nd!d jt | d}t/fd"|Dr|D] d_d j|}|r+|jd#|d$|d|j|l|r-|jd%t|d&|jj2sRt5j6d'k(r;|j8t:kr(t=j>t=j@|D]}tC|||jj2s{t5j6d'k(rd|j8t:krQ|xj8d(z c_t=jDt=jFt=jHg}t|}|d(k(r|jd)|d*|n|jd+|||fztK||t|}tMd,|D}|jO||-|r<|jd.jQ|||jtS|y |jd/y cc}wcc}wcc}w)0z'Process everything in dependency order.z#Found %d SCCs; largest has %d nodesc32K|]}t|ywrkrrrs rurz process_graph.. sGaUXCGar]T)reverserzPriorities for rrKc3vK|]0}|vr*|jvrd|j|fz2yw)z%s:%dN)r)rrrrmrs rurz process_graph.. sJ9eBi.B.B)B 1eBi&:&:1&=">>s69Fc3PK|]}|jjywrkrrrrrms rurz process_graph.. sIrb  : :I#&Nrc3PK|]}|jjywrkrrrrms rurz process_graph.. s!(Ws)9)9)D)D(Wrc6|jjSrkrrrms rurzprocess_graph.. suRy?Y?Yrwrz*id:zid:z+dep:zdep:z %5s %.0f %szout of date by z.0fz secondsfreshz"stale due to changed suppression (rzinherently stalerz with stale deps (zstale due to deps (c3FK|]}|vs|jywrk)r,rs rurz process_graph.. s!KscUluSz**Ks !!zQueuing z SCC (z Processing z queued fresh SCCsrrdzProcessing SCC singleton (z) as z$Processing SCC of size %d (%s) as %sc32K|]}t|ywrkrrs rurz process_graph..H s9#SX9r) sccs_left nodes_leftzD{} fresh SCCs ({} nodes) left in queue (and will remain unprocessed)zNo fresh SCCs left in queue)*rrrrrr|r{r1rrrr#rrr\rrrrrrrrrr,test_envrrrwMAX_GC_FREEZE_CYCLESrcollectdisableprocess_fresh_modulesfreezeunfreezeenableprocess_stale_sccrrr+r)rmrlrfresh_scc_queuerr stale_sccrr stale_depsundeps oldest_in_sccviablenewest_in_depsall_idsr fresh_msgscc_strprev_sccrrrrs` ` @rurr s U #D KK5TCGa\`GaDa8bbc')O Q3%  d+C JJz " JJz " ?? $ $ )  %bT+HH!&r!7!7 #&BBU2Y-?-?-ARB B u 0B KKb .. / 0  #'^R2;uRy?[?[?]b^ ^(j.  4 eBi223 4 ejjl "F  ISIIM#-LRr1KbLFLS(WPV(W%W ((A- 4YZ! ZBSy 9??55F"(C"'C 9??55 E")C"(CMM.Cr9S9SUW3X"XY Z~--n}.LS-QQYZ # a@@ 1#((6*;M2N1OqQQ -chhvj7I.J-K1MI KdK K 2-1b * 2((3-  MMHYKvgYa@ A  " "3 ' k#o*>)??QRS  00 668IE003GGJJLJJL /DH)%7CD 00 668IE003GG,,1,IIKKKMIIK"$s8Dqy 8 ykRS BdGU^E__` eS' 2cQ3fO$I999J  jA R Y Y:   c/*+ 12CC _ Ms*&V-?V- V2 V2V2V7#V7c t|dk(r t|St}|D]T}|}|jD]>}||vs|jj |t }||ks.|j|@Vt|dk(rt|fdSt|}t||}|D cgc]} t| |D]} | c} } Scc} } w)a$Come up with the ideal processing order within an SCC. Using the priorities assigned by all_imported_modules_in_file(), try to reduce the cycle to a DAG, by omitting arcs representing dependencies of lower priority. In the simplest case, if we have A <--> B where A has a top-level "import B" (medium priority) but B only has the reverse "import A" inside a function (low priority), we turn the cycle into a DAG by dropping the B --> A arc, which leaves only A --> B. If all arcs have the same priority, we fall back to sorting by reverse global order (the order in which modules were first encountered). The algorithm is recursive, as follows: when as arcs of different priorities are present, drop all arcs of the lowest priority, identify SCCs in the resulting graph, and apply the algorithm to each SCC thus found. The recursion is bounded because at each recursion the spread in priorities is (at least) one less. In practice there are only a few priority levels (less than a dozen) and in the worst case we just carry out the same algorithm for finding SCCs N times. Thus the complexity is no worse than the complexity of the original SCC-finding algorithm -- see strongly_connected_components() below for a reference. rdc$|j Srkrrs rurzorder_ascc..} sE"IOO+;rwr) rrr\rrrrrr|rrr) rmrpri_max pri_spreadrr4rrrssss ` rurrU s8 4yA~DzJ(b %% (Cd{&&**39=NN3'  (( :!d ;<<*oG UD' 2D E"jG&D EA EA EE Es9Cctj}|D]}||jtj}|D]}||jtj}|j||z ||z y)zProcess the modules in one group of modules from their cached data. This can be used to process an SCC of modules This involves loading the tree from JSON and then doing various cleanups. )process_fresh_timeload_tree_timeN)rrrr)rmrnrlrrr0r[s rurr s~ B b  B# b   "# B bbIrwc|}|D]}|jd|vrdj}|sJdtjj |j t |}|D]j}|j|jjr4|j||j|jl|rZ|D]R}||vr|jr|j||j|jT|rZ|D](}|j|j*t!fd|Dr|D] }d|_|D]}|j$j j&vrmj j)|j$j*}j-j j/|j$|d|j1|j3y)zProcess the modules in one SCC from source code. Exception: If quick_and_dirty is set, use the cache for fresh modules. r\z The typing module was not parsedc3nK|],}jj|j.ywrk)rsis_errors_for_filer)rrrmrls rurz$process_stale_scc.. s( N"7>> , ,U2Y__ = Ns25T) formatterFN)rrr  semanal_mainsemantic_analysis_for_sccrsr\rrdeferred_nodesdiscardrrrr?rCrr,rr file_messagesrr simplify_pathrr)rmrrlstaler typing_modunfinished_modulesrss` ` rurr s? E b 38_)) ===z//sGNNKU& b '')Ry%%'66  & &r * "I 4 4 6 "I # # % &  *B++9335"**2.b 88:b '')  * 7 b ..0 b 4467 N NN .B)-E"I & .& 9??'..">"> >^^11b 7+B+B2F  !=!=eBioo!NPVX] ^ b  b ##%&rwc | t}|Dcic]}|t|||}}tt||}g}t t ||D]!}|j t|fd#|Scc}w)a9Return the graph's SCCs, topologically sorted by dependencies. The sort order is from leaves (nodes without dependencies) to roots (nodes on which no other nodes depend). This works for a subset of the full dependency graph too; dependencies that aren't present in graph.keys() are ignored. c.tfd|D S)Nc3<K|]}|jywrkrrs rurz6sorted_components.... s5T"eBioo5Ts)r)rrms rurz#sorted_components.. s#5TPS5T2T1Trwr)r\ deps_filteredrrrrrr|)rmverticesrredgesrrreadys` rurr su:GO PRuhG< < PE P -h> ?D CdE23 W 6%%TUV W J QsA=c||vrgS||}|jDcgc]+}||vr%|jj|t|kr|-c}Scc}w)z.Filter dependencies for id with pri < pri_max.)rrrr)rmrrrr4rs rurr sa  "IE%%   (?u//33CBWL   s0A cBtjj|dS)N missing_stubs)rrr#r+s rumissing_stubs_filer s 77<< ? 33rwct|}|r;t|d5}t|D]}|j|d dddytj j |rt j|yy#1swYyxYw)zWrite a file containing missing stub packages. This allows a subsequent "mypy --install-types" run (without other arguments) to install missing stub packages. rrN)rrCr|rrrr$r{)rrr7rDpkgs rurr s i (D $_ $34 $3%r # $ $ $ 77>>$  IIdO  $ $s %A??Bc|jjrytfd|jjDrytfd|jj DS)NFc36K|]}t|ywrkr.rdirrs rurz*is_silent_import_module.. s Wc tS ) WTc36K|]}t|ywrkr r s rurz*is_silent_import_module.. s\#"4-\r)rno_silence_site_packagesrr package_path typeshed_path)rlrs `rurrsM// WW5I5I5V5V WW \9M9M9[9[\ \\rwcBddlm}|jsyt|j|j |\}}}dj |jddddz}|jdrJ||j|}|j|t|y)Nr)get_undocumented_ref_info_jsonrz .refs.json) mypy.refinforrrrrr#rrMrrT) r4rrrrr data_file ref_info_filers rurrs< ::%ehh WEOAy!HHY__S1#267,FM'',, ,.uzz8DI OOM:i#89rw)NNNNNN)rlist[BuildSource]rrFrrrz4Callable[[str | None, list[str], bool], None] | NonerFileSystemCache | Noner TextIO | NonerrrzSequence[Plugin] | Noneryri)rrrrFrrrrrrrrrrrSequence[Plugin]ryrir)rrrrFryr)rzdict[str, Any]rrryr)rr!r rryr)rrFrsrrrryz#tuple[list[Plugin], dict[str, str]]) rrFrsrrrrrryztuple[Plugin, dict[str, str]])r9ztypes.ModuleTyperyr)rrrPrrQrryr)rrryr)rdict[str, dict[str, set[str]]]rlrxrmrgryrz)rrrmrgryr)rlrxrmrgryr)rlrxryrz)rlrxryzdict[str, str] | None)rrFrrryz(dict[str, tuple[float, int, str]] | None)rlrxrmrgryzdict[str, FgDepMeta] | None)rrrlrxr rryz bytes | None) rrrlrxr rr rryzdict[str, Any] | None)rrFryr)r9rryrz)rrFryr<)rrrrrrFryztuple[str, str, str | None])rrrrrlrxryr) rrrrrrrrrlrxryr)rvrryr)rrrrrr#rrrrrrrrr|rrrrrrlrxryztuple[str, CacheMeta | None])rrrrrlrxryrzrD)rlrxrrrrFrrrrrrrrrrryztuple[str, str])rrrlrxrrFryr)rrrlrxryr)rrrlrxryrB)rrrlrxryr) rlrxrrrrer$rrnrAryrz) rlrxrrrrrrrrryrz) rlrxrrrrrreryrz)rlrxrrryrz)rrrlrxrrryrg)rrrmrgryrzrk)rmrgrrryrz)NN) rrrlrxrz Graph | Nonerzlist[State] | Noneryrg)rmrgrlrxryrz)rmrgrAbstractSet[str]rrryr)rmrgrnrrlrxryrz)rmrgrrrlrxryrz)rmrgrzAbstractSet[str] | Nonerrryzlist[AbstractSet[str]]) rmrgrrrrrrryr)rrryr)rrrrryrz)rlrxrrryr) r4rerr<rrFrrryrz)r~ __future__rr_rGrrr.rrr&rerZrr[collections.abcrrrr AbstractSetr\rr r r r r rrrrbrrfmypy.semanal_mainr  mypy.cacher mypy.checkerrmypy.error_formatterrr mypy.errorsrrrrmypy.graph_utilsrrrmypy.indirectionr mypy.messagesr mypy.nodesrr r!r"r#r$r%mypy.partially_definedr& mypy.semanalr'mypy.semanal_pass1r( mypy.utilr)r*r+r,r-r.r/r0r1r2r3rr5r6rmypy.config_parserr7 mypy.fixupr8 mypy.freetreer9 mypy.fscacher:mypy.metastorer;r<r=mypy.modulefinderr>r?r@rArBrCrDrE mypy.optionsrF mypy.parserG mypy.pluginrHrIrJmypy.plugins.defaultrK mypy.renamingrLrM mypy.statsrN mypy.stubinforOrP mypy.typesrQmypy.typestaterRrSrTrU mypy.versionrVrWrrcrrorrgrirrrrrrrrrrrrrr r<rr2rrxrrrrrrrrr rqrsr#r(rrrrrlrr^rsrwrrr)rrerrrrMrSrTrPrOrrrrrrrrrrrrrrrrrrrwrur@s #  KK   6$?NNQQ3(aaaC):    #$2##(VV" BB.M&W9,$ "E! e g&z&$$. $IM&*  -1< < <<G < $ <  < <+<<~X[ X[ X[X[@ X[ $ X[  X[ X[$X[X[v% % 4  >%% e Y$ Y$$Y$.4Y$(Y$xO O$O.4OEUO"O,  .ggT : *)))"%!?c )?c4@?cIN?c ?cD487e6T   $-(*Z   $ 36 CF  F   $%DP] @J J #J+5JCGJR^JJZ-IA IA IA IA IA  IA  IAIAIAIAIAIA"IAXS,FRHYHW W B"&!%`! `! `!`! `!  `!  `!`!`!`!F0  6'3 '3 '3'3  '3 ! '3  '3T; ;!$;4@;FI;QT; ;&(!(NOd  *9 >$RT#&* _ _ __$ _  _Dh3VEL,F^ J 1&j7;7 3EH> 4  ]: :*:5<:H^: :rw