Beispiel #1
0
def batch_run():
    current_run = gapi.current_run()
    if not current_run:
        raise CurrentRunNotBatchError("no current run")
    proto_path = current_run.guild_path("proto")
    if not os.path.exists(proto_path):
        raise CurrentRunNotBatchError("missing proto %s" % proto_path)
    return current_run
from guild import _api as gapi

x = 1

run = gapi.current_run()
flags = run.get("flags") or {}
flags["y"] = x + 1
run.write_attr("flags", flags)