API documentation
Options module
This exposes the choices made by the user. Defaults will be applied here, and some handling of defaults.
- nuitka.options.Options.getProjectName()
str or None, value of
--project-name, or set by build backend.
- nuitka.options.Options.getUserOptions()
Accessor the options, only for use in managing plugin options.
- nuitka.options.Options.getDebuggerName()
- Returns:
str derived from
--debugger-choice=...or NUITKA_DEBUGGER_CHOICE
- nuitka.options.Options.getFileReferenceMode()
str, one of “runtime”, “original”, “frozen”, coming from
--file-reference-choice- Notes:
Defaults to runtime for modules and packages, as well as standalone binaries, otherwise original is kept.
- nuitka.options.Options.getModuleNameMode()
str, one of “runtime”, “original”, coming from
--module-name-choice- Notes:
Defaults to runtime for modules and packages, otherwise original is kept.
- nuitka.options.Options.getModuleForceNamespace()
str or None, coming from
--module-force-namespace- Notes:
Only meaningful in module mode. An empty string forces top level loading, a non-empty value forces loading below that package.
- nuitka.options.Options.shallMakeExe()
- Returns:
bool derived from not using
--mode=dll|module|package.
- nuitka.options.Options.getShallFollowModules()
list, items of
--follow-import-to=amended with what--include-moduleand--include-packagegot
- nuitka.options.Options.getShallIncludeDistributionMetadata()
list, items of
--include-distribution-metadata=
- nuitka.options.Options.getShallIncludePackageData()
tuple of (ModuleName, filename pattern), derived from
--include-package-data=The filename pattern can be None if not given. Empty values give None too.
- nuitka.options.Options.getShallIncludeDataFiles()
generator, items derived from
--include-data-files=
- nuitka.options.Options.getShallIncludeExternallyDataFilePatterns()
list, items of
--include-data-files-external=
- nuitka.options.Options.getWindowsRuntimeDllsInclusionOption()
str, value of
--include-windows-runtime-dlls=
- nuitka.options.Options.shallWarnImplicitRaises()
- Returns:
bool derived from
--warn-implicit-exceptions
- nuitka.options.Options.getUpdateCheckMode()
- Returns:
str derived from
--update-checkorNUITKA_UPDATE_CHECK
- nuitka.options.Options.shallUsePythonDebug()
- Returns:
bool derived from
--python-debugorsys.flags.debug
Passed to Scons as
python_debugso it can consider it when picking link libraries to choose the correct variant. Also enables the definePy_DEBUGfor C headers. Reference counting checks and other debug asserts of Python will happen in this mode.
- nuitka.options.Options.isUnstripped()
- Returns:
bool derived from
--unstrippedor--profile
A binary is called stripped when debug information is not present, an unstripped when it is present. For profiling and debugging it will be necessary, but it doesn’t enable debug checks like
--debugdoes.Passed to Scons as
unstripped_modeto it can ask the linker to include symbol information. It also controls whether copied extension modules and shared libraries are stripped after copying.
- nuitka.options.Options.isDevelPerformanceCounts()
- Returns:
bool derived from
--devel-performance-counts
- nuitka.options.Options.shallGenerateReadableCode()
- Returns:
bool derived from
--devel-generate-readable-code
- nuitka.options.Options.getMainModuleName()
ModuleName or None, the name of the main module being compiled.
- nuitka.options.Options.shallUseStaticLibPython()
- Returns:
bool derived from
--static-libpython=yes|autoand not module mode
- nuitka.options.Options.shallTreatUninstalledPython()
bool = derived from Python installation and modes
- Notes:
Not done for standalone mode obviously. The Python DLL will be a dependency of the executable and treated that way.
Also not done for extension modules, they are loaded with a Python runtime available.
Most often uninstalled Python versions are self compiled or from Anaconda.
- nuitka.options.Options.shallCreateScriptFileForExecution()
bool = derived from Python installation and modes
Notes: Mostly for accelerated mode with uninstalled python, to make sure they find their Python DLL and Python packages. AIX needs help in standalone mode too.
- nuitka.options.Options.isReproducibleBuild()
- Returns:
bool derived from
--reproducibleor defaults to true on non-Windows.
- nuitka.options.Options.getLtoMode()
Return LTO mode.
- Returns:
str - derived from
--lto, with ‘auto’ resolved from environment flags when possible.
- nuitka.options.Options.isClang()
- Returns:
bool derived from
--clangor auto-enabled by target or platform when no other compiler was selected.
- nuitka.options.Options.shallDisableCCacheUsage()
- Returns:
bool derived from
--disable-ccacheor--disable--cache=ccache
- nuitka.options.Options.shallDisableBytecodeCacheUsage()
- Returns:
bool derived from
--disable-bytecode-cache
- nuitka.options.Options.getLinuxAppLicense()
str SPDX license expression derived from
--linux-app-license
- nuitka.options.Options.getContainerCommand()
str or None, command to run inside the container instead of compiling
- nuitka.options.Options.getContainerRequirements()
tuple, requirements to install inside the container
- nuitka.options.Options.getContainerWheelsDir()
str or None, directory with wheels to install inside the container
- nuitka.options.Options.getContainerPythonVersion()
str or None, Python version to build inside the container
- nuitka.options.Options.getContainerNoBuild()
bool, shall the container be used as is, from
--container-no-build
- nuitka.options.Options.getContainerPodmanPath()
str or None, podman binary path from
--container-podman-path
- nuitka.options.Options.getContainerPodmanVerbose()
bool, shall podman be verbose, from
--container-podman-verbose
tuple, paths to share with the container from
--container-shared-path
- nuitka.options.Options.getContainerNetwork()
bool, shall the container run use the network, from
--container-network
- nuitka.options.Options.getContainerIsolated()
bool or None, isolation choice from
--container-isolated/--container-no-isolated
- nuitka.options.Options.getContainerPrivileged()
bool, shall the container run be privileged, from
--container-privileged
- nuitka.options.Options.isLinuxAppMode()
- Returns:
bool derived from
--mode=app|app-distbeing used on Linux
- nuitka.options.Options.shallCreateLinuxApp()
bool shall create desktop file and metainfo files on Linux
- Notes:
This is derived from using ‘–mode=app’ or ‘–mode=app-dist’ on Linux, and checks that company and product names are given, from which the application id is derived, otherwise this is ‘False’ and a one time warning is given.
- nuitka.options.Options.shallUseDirectConstantBlobs()
Decide if direct per-blob constants access shall be used.
- nuitka.options.Options.shallRemoveBytecodeLineNumbers()
bool indicating if bytecode line numbers should be removed.
- nuitka.options.Options.getResourceMode(onefile)
Resource mode requested for the constants blobs.
- Args:
- onefile: Whether the onefile bootstrap build is asking, for which the
‘–onefile-resource-mode’ option overrides the general ‘–resource-mode’ option.
- Returns:
str or None - the requested resource mode.
- nuitka.options.Options.shallNotFallbackBytecodeToCompiled(module_name, function_qualname, source_ref)
Decide if falling back from bytecode-backed functions to compiled C code is forbidden.
- Args:
module_name: Name of the module containing the function. function_qualname: Qualified name of the function. source_ref: Source reference of the function.
- nuitka.options.Options.getDevelModeIndications()
tuple of active development options that need C level definitions.
- nuitka.options.Options.isDynamicSpec(spec)
Check if a spec contains dynamic values that change every run.
- nuitka.options.Options.isOnefileTempDirMode()
- Returns:
bool derived from
--onefile-tempdir-specand--onefile-cache-mode
- Notes:
Using cached onefile execution when the spec doesn’t contain volatile things or forced by the user.
- nuitka.options.Options.getWindowsIconExecutablePath()
str or None if not given, value of
--windows-icon-from-exe
- nuitka.options.Options.shallAskForWindowsAdminRights()
bool, value of
--windows-uac-adminor--windows-uac-uiaccess
- nuitka.options.Options.getWindowsInstallerOutputFilename()
str or None, value of
--windows-installer-output
- nuitka.options.Options.getWindowsInstallerInstallDir()
str or None, value of
--windows-installer-install-dir
- nuitka.options.Options.getWindowsInstallerShortcuts()
str or None, value of
--windows-installer-shortcuts
- nuitka.options.Options.getWindowsInstallerLicenseFile()
str or None, value of
--windows-installer-license-file
- nuitka.options.Options.isWindowsInstallerAllowUserChangeInstallDir()
bool, inverted value of
--windows-installer-no-user-change-install-dir
- nuitka.options.Options.getWindowsInstallerMode()
str, value of
--windows-installer-mode, defaults to"multiuser"
- nuitka.options.Options.getLinuxInstallerAppImagetoolPath()
str or None, value of
--linux-installer-appimagetool-path
- nuitka.options.Options.getLinuxInstallerOutputFilename()
str or None, value of
--linux-installer-output
- nuitka.options.Options.getWindowsVersionInfoStrings()
dict of str, non-empty Windows version resource strings.
- nuitka.options.Options.getProductVersionTuple()
- Returns:
tuple of 4 ints or None, derived from
--product-version
- nuitka.options.Options.getFileVersionTuple()
- Returns:
tuple of 4 ints or None, derived from
--file-version
- nuitka.options.Options.getWindowsSplashScreen()
- Returns:
str or None derived from
--onefile-windows-splash-screen-image
- nuitka.options.Options.getMacOSTargetArch()
- Returns:
str enum (“arm64”, “x86_64”) derived from
--macos-target-archvalue
- nuitka.options.Options.shallCreateAppBundle()
bool shall create an application bundle, derived from
--macos-create-app-bundlevalue
- nuitka.options.Options.shallCreateDmgFile()
bool shall create a DMG file, derived from
--macos-installervalue
- nuitka.options.Options.getMacOSInstallerOutputFilename()
str or None, value of
--macos-installer-output
- nuitka.options.Options.getMacOSSigningIdentity()
str value to use as identity for codesign, derived from
--macos-sign-identityvalue
- nuitka.options.Options.shallUseSigningForNotarization()
bool flag to use for codesign, derived from
--macos-sign-notarizationvalue
- nuitka.options.Options.getMacOSAppProtectedResourcesAccesses()
tuple of (key, description, entitlement) for protected resources of the app bundle
- nuitka.options.Options.getMacOSSigningCertificateFilename()
str or None if not given, value of
--macos-sign-keyring-filename
- nuitka.options.Options.getMacOSSigningCertificatePassword()
str or None if not given, value of
--macos-sign-keyring-password
- nuitka.options.Options.shallMacOSProhibitMultipleInstances()
bool, derived from
--macos-prohibit-multiple-instances
- nuitka.options.Options.hasPythonFlagTraceImports()
bool = “trace_imports”, “-v” in python flags given
- nuitka.options.Options.hasPythonFlagNoRandomization()
bool = “no_randomization”, “-R”, “static_hashes” in python flags given
- nuitka.options.Options.hasPythonFlagNoBytecodeRuntimeCache()
bool = “dontwritebytecode”, “-B” in python flags given
- nuitka.options.Options.hasPythonFlagNoCurrentDirectoryInPath()
bool = “safe_path”, “-P” in python flags given
- nuitka.options.Options.shallNotUseDependsExeCachedResults()
- Returns:
bool derived from
--disable-dll-dependency-cacheor--force-dll-dependency-cache-update
- nuitka.options.Options.shallNotStoreDependsExeCachedResults()
- Returns:
bool derived from
--disable-dll-dependency-cache
- nuitka.options.Options.getPluginNameConsideringRenames(plugin_name)
Name of the plugin with renames considered.
- nuitka.options.Options.getPluginsEnabledUnrenamed()
tuple, user enabled (standard) plugins without renames applied.
- Note:
This is for plugins that replaced other plugins, and need to know which name was used to enable them.
- nuitka.options.Options.getPluginsEnabled()
tuple, user enabled (standard) plugins (not including user plugins)
- Note:
Do not use this outside of main binary, as plugins are allowed to activate plugins themselves and that will not be visible here.
- nuitka.options.Options.getPluginsDisabled()
tuple, user disabled (standard) plugins.
- Note:
Do not use this outside of main binary, as other plugins, e.g. hinted compilation will activate plugins themselves and this will not be visible here.
- nuitka.options.Options.shallCompileWithoutBuildDirectory()
bool currently hard coded, not when using debugger.
When this is used, compilation is executed in a fashion that it runs inside the build folder, hiding it, attempting to make results more reproducible across builds of different programs.
TODO: Make this not hardcoded, but possible to disable via an options.
- nuitka.options.Options.shallRecompileExtensionModules(module_name)
tuple of (bool or None, str), decision and reason whether to prefer source code over extension modules
- nuitka.options.Options.getProgressBar()
str what progress bar to use if any, derived from
--progress-barand legacy option--no-progressbar
- nuitka.options.Options.getForcedStdoutPath()
str, None, or False, force program stdout output into that filename
- nuitka.options.Options.getForcedStderrPath()
str, None, or False, force program stderr output into that filename
- nuitka.options.Options.shallShowSourceModifications(module_name)
bool display plugin source changes derived from –show-source-changes
- nuitka.options.Options.getCompilationReportFilename()
str filename to write XML report of compilation to
- nuitka.options.Options.getCompilationReportTemplates()
tuple of str,str template and output filenames to write reports to
- nuitka.options.Options.getTargetPythonDescription()
- Returns:
tuple(int, str) or None derived from
--target
- nuitka.options.Options.getModuleParameter(module_name, parameter_name)
- Returns:
str or None derived from
--module-parameter