77
88import joblib # type: ignore
99
10- from .ports .filesystem import BasicFileSystem
1110from ..application .ports import caching
1211from ..application .ports .filesystem import AbstractFileSystem
1312from ..application .ports .graph import ImportGraph
@@ -60,7 +59,6 @@ def build_graph(
6059 "mypackage", "anotherpackage", "onemore", include_external_packages=True,
6160 )
6261 """
63-
6462 file_system : AbstractFileSystem = settings .FILE_SYSTEM
6563
6664 found_packages = _find_packages (
@@ -265,7 +263,9 @@ def _scan_chunk(
265263 import_scanner : AbstractImportScanner = settings .IMPORT_SCANNER_CLASS (
266264 file_system = basic_file_system ,
267265 found_packages = found_packages ,
268- include_external_packages = include_external_packages ,
266+ # Ensure that the passed exclude_type_checking_imports is definitely a boolean,
267+ # otherwise the Rust class will error.
268+ include_external_packages = bool (include_external_packages ),
269269 )
270270 return {
271271 module_file : import_scanner .scan_for_imports (
@@ -283,7 +283,9 @@ def _scan_chunks(
283283) -> Dict [ModuleFile , Set [DirectImport ]]:
284284 number_of_processes = len (chunks )
285285 import_scanning_jobs = joblib .Parallel (n_jobs = number_of_processes )(
286- joblib .delayed (_scan_chunk )(found_packages , include_external_packages , exclude_type_checking_imports , chunk )
286+ joblib .delayed (_scan_chunk )(
287+ found_packages , include_external_packages , exclude_type_checking_imports , chunk
288+ )
287289 for chunk in chunks
288290 )
289291
0 commit comments