diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4733356..235cbce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,6 +53,7 @@ jobs: - name: Install Python dependencies shell: bash run: | + sed -i '/^juliacall/d' requirements.txt # Remove juliacall to check if it works without pip install -r requirements.txt - name: Run library test diff --git a/requirements.txt b/requirements.txt index c48dcc0..306e8e7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,6 @@ juliacall matplotlib monotonic natsort -ompython +OMPython==4.0 psutil simplejson diff --git a/test.py b/test.py index 5ee14df..d246d53 100755 --- a/test.py +++ b/test.py @@ -260,14 +260,19 @@ def target(): print("Error: Expected at least one configuration file to start the library test") sys.exit(1) -from OMPython import OMCSession, OMCSessionZMQ +from OMPython import OMCSessionZMQ, OMCProcessDocker # Try to make the processes a bit nicer... os.environ["GC_MARKERS"]="1" print("Start OMC version") -if ompython_omhome != "": +if docker + omc = OMCProcessDocker(docker=docker, dockerExtraArgs=dockerExtraArgs) + omhome=omc.sendExpression('getInstallationDirectoryPath()') + omc_version=omc.sendExpression('getVersion()') + ompython_omc_version=omc_version +elif ompython_omhome !== "": # Use a different OMC for running OMPython than for running the tests omhome = os.environ["OPENMODELICAHOME"] omc_version = check_output_log(omc_cmd + ["--version"], stderr=subprocess.STDOUT).decode("ascii").strip() @@ -276,10 +281,11 @@ def target(): ompython_omc_version=omc.sendExpression('getVersion()') os.environ["OPENMODELICAHOME"] = omhome else: - omc = OMCSessionZMQ(docker=docker, dockerExtraArgs=dockerExtraArgs) + omc = OMCSessionZMQ() omhome=omc.sendExpression('getInstallationDirectoryPath()') omc_version=omc.sendExpression('getVersion()') ompython_omc_version=omc_version + ompython_omc_version=ompython_omc_version.replace("OMCompiler","").strip() def timeSeconds(f): diff --git a/testmodel.py b/testmodel.py index 4d16ba8..847ad3a 100755 --- a/testmodel.py +++ b/testmodel.py @@ -5,7 +5,7 @@ from asyncio.subprocess import STDOUT import simplejson as json from monotonic import monotonic -from OMPython import FindBestOMCSession, OMCSession, OMCSessionZMQ +from OMPython import OMCSession, OMCSessionZMQ import shared, glob parser = argparse.ArgumentParser(description='OpenModelica library testing tool helper (single model)')