class WithPrimitive(Anod): build_qualifier_format = (("error", False),) package = Anod.Package(prefix="mypackage", version=lambda: "42") @Anod.primitive() def build(self): if "error" in self.parsed_qualifier: raise ValueError(self.parsed_qualifier["error"]) elif "error2" in self.parsed_qualifier: self.shell(sys.executable, "-c", "import sys; sys.exit(2)") else: hello = self.shell( sys.executable, "-c", 'print("world")', output=subprocess.PIPE ) return hello.out.strip()
class WithPrimitive(Anod): build_qualifier_format = (('error', False), ) package = Anod.Package(prefix='mypackage', version=lambda: '42') @Anod.primitive() def build(self): if 'error' in self.parsed_qualifier: raise ValueError(self.parsed_qualifier['error']) elif 'error2' in self.parsed_qualifier: self.shell(sys.executable, '-c', 'import sys; sys.exit(2)') else: hello = self.shell(sys.executable, '-c', 'print("world")', output=subprocess.PIPE) return hello.out.strip()