15
0

Accepting request 1268187 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/1268187
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nanobind?expand=0&rev=3
This commit is contained in:
2025-04-10 19:58:59 +00:00
committed by Git OBS Bridge
3 changed files with 75 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
bugzilla.opensuse.org/show_bug.cgi?id=1239153
github.com/wjakob/nanobind/issues/970
github.com/wjakob/nanobind/commit/f2b08c9
edited to fit file version from distribution
From f2b08c936ec4b1dd06d374fef2637d89daa905f4 Mon Sep 17 00:00:00 2001
From: Wenzel Jakob <wenzel.jakob@epfl.ch>
Date: Tue, 8 Apr 2025 10:57:30 +0900
Subject: [PATCH] fix parallel test suite build race condition
---
tests/CMakeLists.txt | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 40ed1276..3bd54783 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -92,14 +92,22 @@ endforeach()
target_sources(test_intrusive_ext PRIVATE test_intrusive_impl.cpp)
+if (CMAKE_CONFIGURATION_TYPES)
+ set(OUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)
+else()
+ set(OUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
+endif()
+
foreach (NAME functions classes ndarray stl enum typing make_iterator)
if (NAME STREQUAL typing)
set(EXTRA
MARKER_FILE py.typed
PATTERN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/pattern_file.nb"
)
+ set(EXTRA_DEPENDS "${OUT_DIR}/py_stub_test.py")
else()
set(EXTRA "")
+ set(EXTRA_DEPENDS "")
endif()
if (CMAKE_CONFIGURATION_TYPES)
@@ -112,7 +120,7 @@ foreach (NAME functions classes ndarray jax tensorflow stl enum typing make_iter
MODULE test_${NAME}_ext
OUTPUT ${PYI_PREFIX}test_${NAME}_ext.pyi
PYTHON_PATH $<TARGET_FILE_DIR:test_${NAME}_ext>
- DEPENDS test_${NAME}_ext
+ DEPENDS test_${NAME}_ext ${EXTRA_DEPENDS}
${EXTRA})
endforeach()
@@ -179,12 +187,6 @@ set(TEST_FILES
set (PY_STUB_TEST py_stub_test.py)
if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) OR MSVC)
- if (CMAKE_CONFIGURATION_TYPES)
- set(OUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)
- else()
- set(OUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
- endif()
-
foreach(TEST_FILE IN LISTS TEST_FILES)
set(IN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE})
set(OUT_FILE ${OUT_DIR}/${TEST_FILE})

View File

@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Apr 9 14:51:23 UTC 2025 - Friedrich Haubensak <hsk17@mail.de>
- add nanobind-2.6.1-test-build.patch to fix test on single
processor (boo #1239153)
-------------------------------------------------------------------
Fri Mar 18 18:32:19 UTC 2025 - Friedrich Haubensak <hsk17@mail.de>
- update to release 2.6.1

View File

@@ -26,6 +26,8 @@ URL: https://github.com/wjakob/nanobind
Source: https://github.com/wjakob/nanobind/archive/refs/tags/v%{version}.tar.gz#/nanobind-%{version}.tar.gz
# PATCH-FEATURE-OPENSUSE nanobind-installationpath.patch
Patch1: nanobind-installationpath.patch
# PATCH-FIX_UPSTREAM nanobind-2.6.1-test-build.patch
Patch2: nanobind-2.6.1-test-build.patch
BuildRequires: cmake
BuildRequires: %{python_module base}
BuildRequires: python-rpm-macros