Skip to content

Commit 70357d8

Browse files
authored
Release update wheels 0.6.0 no dev (#450)
* Remove --pre * Update to latest wheels after fix of timefreq deleter in 221 * Tests using awp_root do not get the ansys version from misc anymore as it is hard-coded. * Fix test_start_local_custom_ansys_path: get awp_root from current server version and not pygate * Fix test_start_local_ansys_path_environment_variable: get awp_root from current server version and not pygate * UFix _get_dll_find_ansys * Fix _get_dll_find_ansys * Update gate wheel with Delete fix
1 parent 8a6c03d commit 70357d8

9 files changed

+25
-14
lines changed
1.01 KB
Binary file not shown.
-1007 Bytes
Binary file not shown.
-1007 Bytes
Binary file not shown.
2.9 MB
Binary file not shown.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env:
1919
PACKAGE_NAME: ansys-dpf-core
2020
MODULE: core
2121
ANSYS_VERSION: 231
22-
extra: "--pre --find-links .github/"
22+
extra: "--find-links .github/"
2323

2424
jobs:
2525
style:

ansys/dpf/core/server_types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ def _get_dll_path(name, ansys_path=None):
4949
if ansys_path is None:
5050
awp_root = "AWP_ROOT" + str(__ansys_version__)
5151
ANSYS_INSTALL = os.environ.get(awp_root, None)
52+
if ANSYS_INSTALL is None:
53+
ANSYS_INSTALL = core.misc.find_ansys()
5254
else:
5355
ANSYS_INSTALL = ansys_path
5456
if ANSYS_INSTALL is None:

tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,9 @@ def server_clayer(request):
360360

361361
@pytest.fixture()
362362
def restore_awp_root():
363-
awp_root_name = "AWP_ROOT" + core.misc.__ansys_version__
363+
ver_to_check = core._version.server_to_ansys_version[str(core.SERVER.version)]
364+
ver_to_check = ver_to_check[2:4] + ver_to_check[5:6]
365+
awp_root_name = "AWP_ROOT" + ver_to_check
364366
awp_root_save = os.environ.get(awp_root_name, None)
365367
yield
366368
# restore awp_root

tests/test_launcher.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,14 @@ def reset_server():
6363
reason="Ans.Dpf.Grpc.bat and .sh need AWP_ROOT221 for 221 install",
6464
)
6565
def test_start_local_custom_ansys_path(self, server_config):
66-
path = os.environ["AWP_ROOT" + str(core.misc.__ansys_version__)]
66+
ver_to_check = core._version.server_to_ansys_version[str(core.SERVER.version)]
67+
ver_to_check = ver_to_check[2:4] + ver_to_check[5:6]
68+
awp_root_name = "AWP_ROOT" + ver_to_check
69+
path = os.environ[awp_root_name]
6770
try:
68-
os.unsetenv("AWP_ROOT" + str(core.misc.__ansys_version__))
71+
os.unsetenv(awp_root_name)
6972
except:
70-
del os.environ["AWP_ROOT" + str(core.misc.__ansys_version__)]
73+
del os.environ[awp_root_name]
7174
try:
7275
server = core.start_local_server(
7376
ansys_path=path,
@@ -80,11 +83,11 @@ def test_start_local_custom_ansys_path(self, server_config):
8083
p = psutil.Process(server.info["server_process_id"])
8184
assert path in p.cwd()
8285
os.environ[
83-
"AWP_ROOT" + str(core.misc.__ansys_version__)
86+
awp_root_name
8487
] = path
8588
except Exception as e:
8689
os.environ[
87-
"AWP_ROOT" + str(core.misc.__ansys_version__)
90+
awp_root_name
8891
] = path
8992
raise e
9093

@@ -106,23 +109,26 @@ def test_start_local_no_ansys_path(self, server_config):
106109
reason="Ans.Dpf.Grpc.bat and .sh need AWP_ROOT221 for 221 install",
107110
)
108111
def test_start_local_ansys_path_environment_variable(self, server_config):
112+
ver_to_check = core._version.server_to_ansys_version[str(core.SERVER.version)]
113+
ver_to_check = ver_to_check[2:4] + ver_to_check[5:6]
114+
awp_root_name = "AWP_ROOT" + ver_to_check
109115
awp_root = os.environ[
110-
"AWP_ROOT" + str(core.misc.__ansys_version__)
116+
awp_root_name
111117
]
112118
try:
113119
os.environ["ANSYS_DPF_PATH"] = awp_root
114120
try:
115-
os.unsetenv("AWP_ROOT" + str(core.misc.__ansys_version__))
121+
os.unsetenv(awp_root_name)
116122
except:
117123
del os.environ[
118-
"AWP_ROOT" + str(core.misc.__ansys_version__)
124+
awp_root_name
119125
]
120126
server = core.start_local_server(
121127
use_docker_by_default=False, config=server_config
122128
)
123129
assert isinstance(server.os, str)
124130
os.environ[
125-
"AWP_ROOT" + str(core.misc.__ansys_version__)
131+
awp_root_name
126132
] = awp_root
127133
try:
128134
os.unsetenv("ANSYS_DPF_PATH")
@@ -131,7 +137,7 @@ def test_start_local_ansys_path_environment_variable(self, server_config):
131137

132138
except Exception as e:
133139
os.environ[
134-
"AWP_ROOT" + str(core.misc.__ansys_version__)
140+
awp_root_name
135141
] = awp_root
136142
try:
137143
os.unsetenv("ANSYS_DPF_PATH")

tests/test_service.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,9 @@ def test_load_api_without_awp_root(restore_awp_root):
299299

300300
legacy_conf = ServerConfig(protocol=CommunicationProtocols.gRPC, legacy=True)
301301
loc_serv = dpf.core.start_local_server(config=legacy_conf, as_global=False)
302-
303-
awp_root_name = "AWP_ROOT" + dpf.core.misc.__ansys_version__
302+
ver_to_check = dpf.core._version.server_to_ansys_version[str(loc_serv.version)]
303+
ver_to_check = ver_to_check[2:4] + ver_to_check[5:6]
304+
awp_root_name = "AWP_ROOT" + ver_to_check
304305
# delete awp_root
305306
del os.environ[awp_root_name]
306307

0 commit comments

Comments
 (0)