From 3896484a845e4c3e2b6fa5eff59c03e8952d20b5 Mon Sep 17 00:00:00 2001 From: Dominik Gresch Date: Fri, 2 Feb 2024 14:28:27 +0100 Subject: [PATCH] Add explicit check for minimum ACP version --- src/ansys/acp/core/_server/launch.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ansys/acp/core/_server/launch.py b/src/ansys/acp/core/_server/launch.py index 2a3de60f2d..40c61f81af 100644 --- a/src/ansys/acp/core/_server/launch.py +++ b/src/ansys/acp/core/_server/launch.py @@ -1,5 +1,7 @@ from __future__ import annotations +from packaging import version + from ansys.tools.local_product_launcher.config import get_launch_mode_for from ansys.tools.local_product_launcher.launch import launch_product @@ -69,4 +71,12 @@ def launch_acp( ) if timeout is not None: acp._server.wait(timeout=timeout) + # We can only check the server version after the server has started; + # if the timeout is set to 'None', we skip this check. + MIN_VERSION = "24.2" + if version.parse(acp.server_version) < version.parse(MIN_VERSION): + raise RuntimeError( + f"ACP version {acp.server_version} is not supported. " + f"Please use ACP version {MIN_VERSION} or later." + ) return acp