From 860c5711ef1913343b2139e9db8aef0275b4931b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Tue, 21 Nov 2017 02:27:10 +0100 Subject: [PATCH] Add Python version to environment file --- benchmark.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/benchmark.py b/benchmark.py index 7bab1c575..ef2c045fa 100644 --- a/benchmark.py +++ b/benchmark.py @@ -17,6 +17,14 @@ def executeCommand(command, stdin = None, cwd = None): return stdout.decode("utf-8"), stderr.decode("utf-8"), exitCode +def pythonVersion(config): + version, _, _ = executeCommand([config["executables"]["python"]["binary"], "--version"]) + version = version.strip() + + match = re.match(r'Python (.*?)$', version, re.M | re.I) + + return match.group(1) + def plaspVersion(config): version, _, _ = executeCommand([config["executables"]["plasp"]["binary"], "-v"]) version = version.strip() @@ -223,6 +231,7 @@ def runJob(configuration, instance, config): "workingDirectory": plannerDir, "versions": \ { + "python": pythonVersion(config), "clingo": clingoVersion(config), "plasp": plaspVersion(config), "planner": plannerVersion(config),