From 5f514a5014830c76ccad72183914b01f35e21808 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 27 Aug 2026 13:12:51 -0400 Subject: [PATCH 1/3] Update cuda-core and cuda-pathfinder version automatically in cuda-python --- cuda_python/setup.py | 51 +++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/cuda_python/setup.py b/cuda_python/setup.py index dad8a596c95..f8a55708c98 100644 --- a/cuda_python/setup.py +++ b/cuda_python/setup.py @@ -8,34 +8,41 @@ from setuptools import setup from setuptools_scm import get_version -version = get_version( - root="..", - relative_to=__file__, - # Preserve a/b pre-release suffixes, but intentionally strip rc suffixes. - tag_regex="^(?Pv\\d+\\.\\d+\\.\\d+(?:[ab]\\d+)?)", - git_describe_command=["git", "describe", "--dirty", "--tags", "--long", "--match", "v*[0-9]*"], -) +def get_version_for_module(module_name: str | None = None) -> str: + if module_name is None: + module_name = "" + else: + module_name = f"{module_name}-" + return get_version( + root="..", + relative_to=__file__, + # Preserve a/b pre-release suffixes, but intentionally strip rc suffixes. + tag_regex=f"^{module_name}(?Pv\\d+\\.\\d+\\.\\d+(?:[ab]\\d+)?)", + git_describe_command=["git", "describe", "--dirty", "--tags", "--long", "--match", f"{module_name}v*[0-9]*"], + version_scheme="post-release", + ) + + +install_requires: list[str] = [] +extras_require: dict[str, list[str]] = {} -base_version = Version(version).base_version +for module in ["cuda-bindings", "cuda-core", "cuda-pathfinder"]: + if module == "cuda-bindings": + module_prefix = None + else: + module_prefix = module + version = get_version_for_module(module_prefix) + base_version: str = Version(version).base_version + install_requires.append(f"{module}~={base_version}") -if base_version == version: - # Tagged release - matcher = "~=" -else: - # Pre-release version - matcher = "==" + if module == "cuda-bindings": + extras_require["all"] = [f"{module}[all]~={base_version}"] setup( version=version, - install_requires=[ - f"cuda-bindings{matcher}{version}", - "cuda-core~=1.0.0", - "cuda-pathfinder~=1.1", - ], - extras_require={ - "all": [f"cuda-bindings[all]{matcher}{version}"], - }, + install_requires=install_requires, + extras_require=extras_require, ) From 7ddbe35afa54a053d983a3b96e047fc1ae31dc83 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 27 Aug 2026 13:21:58 -0400 Subject: [PATCH 2/3] Don't regress cuda-pathfinder --- cuda_python/setup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cuda_python/setup.py b/cuda_python/setup.py index f8a55708c98..5025640f1cf 100644 --- a/cuda_python/setup.py +++ b/cuda_python/setup.py @@ -35,6 +35,9 @@ def get_version_for_module(module_name: str | None = None) -> str: version = get_version_for_module(module_prefix) base_version: str = Version(version).base_version + if module == "cuda-pathfinder": + base_version = base_version.rsplit(".", 1)[0] + install_requires.append(f"{module}~={base_version}") if module == "cuda-bindings": From 027f16c9d17b3112c30a01de843a98a4d9da0d7f Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 27 Aug 2026 14:12:31 -0400 Subject: [PATCH 3/3] Fix regex --- cuda_python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuda_python/setup.py b/cuda_python/setup.py index 5025640f1cf..7e7155e1541 100644 --- a/cuda_python/setup.py +++ b/cuda_python/setup.py @@ -19,7 +19,7 @@ def get_version_for_module(module_name: str | None = None) -> str: relative_to=__file__, # Preserve a/b pre-release suffixes, but intentionally strip rc suffixes. tag_regex=f"^{module_name}(?Pv\\d+\\.\\d+\\.\\d+(?:[ab]\\d+)?)", - git_describe_command=["git", "describe", "--dirty", "--tags", "--long", "--match", f"{module_name}v*[0-9]*"], + git_describe_command=["git", "describe", "--dirty", "--tags", "--long", "--match", f"{module_name}v[0-9]*"], version_scheme="post-release", )