Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-pythran for openSUSE:Factory 
checked in at 2023-07-28 22:19:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pythran (Old)
 and      /work/SRC/openSUSE:Factory/.python-pythran.new.32662 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pythran"

Fri Jul 28 22:19:50 2023 rev:10 rq:1101065 version:0.13.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pythran/python-pythran.changes    
2023-06-12 15:24:52.490492360 +0200
+++ /work/SRC/openSUSE:Factory/.python-pythran.new.32662/python-pythran.changes 
2023-07-28 22:19:52.189018391 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 10:10:55 UTC 2023 - Markéta Machová <mmach...@suse.com>
+
+- Add upstream numpy-longdouble.patch and numpy-complex.patch to support new 
numpy
+
+-------------------------------------------------------------------

New:
----
  numpy-complex.patch
  numpy-longdouble.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-pythran.spec ++++++
--- /var/tmp/diff_new_pack.JT37JV/_old  2023-07-28 22:19:52.901022719 +0200
+++ /var/tmp/diff_new_pack.JT37JV/_new  2023-07-28 22:19:52.905022743 +0200
@@ -52,6 +52,10 @@
 # Tests are only availble in github archive
 Source0:        
https://github.com/serge-sans-paille/pythran/archive/refs/tags/%{version}.tar.gz#/pythran-%{version}-gh.tar.gz
 Source99:       python-pythran-rpmlintrc
+#PATCH-FIX-UPSTREAM 
https://github.com/serge-sans-paille/pythran/commit/339fb5dcdf28f40311b5051925fd8a2c86286ac6
 Introduce pythran/pythonic/include/types/longdouble.hpp et cie
+Patch:          numpy-longdouble.patch
+#PATCH-FIX-UPSTREAM 
https://github.com/serge-sans-paille/pythran/commit/a49dc44076f7068205c22f532975c50cc4c03958
 Use npy_creal/npy_cimag from npy_math in from_python::convert
+Patch:          numpy-complex.patch
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros

++++++ numpy-complex.patch ++++++
>From a49dc44076f7068205c22f532975c50cc4c03958 Mon Sep 17 00:00:00 2001
From: Lysandros Nikolaou <lisandros...@gmail.com>
Date: Wed, 19 Jul 2023 13:03:41 +0200
Subject: [PATCH] Use npy_creal/npy_cimag from npy_math in from_python::convert

---
 pythran/pythonic/types/complex.hpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pythran/pythonic/types/complex.hpp 
b/pythran/pythonic/types/complex.hpp
index 9b57f7384..929a3d200 100644
--- a/pythran/pythonic/types/complex.hpp
+++ b/pythran/pythonic/types/complex.hpp
@@ -177,6 +177,7 @@ PYTHONIC_NS_END
 #ifdef ENABLE_PYTHON_MODULE
 
 #include "numpy/arrayscalars.h"
+#include "numpy/npy_math.h"
 #include "pythonic/python/core.hpp"
 
 PYTHONIC_NS_BEGIN
@@ -228,7 +229,7 @@ inline std::complex<long double>
 from_python<std::complex<long double>>::convert(PyObject *obj)
 {
   auto val = PyArrayScalar_VAL(obj, CLongDouble);
-  return {val.real, val.imag};
+  return {npy_creall(val), npy_cimagl(val)};
 }
 
 template <>
@@ -243,7 +244,7 @@ inline std::complex<float>
 from_python<std::complex<float>>::convert(PyObject *obj)
 {
   auto val = PyArrayScalar_VAL(obj, CFloat);
-  return {val.real, val.imag};
+  return {npy_crealf(val), npy_cimagf(val)};
 }
 PYTHONIC_NS_END
 #endif

++++++ numpy-longdouble.patch ++++++
>From 339fb5dcdf28f40311b5051925fd8a2c86286ac6 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <serge.guel...@telecom-bretagne.eu>
Date: Thu, 6 Jul 2023 22:06:20 +0200
Subject: [PATCH] Introduce pythran/pythonic/include/types/longdouble.hpp et
 cie

New numpy version alias np.float128 to np.longdouble, so we need these
headers too. Same for np.complex256 and np.clongdouble.

SLightly adjust notebook tests for portability to that respect.
---
 pythran/pythonic/include/types/clongdouble.hpp |  6 ++++++
 pythran/pythonic/include/types/longdouble.hpp  |  4 ++++
 pythran/pythonic/types/clongdouble.hpp         |  7 +++++++
 pythran/pythonic/types/float128.hpp            |  2 +-
 pythran/pythonic/types/longdouble.hpp          |  6 ++++++
 pythran/tests/notebooks/export.ipynb           | 14 +++++++-------
 6 files changed, 31 insertions(+), 8 deletions(-)
 create mode 100644 pythran/pythonic/include/types/clongdouble.hpp
 create mode 100644 pythran/pythonic/include/types/longdouble.hpp
 create mode 100644 pythran/pythonic/types/clongdouble.hpp
 create mode 100644 pythran/pythonic/types/longdouble.hpp

