Skip to content

Commit 75b686b

Browse files
authored
Add grpc version mapping for 232. (#561)
* Add grpc version mapping for 232. * Do not throw if server version is not recognized while checking for grpc-dpf compatibility. * Fix coverage
1 parent 91a516a commit 75b686b

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

ansys/dpf/core/_version.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Version for ansys-dpf-core"""
22
# major, minor, patch
3-
version_info = 0, 6, '1dev0'
3+
version_info = 0, 6, 1, 'dev0'
44

55
# Nice string for the version
66
__version__ = ".".join(map(str, version_info))
@@ -12,6 +12,7 @@
1212
"3.0": ">=0.4.0",
1313
"4.0": ">=0.5.0",
1414
"5.0": ">=0.6.0",
15+
"6.0": ">=0.7.*",
1516
}
1617

1718
server_to_ansys_version = {
@@ -20,4 +21,5 @@
2021
"3.0": "2022R1",
2122
"4.0": "2022R2",
2223
"5.0": "2023R1",
24+
"6.0": "2023R2",
2325
}

ansys/dpf/core/server_types.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,15 +282,21 @@ def check_ansys_grpc_dpf_version(server, timeout):
282282
raise TimeoutError(
283283
f"Failed to connect to {server._input_ip}:{server._input_port} in {timeout} seconds"
284284
)
285-
285+
compatibility_link = (f"https://dpf.docs.pyansys.com/getting_started/"
286+
f"index.html#client-server-compatibility")
286287
LOG.debug("Established connection to DPF gRPC")
287288
grpc_module_version = ansys.grpc.dpf.__version__
288289
server_version = server.version
289290
right_grpc_module_version = server_to_ansys_grpc_dpf_version.get(server_version, None)
291+
if right_grpc_module_version is None: # pragma: no cover
292+
# warnings.warn(f"No requirement specified on ansys-grpc-dpf for server version "
293+
# f"{server_version}. Continuing with the ansys-grpc-dpf version "
294+
# f"installed ({grpc_module_version}). In case of unexpected instability, "
295+
# f"please refer to the compatibility guidelines given in "
296+
# f"{compatibility_link}.")
297+
return
290298
if not _compare_ansys_grpc_dpf_version(right_grpc_module_version, grpc_module_version):
291299
ansys_version_to_use = server_to_ansys_version.get(server_version, 'Unknown')
292-
compatibility_link = (f"https://dpfdocs.pyansys.com/getting_started/"
293-
f"index.html#client-server-compatibility")
294300
ansys_versions = core._version.server_to_ansys_version
295301
latest_ansys = ansys_versions[max(ansys_versions.keys())]
296302
raise ImportWarning(f"An incompatibility has been detected between the DPF server version "

0 commit comments

Comments
 (0)