15
0
forked from pool/python-JPype1

Accepting request 1201186 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/1201186
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-JPype1?expand=0&rev=9
This commit is contained in:
2024-09-15 10:38:22 +00:00
committed by Git OBS Bridge
3 changed files with 101 additions and 0 deletions

84
JPype1-numpy2compat.patch Normal file
View File

@@ -0,0 +1,84 @@
diff -rup JPype1-1.5.0.orig/test/jpypetest/test_conversionInt.py JPype1-1.5.0.new/test/jpypetest/test_conversionInt.py
--- JPype1-1.5.0.orig/test/jpypetest/test_conversionInt.py 2023-12-26 06:51:56.000000000 -0500
+++ JPype1-1.5.0.new/test/jpypetest/test_conversionInt.py 2024-09-11 17:03:59.996582210 -0400
@@ -76,7 +76,7 @@ class ConversionIntTestCase(common.JPype
def testIntFromNPFloat(self):
import numpy as np
with self.assertRaises(TypeError):
- self.Test.callInt(np.float_(2))
+ self.Test.callInt(np.float64(2))
@common.unittest.skipUnless(haveNumpy(), "numpy not available")
def testIntFromNPFloat32(self):
diff -rup JPype1-1.5.0.orig/test/jpypetest/test_conversionLong.py JPype1-1.5.0.new/test/jpypetest/test_conversionLong.py
--- JPype1-1.5.0.orig/test/jpypetest/test_conversionLong.py 2023-12-26 06:51:56.000000000 -0500
+++ JPype1-1.5.0.new/test/jpypetest/test_conversionLong.py 2024-09-11 17:03:59.996582210 -0400
@@ -76,7 +76,7 @@ class ConversionLongTestCase(common.JPyp
def testLongFromNPFloat(self):
import numpy as np
with self.assertRaises(TypeError):
- self.Test.callLong(np.float_(2))
+ self.Test.callLong(np.float64(2))
@common.unittest.skipUnless(haveNumpy(), "numpy not available")
def testLongFromNPFloat32(self):
diff -rup JPype1-1.5.0.orig/test/jpypetest/test_conversionShort.py JPype1-1.5.0.new/test/jpypetest/test_conversionShort.py
--- JPype1-1.5.0.orig/test/jpypetest/test_conversionShort.py 2023-12-26 06:51:56.000000000 -0500
+++ JPype1-1.5.0.new/test/jpypetest/test_conversionShort.py 2024-09-11 17:03:59.996582210 -0400
@@ -76,7 +76,7 @@ class ConversionShortTestCase(common.JPy
def testShortFromNPFloat(self):
import numpy as np
with self.assertRaises(TypeError):
- self.Test.callShort(np.float_(2))
+ self.Test.callShort(np.float64(2))
@common.unittest.skipUnless(haveNumpy(), "numpy not available")
def testShortFromNPFloat32(self):
diff -rup JPype1-1.5.0.orig/test/jpypetest/test_jboolean.py JPype1-1.5.0.new/test/jpypetest/test_jboolean.py
--- JPype1-1.5.0.orig/test/jpypetest/test_jboolean.py 2023-12-26 06:51:56.000000000 -0500
+++ JPype1-1.5.0.new/test/jpypetest/test_jboolean.py 2024-09-11 17:03:59.996582210 -0400
@@ -103,7 +103,7 @@ class JBooleanTestCase(common.JPypeTestC
def testBooleanFromNPFloat(self):
import numpy as np
with self.assertRaises(TypeError):
- self.Test.callBoolean(np.float_(2))
+ self.Test.callBoolean(np.float64(2))
@common.requireNumpy
def testBooleanFromNPFloat32(self):
diff -rup JPype1-1.5.0.orig/test/jpypetest/test_jbyte.py JPype1-1.5.0.new/test/jpypetest/test_jbyte.py
--- JPype1-1.5.0.orig/test/jpypetest/test_jbyte.py 2023-12-26 06:51:56.000000000 -0500
+++ JPype1-1.5.0.new/test/jpypetest/test_jbyte.py 2024-09-11 17:03:59.996582210 -0400
@@ -111,7 +111,7 @@ class JByteTestCase(common.JPypeTestCase
def testByteFromNPFloat(self):
import numpy as np
with self.assertRaises(TypeError):
- self.fixture.callByte(np.float_(2))
+ self.fixture.callByte(np.float64(2))
@common.requireNumpy
def testByteFromNPFloat32(self):
diff -rup JPype1-1.5.0.orig/test/jpypetest/test_jdouble.py JPype1-1.5.0.new/test/jpypetest/test_jdouble.py
--- JPype1-1.5.0.orig/test/jpypetest/test_jdouble.py 2023-12-26 06:51:56.000000000 -0500
+++ JPype1-1.5.0.new/test/jpypetest/test_jdouble.py 2024-09-11 17:03:59.996582210 -0400
@@ -375,7 +375,7 @@ class JDoubleTestCase(common.JPypeTestCa
@common.requireNumpy
def testArrayInitFromNPFloat(self):
- a = np.random.random(100).astype(np.float_)
+ a = np.random.random(100).astype(np.float64)
jarr = JArray(JDouble)(a)
self.assertElementsAlmostEqual(a, jarr)
diff -rup JPype1-1.5.0.orig/test/jpypetest/test_jfloat.py JPype1-1.5.0.new/test/jpypetest/test_jfloat.py
--- JPype1-1.5.0.orig/test/jpypetest/test_jfloat.py 2023-12-26 06:51:56.000000000 -0500
+++ JPype1-1.5.0.new/test/jpypetest/test_jfloat.py 2024-09-11 17:03:59.996582210 -0400
@@ -383,7 +383,7 @@ class JFloatTestCase(common.JPypeTestCas
@common.requireNumpy
def testArrayInitFromNPFloat(self):
- a = np.random.random(100).astype(np.float_)
+ a = np.random.random(100).astype(np.float64)
jarr = JArray(JFloat)(a)
self.assertElementsAlmostEqual(a, jarr)

View File

@@ -1,3 +1,17 @@
-------------------------------------------------------------------
Wed Sep 11 21:14:09 UTC 2024 - Fergal Mc Carthy <fmccarthy@suse.com>
- Added patch JPype1-numpy2compat.patch to update the test code
to be numpy 2+ compatible.
- Add a BuildRequires for ca-certificates-mozilla to resolve
a certificates validation error during wheel creation for
Tumbleweed builds.
-------------------------------------------------------------------
Thu Aug 22 14:52:07 UTC 2024 - Aline Werner <aline.werner@suse.com>
- Switch to modern python on sle15.
-------------------------------------------------------------------
Tue Feb 27 01:50:13 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>

View File

@@ -19,6 +19,7 @@
%bcond_without test
# https://build.opensuse.org/package/show/Java:packages/h2database is not in Factory
%bcond_with test_jdbc
%{?sle15_python_module_pythons}
Name: python-JPype1
Version: 1.5.0
Release: 0
@@ -27,11 +28,13 @@ License: Apache-2.0
URL: https://github.com/jpype-project/jpype
Source: https://files.pythonhosted.org/packages/source/J/JPype1/JPype1-%{version}.tar.gz
Patch0: JPype1-java8compat.patch
Patch1: JPype1-numpy2compat.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: ant
BuildRequires: ca-certificates-mozilla
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: java-devel >= 9