@@ -1546,7 +1546,7 @@ def write_cache(
1546
1546
source_hash : str ,
1547
1547
ignore_all : bool ,
1548
1548
manager : BuildManager ,
1549
- ) -> tuple [str , tuple [dict [str , Any ], str , str ] | None ]:
1549
+ ) -> tuple [str , tuple [dict [str , Any ], str ] | None ]:
1550
1550
"""Write cache files for a module.
1551
1551
1552
1552
Note that this mypy's behavior is still correct when any given
@@ -1568,7 +1568,7 @@ def write_cache(
1568
1568
1569
1569
Returns:
1570
1570
A tuple containing the interface hash and inner tuple with cache meta JSON
1571
- that should be written and paths to cache files (inner tuple may be None,
1571
+ that should be written and path to cache file (inner tuple may be None,
1572
1572
if the cache data could not be written).
1573
1573
"""
1574
1574
metastore = manager .metastore
@@ -1662,12 +1662,10 @@ def write_cache(
1662
1662
"ignore_all" : ignore_all ,
1663
1663
"plugin_data" : plugin_data ,
1664
1664
}
1665
- return interface_hash , (meta , meta_json , data_json )
1665
+ return interface_hash , (meta , meta_json )
1666
1666
1667
1667
1668
- def write_cache_meta (
1669
- meta : dict [str , Any ], manager : BuildManager , meta_json : str , data_json : str
1670
- ) -> CacheMeta :
1668
+ def write_cache_meta (meta : dict [str , Any ], manager : BuildManager , meta_json : str ) -> None :
1671
1669
# Write meta cache file
1672
1670
metastore = manager .metastore
1673
1671
meta_str = json_dumps (meta , manager .options .debug_cache )
@@ -1677,8 +1675,6 @@ def write_cache_meta(
1677
1675
# The next run will simply find the cache entry out of date.
1678
1676
manager .log (f"Error writing meta JSON file { meta_json } " )
1679
1677
1680
- return cache_meta_from_dict (meta , data_json )
1681
-
1682
1678
1683
1679
"""Dependency manager.
1684
1680
@@ -1864,9 +1860,6 @@ class State:
1864
1860
# List of (path, line number) tuples giving context for import
1865
1861
import_context : list [tuple [str , int ]]
1866
1862
1867
- # The State from which this module was imported, if any
1868
- caller_state : State | None = None
1869
-
1870
1863
# If caller_state is set, the line number in the caller where the import occurred
1871
1864
caller_line = 0
1872
1865
@@ -1917,7 +1910,6 @@ def __init__(
1917
1910
self .manager = manager
1918
1911
State .order_counter += 1
1919
1912
self .order = State .order_counter
1920
- self .caller_state = caller_state
1921
1913
self .caller_line = caller_line
1922
1914
if caller_state :
1923
1915
self .import_context = caller_state .import_context .copy ()
@@ -2008,11 +2000,6 @@ def __init__(
2008
2000
self .parse_file (temporary = temporary )
2009
2001
self .compute_dependencies ()
2010
2002
2011
- @property
2012
- def xmeta (self ) -> CacheMeta :
2013
- assert self .meta , "missing meta on allegedly fresh module"
2014
- return self .meta
2015
-
2016
2003
def add_ancestors (self ) -> None :
2017
2004
if self .path is not None :
2018
2005
_ , name = os .path .split (self .path )
@@ -2479,7 +2466,7 @@ def valid_references(self) -> set[str]:
2479
2466
2480
2467
return valid_refs
2481
2468
2482
- def write_cache (self ) -> tuple [dict [str , Any ], str , str ] | None :
2469
+ def write_cache (self ) -> tuple [dict [str , Any ], str ] | None :
2483
2470
assert self .tree is not None , "Internal error: method must be called on parsed file only"
2484
2471
# We don't support writing cache files in fine-grained incremental mode.
2485
2472
if (
@@ -3477,18 +3464,17 @@ def process_stale_scc(graph: Graph, scc: list[str], manager: BuildManager) -> No
3477
3464
for id in stale :
3478
3465
meta_tuple = meta_tuples [id ]
3479
3466
if meta_tuple is None :
3480
- graph [id ].meta = None
3481
3467
continue
3482
- meta , meta_json , data_json = meta_tuple
3468
+ meta , meta_json = meta_tuple
3483
3469
meta ["dep_hashes" ] = {
3484
3470
dep : graph [dep ].interface_hash for dep in graph [id ].dependencies if dep in graph
3485
3471
}
3486
3472
meta ["error_lines" ] = errors_by_id .get (id , [])
3487
- graph [ id ]. meta = write_cache_meta (meta , manager , meta_json , data_json )
3473
+ write_cache_meta (meta , manager , meta_json )
3488
3474
3489
3475
3490
3476
def sorted_components (
3491
- graph : Graph , vertices : AbstractSet [str ] | None = None , pri_max : int = PRI_ALL
3477
+ graph : Graph , vertices : AbstractSet [str ] | None = None , pri_max : int = PRI_INDIRECT
3492
3478
) -> list [AbstractSet [str ]]:
3493
3479
"""Return the graph's SCCs, topologically sorted by dependencies.
3494
3480
0 commit comments