Skip to content
Snippets Groups Projects
Commit 7780a7de authored by Michele Alberti's avatar Michele Alberti Committed by Aymeric Varasse
Browse files

[prover] Ensure maraboupy and Marabou binary have the same version.

It may not be the case if the user has in the PATH a local version of Marabou.
parent 118fbbae
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment