Environment Variables

An environment variable set within uranium is active for not only the lifetime of the build, but for any entry points or scripts generated as well.

environment variables can be modified as a regular dictionary:

import os

def main(build):
    build.envvars["EDITOR"] = "emacs"
    build.envvars["LD_LIBRARY_PATH"] = os.path.join(build.root, "lib")

Full API Reference

class uranium.environment_variables.EnvironmentVariables[source]

an interface exposed which allows the setting of environment variables.

it acts identical to a dictionary.

__getitem__(key)[source]

retrieve an environment variable.

envvars["PYTHONPATH"]
__setitem__(key, item)[source]

set an environment variable, both in the current environment and for future environments.

envvars["EDITOR"] = "emacs"