MCPcopy
hub / github.com/Nuitka/Nuitka / makeSourceDirectory

Function makeSourceDirectory

nuitka/MainControl.py:486–610  ·  view source on GitHub ↗

Get the full list of modules imported, create code for all of them.

()

Source from the content-addressed store, hash-verified

484
485
486def makeSourceDirectory():
487 """Get the full list of modules imported, create code for all of them."""
488 # We deal with a lot of details here, but rather one by one, and split makes
489 # no sense, pylint: disable=too-many-branches
490
491 # assert main_module in ModuleRegistry.getDoneModules()
492
493 # Lets check if the asked modules are actually present, and warn the
494 # user if one of those was not found.
495 for any_case_module in getShallFollowModules():
496 if "*" in any_case_module or "{" in any_case_module:
497 continue
498
499 if not ModuleRegistry.hasDoneModule(
500 any_case_module
501 ) and not ModuleRegistry.hasRootModule(any_case_module):
502 general.warning(
503 "Did not follow import to unused '%s', consider include "
504 % any_case_module
505 )
506
507 # Prepare code generation, i.e. execute finalization for it.
508 for current_module in ModuleRegistry.getDoneModules():
509 if current_module.isCompiledPythonModule():
510 Finalization.prepareCodeGeneration(current_module)
511
512 # Do some reporting and determine compiled module to work on
513 compiled_modules = []
514
515 for current_module in ModuleRegistry.getDoneModules():
516 if current_module.isCompiledPythonModule():
517 compiled_modules.append(current_module)
518
519 if isShowInclusion():
520 inclusion_logger.info(
521 "Included compiled module '%s'." % current_module.getFullName()
522 )
523 elif current_module.isPythonExtensionModule():
524 if isShowInclusion():
525 inclusion_logger.info(
526 "Included extension module '%s'." % current_module.getFullName()
527 )
528 elif current_module.isUncompiledPythonModule():
529 if isShowInclusion():
530 inclusion_logger.info(
531 "Included uncompiled module '%s'." % current_module.getFullName()
532 )
533 else:
534 assert False, current_module
535
536 # Pick filenames.
537 source_dir = OutputDirectories.getSourceDirectoryPath(onefile=False, create=False)
538
539 module_filenames = pickSourceFilenames(
540 source_dir=source_dir, modules=compiled_modules
541 )
542
543 setupProgressBar(

Callers 1

compileTreeFunction · 0.85

Calls 15

getShallFollowModulesFunction · 0.90
isShowInclusionFunction · 0.90
setupProgressBarFunction · 0.90
reportProgressBarFunction · 0.90
generateModuleCodeFunction · 0.90
changeFilenameExtensionFunction · 0.90
assumeYesForDownloadsFunction · 0.90
closeProgressBarFunction · 0.90
generateHelpersCodeFunction · 0.90
getNormalizedPathJoinFunction · 0.90
pickSourceFilenamesFunction · 0.85
lenFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…