Copying Modules and Packages

class nsist.copymodules.ModuleCopier(py_version, path=None)[source]

Finds and copies importable Python modules and packages.

There is a Python 3 implementation using importlib, and a Python 2 implementation using imp.

copy(modname, target)[source]

Copy the importable module ‘modname’ to the directory ‘target’.

modname should be a top-level import, i.e. without any dots. Packages are always copied whole.

This can currently copy regular filesystem files and directories, and extract modules and packages from appropriately structured zip files.

nsist.copymodules.copy_modules(modnames, target, py_version, path=None, exclude=None)[source]

Copy the specified importable modules to the target directory.

By default, it finds modules in sys.path - this can be overridden by passing the path parameter.