@@ -1246,15 +1246,15 @@ def remove_blacklisted_modules(modules: list[StubSource]) -> list[StubSource]:
1246
1246
]
1247
1247
1248
1248
1249
- def split_pyi_from_py (modules : list [StubSource ]) -> tuple [list [StubSource ], list [StubSource ]]:
1249
+ def split_pyc_from_py (modules : list [StubSource ]) -> tuple [list [StubSource ], list [StubSource ]]:
1250
1250
py_modules = []
1251
- pyi_modules = []
1251
+ pyc_modules = []
1252
1252
for mod in modules :
1253
1253
if is_pyc_only (mod .path ):
1254
- pyi_modules .append (mod )
1254
+ pyc_modules .append (mod )
1255
1255
else :
1256
1256
py_modules .append (mod )
1257
- return pyi_modules , py_modules
1257
+ return pyc_modules , py_modules
1258
1258
1259
1259
1260
1260
def is_blacklisted_path (path : str ) -> bool :
@@ -1272,7 +1272,7 @@ def collect_build_targets(
1272
1272
) -> tuple [list [StubSource ], list [StubSource ], list [StubSource ]]:
1273
1273
"""Collect files for which we need to generate stubs.
1274
1274
1275
- Return list of Python modules and C modules.
1275
+ Return list of py modules, pyc modules, and C modules.
1276
1276
"""
1277
1277
if options .packages or options .modules :
1278
1278
if options .no_import :
@@ -1295,8 +1295,8 @@ def collect_build_targets(
1295
1295
c_modules = []
1296
1296
1297
1297
py_modules = remove_blacklisted_modules (py_modules )
1298
- pyi_mod , py_mod = split_pyi_from_py (py_modules )
1299
- return py_mod , pyi_mod , c_modules
1298
+ pyc_mod , py_mod = split_pyc_from_py (py_modules )
1299
+ return py_mod , pyc_mod , c_modules
1300
1300
1301
1301
1302
1302
def find_module_paths_using_imports (
@@ -1524,13 +1524,13 @@ def generate_stub_for_py_module(
1524
1524
def generate_stubs (options : Options ) -> None :
1525
1525
"""Main entry point for the program."""
1526
1526
mypy_opts = mypy_options (options )
1527
- py_modules , pyi_modules , c_modules = collect_build_targets (options , mypy_opts )
1528
- all_modules = py_modules + pyi_modules + c_modules
1527
+ py_modules , pyc_modules , c_modules = collect_build_targets (options , mypy_opts )
1528
+ all_modules = py_modules + pyc_modules + c_modules
1529
1529
all_module_names = sorted (m .module for m in all_modules )
1530
1530
# Use parsed sources to generate stubs for Python modules.
1531
1531
generate_asts_for_modules (py_modules , options .parse_only , mypy_opts , options .verbose )
1532
1532
files = []
1533
- for mod in py_modules + pyi_modules :
1533
+ for mod in py_modules + pyc_modules :
1534
1534
assert mod .path is not None , "Not found module was not skipped"
1535
1535
target = mod .module .replace ("." , "/" )
1536
1536
if os .path .basename (mod .path ) in ["__init__.py" , "__init__.pyc" ]:
@@ -1544,7 +1544,7 @@ def generate_stubs(options: Options) -> None:
1544
1544
mod ,
1545
1545
target ,
1546
1546
options .parse_only ,
1547
- options .inspect or mod in pyi_modules ,
1547
+ options .inspect or mod in pyc_modules ,
1548
1548
options .include_private ,
1549
1549
options .export_less ,
1550
1550
doc_dir = options .doc_dir ,
0 commit comments