From 8e892cec8ca87d83f4545e10ac49ef1b53b024af Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Mon, 29 Jul 2024 09:49:04 -0400 Subject: [PATCH] fix: regresssion for '-' in version name (#834) Fix #833. Signed-off-by: Henry Schreiner --- src/scikit_build_core/program_search.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scikit_build_core/program_search.py b/src/scikit_build_core/program_search.py index 44712da0..832c5104 100644 --- a/src/scikit_build_core/program_search.py +++ b/src/scikit_build_core/program_search.py @@ -80,7 +80,9 @@ def get_cmake_program(cmake_path: Path) -> Program: try: result = Run().capture(cmake_path, "-E", "capabilities") try: - version = Version(json.loads(result.stdout)["version"]["string"]) + version = Version( + json.loads(result.stdout)["version"]["string"].split("-")[0] + ) logger.info("CMake version: {}", version) return Program(cmake_path, version) except (json.decoder.JSONDecodeError, KeyError, InvalidVersion):