Skip to content

Commit 92994e4

Browse files
ccoulomberwgk
andauthored
Refactor version retrieval for cuda-bindings (#2094)
partition the local version if present Co-authored-by: Ralf W. Grosse-Kunstleve <rwgkio@gmail.com>
1 parent 326d522 commit 92994e4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

cuda_core/cuda/core/_utils/enum_explanations_helpers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@
3535
def _binding_version() -> tuple[int, int, int]:
3636
"""Return the installed ``cuda-bindings`` version, or a conservative old value."""
3737
try:
38-
parts = importlib.metadata.version("cuda-bindings").split(".")[:3]
38+
version = importlib.metadata.version("cuda-bindings")
3939
except importlib.metadata.PackageNotFoundError:
4040
return (0, 0, 0) # For very old versions of cuda-python
41+
42+
parts = version.partition("+")[0].split(".")[:3]
4143
return tuple(int(v) for v in parts)
4244

4345

0 commit comments

Comments
 (0)