diff --git a/pythran/pythonic/include/types/clongdouble.hpp 
b/pythran/pythonic/include/types/clongdouble.hpp
new file mode 100644
index 0000000000..dd666a52f5
--- /dev/null
+++ b/pythran/pythonic/include/types/clongdouble.hpp
@@ -0,0 +1,6 @@
+#ifndef PYTHONIC_INCLUDE_TYPES_CLONGDOUBLE_HPP
+#define PYTHONIC_INCLUDE_TYPES_CLONGDOUBLE_HPP
+
+#include "pythonic/include/types/complex.hpp"
+
+#endif
diff --git a/pythran/pythonic/include/types/longdouble.hpp 
b/pythran/pythonic/include/types/longdouble.hpp
new file mode 100644
index 0000000000..1ee2fca96c
--- /dev/null
+++ b/pythran/pythonic/include/types/longdouble.hpp
@@ -0,0 +1,4 @@
+#ifndef PYTHONIC_INCLUDE_TYPES_LONGDOUBLE_HPP
+#define PYTHONIC_INCLUDE_TYPES_LONGDOUBLE_HPP
+
+#endif
diff --git a/pythran/pythonic/types/clongdouble.hpp 
b/pythran/pythonic/types/clongdouble.hpp
new file mode 100644
index 0000000000..057a2b9cb6
--- /dev/null
+++ b/pythran/pythonic/types/clongdouble.hpp
@@ -0,0 +1,7 @@
+#ifndef PYTHONIC_TYPES_CLONGDOUBLE_HPP
+#define PYTHONIC_TYPES_CLONGDOUBLE_HPP
+
+#include "pythonic/include/types/clongdouble.hpp"
+#include "pythonic/types/complex.hpp"
+
+#endif
diff --git a/pythran/pythonic/types/float128.hpp 
b/pythran/pythonic/types/float128.hpp
index bf67552447..0943827ff3 100644
--- a/pythran/pythonic/types/float128.hpp
+++ b/pythran/pythonic/types/float128.hpp
@@ -1,6 +1,6 @@
 #ifndef PYTHONIC_TYPES_FLOAT128_HPP
 #define PYTHONIC_TYPES_FLOAT128_HPP
 
-#include "pythonic/include/types/float64.hpp"
+#include "pythonic/include/types/float128.hpp"
 
 #endif
diff --git a/pythran/pythonic/types/longdouble.hpp 
b/pythran/pythonic/types/longdouble.hpp
new file mode 100644
index 0000000000..b3944cea6a
--- /dev/null
+++ b/pythran/pythonic/types/longdouble.hpp
@@ -0,0 +1,6 @@
+#ifndef PYTHONIC_TYPES_LONGDOUBLE_HPP
+#define PYTHONIC_TYPES_LONGDOUBLE_HPP
+
+#include "pythonic/include/types/longdouble.hpp"
+
+#endif
diff --git a/pythran/tests/notebooks/export.ipynb 
b/pythran/tests/notebooks/export.ipynb
index aa2baadc06..3f390dc0f1 100644
--- a/pythran/tests/notebooks/export.ipynb
+++ b/pythran/tests/notebooks/export.ipynb
@@ -418,20 +418,20 @@
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "(1.5, -1.5) <class 'numpy.float32'>\n",
-      "(1.5, -1.5) <class 'float'>\n",
-      "(1.5, -1.5) <class 'numpy.float128'>\n"
+      "(1.5, -1.5)\n",
+      "(1.5, -1.5)\n",
+      "(1.5, -1.5)\n"
      ]
     }
    ],
    "source": [
     "import numpy as np\n",
     "x64 = dtype(np.complex64(1.5 + -1.5j))\n",
-    "print(x64, type(x64[0]))\n",
+    "print(x64)\n",
     "x128 = dtype(np.complex128(1.5 + -1.5j))\n",
-    "print(x128, type(x128[0]))\n",
+    "print(x128)\n",
     "x256 = dtype(np.complex256(1.5 + -1.5j))\n",
-    "print(x256, type(x256[0]))"
+    "print(x256)"
    ]
   },
   {
@@ -969,7 +969,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.10.9"
+   "version": "3.10.11"
   }
  },
  "nbformat": 4,

Reply via email to