Options

With uranium, arguments that configure uranium itself should be passed in before the task name, and any argument passed in afterward should be specific for the function.

For example, consider the following scenario:

./uranium test -sx

When using uranium to execute tests, one should be able to parameterize that test execution. To facilitate this, Uranium provides the Options class:

def test(build):
    """ execute tests """
    main(build)
    _install_test_modules(build)
    build.executables.run([
        "py.test", os.path.join(build.root, "tests"),
    ] + build.options.args)

Full API Reference

class uranium.options.BuildOptions(directive, args, build_file, override_func=None)[source]

build options are user-driven options available to the build.

the following arguments are exposed:

directive: a string with the directive name (e.g. “main”) args: a list of arguments, passed in after the directive name.

(e.g. [“-sx”] in the case of ./uranium test -sx)
build_file: the path to the ubuild.py file being consumed,
relative to the root.