diff --git a/bin/runMarabou.py b/bin/runMarabou.py index 9e5ae83efd46b2d63b46e281ce1bbed28503076d..b1168276dd3945a056364157e4f8f57f06e3ca9c 100755 --- a/bin/runMarabou.py +++ b/bin/runMarabou.py @@ -45,6 +45,22 @@ sys.path.insert( ) +def maraboupy_version(marabou_binary: str): + result = subprocess.run( + [marabou_binary, "--version"], capture_output=True, text=True + ) + if result.returncode != 0: + print(f"Error running {marabou_binary} --version") + sys.exit(1) + + maraboupy_version = version("maraboupy") + output = result.stdout.strip() + if maraboupy_version in output: + return f"Maraboupy {maraboupy_version}" + + return sys.exit(1) + + def arguments(): parser = argparse.ArgumentParser( description="Thin wrapper around Maraboupy executable" @@ -92,7 +108,7 @@ def main(): ) else: if args.version: - print(f"Maraboupy {version('maraboupy')}") + print(f"{maraboupy_version(marabou_binary)}") else: assert args.network != None assert args.prop != None