diff --git a/numpy-1.20.0-alias-depr.patch b/numpy-1.20.0-alias-depr.patch new file mode 100644 index 0000000000000000000000000000000000000000..c023edf5948679747c89387762a084a715454652 --- /dev/null +++ b/numpy-1.20.0-alias-depr.patch @@ -0,0 +1,42 @@ +From 8ccad121bccd576ecd212efb44109d697024fbf9 Mon Sep 17 00:00:00 2001 +From: aekoroglu +Date: Mon, 5 Sep 2022 16:42:51 +0300 +Subject: [PATCH] deprecated numpy alias + +Refer: https://github.com/hamcrest/PyHamcrest/pull/218 + +--- + tests/hamcrest_unit_test/number/iscloseto_test.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/hamcrest_unit_test/number/iscloseto_test.py b/tests/hamcrest_unit_test/number/iscloseto_test.py +index f83964fd..b82109c5 100644 +--- a/tests/hamcrest_unit_test/number/iscloseto_test.py ++++ b/tests/hamcrest_unit_test/number/iscloseto_test.py +@@ -64,7 +64,7 @@ def testMatcherSupportsDecimal(self): + class IsNumericTest(unittest.TestCase): + @unittest.skipUnless(NUMPY_AVAILABLE, "Skipped because it needs NumPy") + def test_numpy_numeric_type_int(self): +- self.assertTrue(isnumeric(np.int(1)), "Platform integer (normally either int32 or int64)") ++ self.assertTrue(isnumeric(np.int_(1)), "Platform integer (normally either int32 or int64)") + + @unittest.skipUnless(NUMPY_AVAILABLE, "Skipped because it needs NumPy") + def test_numpy_numeric_type_int8(self): +@@ -102,7 +102,7 @@ def test_numpy_numeric_type_uint64(self): + + @unittest.skipUnless(NUMPY_AVAILABLE, "Skipped because it needs NumPy") + def test_numpy_numeric_type_float(self): +- self.assertTrue(isnumeric(np.float(1)), "Shorthand for float64.") ++ self.assertTrue(isnumeric(np.float_(1)), "Shorthand for float64.") + + @unittest.skipUnless(NUMPY_AVAILABLE, "Skipped because it needs NumPy") + def test_numpy_numeric_type_float16(self): +@@ -127,7 +127,7 @@ def test_numpy_numeric_type_float64(self): + + @unittest.skipUnless(NUMPY_AVAILABLE, "Skipped because it needs NumPy") + def test_numpy_numeric_type_complex(self): +- self.assertTrue(isnumeric(np.complex(1)), "Shorthand for complex128.") ++ self.assertTrue(isnumeric(np.complex_(1)), "Shorthand for complex128.") + + @unittest.skipUnless(NUMPY_AVAILABLE, "Skipped because it needs NumPy") + def test_numpy_numeric_type_complex64(self): diff --git a/python-hamcrest.spec b/python-hamcrest.spec index 5091d6eb3d299941d5f30f882d0918968c8cccf4..97f4fd1792ef3f0cffd4b57f8abfd97b7b40c216 100644 --- a/python-hamcrest.spec +++ b/python-hamcrest.spec @@ -1,10 +1,11 @@ Name: python-hamcrest Version: 2.0.3 -Release: 1 +Release: 2 Summary: Hamcrest matchers for Python License: BSD-3-Clause URL: https://github.com/hamcrest/PyHamcrest Source0: https://github.com/hamcrest/PyHamcrest/archive/V2.0.3/%{name}-%{version}.tar.gz +Patch0: numpy-1.20.0-alias-depr.patch BuildArch: noarch %description @@ -46,6 +47,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version} -v %{python3_sitelib}/* %changelog +* Sun Jul 23 2023 wangkai <13474090681@163.com> - 2.0.3-2 +- Fix build error for numpy-1.20 + * Wed Jun 29 2022 yaoxin - 2.0.3-1 - Update to 2.0.3