diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-08-12 20:19:02 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-08-12 20:25:36 +0200 |
| commit | c66f450aa1af3b7e3097d49bbbb4579735cbccac (patch) | |
| tree | 4dc17f740bac9113fa6db5d5fe077ba93c7c0c50 | |
| parent | 7714046607622de1a9fe6282e8d8ea12824b27c3 (diff) | |
| download | allocbench-c66f450aa1af3b7e3097d49bbbb4579735cbccac.tar.gz allocbench-c66f450aa1af3b7e3097d49bbbb4579735cbccac.zip | |
add requirement check for matplotlib and python version >= 3.6
| -rwxr-xr-x | bench.py | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -7,6 +7,7 @@ import importlib import os import pickle import subprocess +import sys import traceback import src.facter @@ -46,14 +47,24 @@ def epilog(): pickle.dump(src.globalvars.facts, f) -def checkDependenciesAndPreconditions(): - # TODO: matplotlib - # TODO: python 3.6 +def check_dependencies(): + """Check if known requirements of allocbench are met""" + # used python 3.6 features: f-strings + if sys.version_info[0] < 3 or sys.version_info[1] < 6: + logger.critical("At least python version 3.6 is required.") + exit(1) + + # matplotlib is needed by Benchmark.plot_* + try: + import matplotlib + except ModuleNotFoundError: + logger.critical("matplotlib not found.") + exit(1) # TODO mariadb - pass + def main(): - checkDependenciesAndPreconditions() + check_dependencies() args = parser.parse_args() if args.license: |
