@@ -280,7 +280,6 @@ def normpath(path: str, options: Options) -> str:
280
280
('data_mtime' , int ), # mtime of data_json
281
281
('data_json' , str ), # path of <id>.data.json
282
282
('suppressed' , List [str ]), # dependencies that weren't imported
283
- ('child_modules' , List [str ]), # all submodules of the given module
284
283
('options' , Optional [Dict [str , object ]]), # build options
285
284
# dep_prios and dep_lines are in parallel with
286
285
# dependencies + suppressed.
@@ -317,7 +316,6 @@ def cache_meta_from_dict(meta: Dict[str, Any], data_json: str) -> CacheMeta:
317
316
int (meta ['data_mtime' ]) if 'data_mtime' in meta else sentinel ,
318
317
data_json ,
319
318
meta .get ('suppressed' , []),
320
- meta .get ('child_modules' , []),
321
319
meta .get ('options' ),
322
320
meta .get ('dep_prios' , []),
323
321
meta .get ('dep_lines' , []),
@@ -1320,7 +1318,6 @@ def validate_meta(meta: Optional[CacheMeta], id: str, path: Optional[str],
1320
1318
'data_mtime' : meta .data_mtime ,
1321
1319
'dependencies' : meta .dependencies ,
1322
1320
'suppressed' : meta .suppressed ,
1323
- 'child_modules' : meta .child_modules ,
1324
1321
'options' : (manager .options .clone_for_module (id )
1325
1322
.select_options_affecting_cache ()),
1326
1323
'dep_prios' : meta .dep_prios ,
@@ -1364,7 +1361,7 @@ def json_dumps(obj: Any, debug_cache: bool) -> str:
1364
1361
1365
1362
def write_cache (id : str , path : str , tree : MypyFile ,
1366
1363
dependencies : List [str ], suppressed : List [str ],
1367
- child_modules : List [ str ], dep_prios : List [int ], dep_lines : List [int ],
1364
+ dep_prios : List [int ], dep_lines : List [int ],
1368
1365
old_interface_hash : str , source_hash : str ,
1369
1366
ignore_all : bool , manager : BuildManager ) -> Tuple [str , Optional [CacheMeta ]]:
1370
1367
"""Write cache files for a module.
@@ -1379,7 +1376,6 @@ def write_cache(id: str, path: str, tree: MypyFile,
1379
1376
tree: the fully checked module data
1380
1377
dependencies: module IDs on which this module depends
1381
1378
suppressed: module IDs which were suppressed as dependencies
1382
- child_modules: module IDs which are this package's direct submodules
1383
1379
dep_prios: priorities (parallel array to dependencies)
1384
1380
dep_lines: import line locations (parallel array to dependencies)
1385
1381
old_interface_hash: the hash from the previous version of the data cache file
@@ -1469,7 +1465,6 @@ def write_cache(id: str, path: str, tree: MypyFile,
1469
1465
'data_mtime' : data_mtime ,
1470
1466
'dependencies' : dependencies ,
1471
1467
'suppressed' : suppressed ,
1472
- 'child_modules' : child_modules ,
1473
1468
'options' : options .select_options_affecting_cache (),
1474
1469
'dep_prios' : dep_prios ,
1475
1470
'dep_lines' : dep_lines ,
@@ -1688,9 +1683,6 @@ class State:
1688
1683
# Parent package, its parent, etc.
1689
1684
ancestors = None # type: Optional[List[str]]
1690
1685
1691
- # A list of all direct submodules of a given module
1692
- child_modules = None # type: Set[str]
1693
-
1694
1686
# List of (path, line number) tuples giving context for import
1695
1687
import_context = None # type: List[Tuple[str, int]]
1696
1688
@@ -1797,7 +1789,6 @@ def __init__(self,
1797
1789
assert len (all_deps ) == len (self .meta .dep_lines )
1798
1790
self .dep_line_map = {id : line
1799
1791
for id , line in zip (all_deps , self .meta .dep_lines )}
1800
- self .child_modules = set (self .meta .child_modules )
1801
1792
if temporary :
1802
1793
self .load_tree (temporary = True )
1803
1794
if not manager .use_fine_grained_cache ():
@@ -1824,7 +1815,6 @@ def __init__(self,
1824
1815
# Parse the file (and then some) to get the dependencies.
1825
1816
self .parse_file ()
1826
1817
self .compute_dependencies ()
1827
- self .child_modules = set ()
1828
1818
1829
1819
@property
1830
1820
def xmeta (self ) -> CacheMeta :
@@ -1855,8 +1845,7 @@ def is_fresh(self) -> bool:
1855
1845
# dependency is added back we find out later in the process.
1856
1846
return (self .meta is not None
1857
1847
and self .is_interface_fresh ()
1858
- and self .dependencies == self .meta .dependencies
1859
- and self .child_modules == set (self .meta .child_modules ))
1848
+ and self .dependencies == self .meta .dependencies )
1860
1849
1861
1850
def is_interface_fresh (self ) -> bool :
1862
1851
return self .externally_same
@@ -2241,7 +2230,7 @@ def write_cache(self) -> None:
2241
2230
"Duplicates in dependencies list for {} ({})" .format (self .id , self .dependencies ))
2242
2231
new_interface_hash , self .meta = write_cache (
2243
2232
self .id , self .path , self .tree ,
2244
- list (self .dependencies ), list (self .suppressed ), list ( self . child_modules ),
2233
+ list (self .dependencies ), list (self .suppressed ),
2245
2234
dep_prios , dep_lines , self .interface_hash , self .source_hash , self .ignore_all ,
2246
2235
self .manager )
2247
2236
if new_interface_hash == self .interface_hash :
@@ -2795,8 +2784,6 @@ def load_graph(sources: List[BuildSource], manager: BuildManager,
2795
2784
assert newst .id not in graph , newst .id
2796
2785
graph [newst .id ] = newst
2797
2786
new .append (newst )
2798
- if dep in st .ancestors and dep in graph :
2799
- graph [dep ].child_modules .add (st .id )
2800
2787
if dep in graph and dep in st .suppressed_set :
2801
2788
# Previously suppressed file is now visible
2802
2789
st .add_dependency (dep )
0 commit comments