Add Python version to environment file

This commit is contained in:
Patrick Lühne 2017-11-21 02:27:10 +01:00
parent d99be12b05
commit 860c5711ef
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

View File

@ -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),