diff --git a/.github/ansys_dpf_gate-0.2.0-py3-none-any.whl b/.github/ansys_dpf_gate-0.2.0-py3-none-any.whl index 604617a924f..e940c071103 100644 Binary files a/.github/ansys_dpf_gate-0.2.0-py3-none-any.whl and b/.github/ansys_dpf_gate-0.2.0-py3-none-any.whl differ diff --git a/.github/ansys_dpf_gatebin-0.2.0-py3-none-manylinux1_x86_64.whl b/.github/ansys_dpf_gatebin-0.2.0-py3-none-manylinux1_x86_64.whl index 3fb8f38613e..18a1b20b1e4 100644 Binary files a/.github/ansys_dpf_gatebin-0.2.0-py3-none-manylinux1_x86_64.whl and b/.github/ansys_dpf_gatebin-0.2.0-py3-none-manylinux1_x86_64.whl differ diff --git a/.github/ansys_dpf_gatebin-0.2.0-py3-none-manylinux_2_17_x86_64.whl b/.github/ansys_dpf_gatebin-0.2.0-py3-none-manylinux_2_17_x86_64.whl index 8e7b71fcd05..73a6741eddb 100644 Binary files a/.github/ansys_dpf_gatebin-0.2.0-py3-none-manylinux_2_17_x86_64.whl and b/.github/ansys_dpf_gatebin-0.2.0-py3-none-manylinux_2_17_x86_64.whl differ diff --git a/.github/ansys_dpf_gatebin-0.2.0-py3-none-win_amd64.whl b/.github/ansys_dpf_gatebin-0.2.0-py3-none-win_amd64.whl new file mode 100644 index 00000000000..5893a9da69d Binary files /dev/null and b/.github/ansys_dpf_gatebin-0.2.0-py3-none-win_amd64.whl differ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e70b278d8bb..d108935f88c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ env: PACKAGE_NAME: ansys-dpf-core MODULE: core ANSYS_VERSION: 231 - extra: "--pre --find-links .github/" + extra: "--find-links .github/" jobs: style: diff --git a/ansys/dpf/core/server_types.py b/ansys/dpf/core/server_types.py index ea7ab55cb4a..9843cba842c 100644 --- a/ansys/dpf/core/server_types.py +++ b/ansys/dpf/core/server_types.py @@ -49,6 +49,8 @@ def _get_dll_path(name, ansys_path=None): if ansys_path is None: awp_root = "AWP_ROOT" + str(__ansys_version__) ANSYS_INSTALL = os.environ.get(awp_root, None) + if ANSYS_INSTALL is None: + ANSYS_INSTALL = core.misc.find_ansys() else: ANSYS_INSTALL = ansys_path if ANSYS_INSTALL is None: diff --git a/tests/conftest.py b/tests/conftest.py index 382d66e93b4..e0e8df3d00f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -360,7 +360,9 @@ def server_clayer(request): @pytest.fixture() def restore_awp_root(): - awp_root_name = "AWP_ROOT" + core.misc.__ansys_version__ + ver_to_check = core._version.server_to_ansys_version[str(core.SERVER.version)] + ver_to_check = ver_to_check[2:4] + ver_to_check[5:6] + awp_root_name = "AWP_ROOT" + ver_to_check awp_root_save = os.environ.get(awp_root_name, None) yield # restore awp_root diff --git a/tests/test_launcher.py b/tests/test_launcher.py index 72c6b5af11a..1be0d241e67 100644 --- a/tests/test_launcher.py +++ b/tests/test_launcher.py @@ -63,11 +63,14 @@ def reset_server(): reason="Ans.Dpf.Grpc.bat and .sh need AWP_ROOT221 for 221 install", ) def test_start_local_custom_ansys_path(self, server_config): - path = os.environ["AWP_ROOT" + str(core.misc.__ansys_version__)] + ver_to_check = core._version.server_to_ansys_version[str(core.SERVER.version)] + ver_to_check = ver_to_check[2:4] + ver_to_check[5:6] + awp_root_name = "AWP_ROOT" + ver_to_check + path = os.environ[awp_root_name] try: - os.unsetenv("AWP_ROOT" + str(core.misc.__ansys_version__)) + os.unsetenv(awp_root_name) except: - del os.environ["AWP_ROOT" + str(core.misc.__ansys_version__)] + del os.environ[awp_root_name] try: server = core.start_local_server( ansys_path=path, @@ -80,11 +83,11 @@ def test_start_local_custom_ansys_path(self, server_config): p = psutil.Process(server.info["server_process_id"]) assert path in p.cwd() os.environ[ - "AWP_ROOT" + str(core.misc.__ansys_version__) + awp_root_name ] = path except Exception as e: os.environ[ - "AWP_ROOT" + str(core.misc.__ansys_version__) + awp_root_name ] = path raise e @@ -106,23 +109,26 @@ def test_start_local_no_ansys_path(self, server_config): reason="Ans.Dpf.Grpc.bat and .sh need AWP_ROOT221 for 221 install", ) def test_start_local_ansys_path_environment_variable(self, server_config): + ver_to_check = core._version.server_to_ansys_version[str(core.SERVER.version)] + ver_to_check = ver_to_check[2:4] + ver_to_check[5:6] + awp_root_name = "AWP_ROOT" + ver_to_check awp_root = os.environ[ - "AWP_ROOT" + str(core.misc.__ansys_version__) + awp_root_name ] try: os.environ["ANSYS_DPF_PATH"] = awp_root try: - os.unsetenv("AWP_ROOT" + str(core.misc.__ansys_version__)) + os.unsetenv(awp_root_name) except: del os.environ[ - "AWP_ROOT" + str(core.misc.__ansys_version__) + awp_root_name ] server = core.start_local_server( use_docker_by_default=False, config=server_config ) assert isinstance(server.os, str) os.environ[ - "AWP_ROOT" + str(core.misc.__ansys_version__) + awp_root_name ] = awp_root try: os.unsetenv("ANSYS_DPF_PATH") @@ -131,7 +137,7 @@ def test_start_local_ansys_path_environment_variable(self, server_config): except Exception as e: os.environ[ - "AWP_ROOT" + str(core.misc.__ansys_version__) + awp_root_name ] = awp_root try: os.unsetenv("ANSYS_DPF_PATH") diff --git a/tests/test_service.py b/tests/test_service.py index 4e6c93461b2..afe8d8783d5 100644 --- a/tests/test_service.py +++ b/tests/test_service.py @@ -299,8 +299,9 @@ def test_load_api_without_awp_root(restore_awp_root): legacy_conf = ServerConfig(protocol=CommunicationProtocols.gRPC, legacy=True) loc_serv = dpf.core.start_local_server(config=legacy_conf, as_global=False) - - awp_root_name = "AWP_ROOT" + dpf.core.misc.__ansys_version__ + ver_to_check = dpf.core._version.server_to_ansys_version[str(loc_serv.version)] + ver_to_check = ver_to_check[2:4] + ver_to_check[5:6] + awp_root_name = "AWP_ROOT" + ver_to_check # delete awp_root del os.environ[awp_root_name]