Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 733 Bytes

rules.rst

File metadata and controls

29 lines (21 loc) · 733 Bytes

Rules

Warning: This is an experimental api. It is not a final design, and could be modified in the future.

Rules are a way to help prevent re-executing tasks unnecessarily. For example, not re-downloading a script if it has already been downloaded:

import os
import requests
from uranium import rule
from uranium.rules import WasChanged

@rule(WasChanged("./config.json"))
def main(build):
    with open(.path.join(build.root, "config.json"), "w+") as fh:
        resp = requests.get("http://myconfig.internalcompany.com")
        fh.write(resp.content)

Full API Reference

uranium.rules.WasChanged