This document lists every single global type, variable, and function available in PyOxidizer’s Starlark execution environment.
The Starlark environment contains symbols from the following:
In addition, extra global variables can be injected into the execution
environment on a per-invocation basis. This is commonly encountered
with use of the
--var and –var-env` arguments to various
PyOxidizer’s Starlark dialect defines the following custom types:
Represents a filesystem path and content.
Represents the content of a file on the filesystem.
File, this does not track the filename internally.)
Represents a mapping of filenames to file content.
Represents an implementation of Python.
Used for embedding into binaries and running Python code.
Represents resources made available to a Python interpreter.
Represents an executable file containing a Python interpreter.
Represents a compiled Python extension module.
Represents the configuration of a Python interpreter.
Represents a file containing Python package distribution metadata.
Represents a non-module resource data file.
Represents a policy controlling how Python resources are added to a binary.
.pyfile containing Python source code.
The Starlark execution environment defines various variables in the global scope which are intended to be used as read-only constants. The following sections describe these variables.
The string Rust target triple that we’re currently building for. Will be
a value like
rustup target list to see a list of targets.
The string path to the configuration file currently being evaluated.
Holds build context. This is an internal variable and accessing it will not provide any value.
The current working directory. Also the directory containing the active configuration file.
PyOxidizer’s Starlark dialect defines the following global functions:
Obtain the default
PythonDistributionfor the active build configuration.
Register a named target that can be built.
Build/resolve a specific named target.
Triggers resolution of requested build targets.
Set the filesystem path to use for writing files during evaluation.
Types with Target Behavior¶
As described in Targets, a function registered as a named target can return a type that has special build or run behavior.
The following types have special behavior registered:
Build behavior is to materialize all files in the file manifest.
Run behavior is to run the last added
PythonExecutableif available, falling back to an executable file installed by the manifest if there is exactly 1 executable file.
Build behavior is to write out files this type represents.
There is no run behavior.
Build behavior is to build the executable file.
Run behavior is to run that built executable.