python3.12
authorDebian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Thu, 15 Aug 2024 17:00:00 +0000 (19:00 +0200)
committerSantiago Vila <sanvila@debian.org>
Thu, 15 Aug 2024 17:00:00 +0000 (19:00 +0200)
commit 00ca8f455e6a5588d905e3a0b268f18ee3fda5dd
Author: Sérgio M. Basto <sergio@serjux.com>
Date:   Sun Oct 1 16:12:25 2023 +0100

    `numpy.distutils` is removed in numpy 1.26 on Python 3.12.

    so we don't use numpy.distutils to get includes dirs of python-numpy

Gbp-Pq: Name python3.12.patch

cmake/OpenCVDetectPython.cmake

index 6e7bb18c1ba618863af48b804a410c0091580ef9..383882046394b17f1b0a1bb10e299fd902a09c0d 100644 (file)
@@ -216,7 +216,7 @@ if(NOT ${found})
           message(STATUS "  PYTHON3_NUMPY_INCLUDE_DIRS")
         else()
           # Attempt to discover the NumPy include directory. If this succeeds, then build python API with NumPy
-          execute_process(COMMAND "${_executable}" -c "import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print(os.pathsep.join(numpy.distutils.misc_util.get_numpy_include_dirs()))"
+          execute_process(COMMAND "${_executable}" -c "import numpy; print(numpy.get_include())"
                           RESULT_VARIABLE _numpy_process
                           OUTPUT_VARIABLE _numpy_include_dirs
                           OUTPUT_STRIP_TRAILING_WHITESPACE)