From a8595b73f175bf1cbe21f1a8bc92af41cdac67fb Mon Sep 17 00:00:00 2001 From: starlet-dx <15929766099@163.com> Date: Mon, 16 Jun 2025 17:17:19 +0800 Subject: [PATCH] Remove obsolete numpy shorthand types which were removed in numpy 2.0 --- ...numpy-shorthand-types-which-were-rem.patch | 36 +++++++++++++++++++ python-hamcrest.spec | 7 +++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 Remove-obsolete-numpy-shorthand-types-which-were-rem.patch diff --git a/Remove-obsolete-numpy-shorthand-types-which-were-rem.patch b/Remove-obsolete-numpy-shorthand-types-which-were-rem.patch new file mode 100644 index 0000000..d758efa --- /dev/null +++ b/Remove-obsolete-numpy-shorthand-types-which-were-rem.patch @@ -0,0 +1,36 @@ +From b45547101b82d1c8fc126c7425c5a532f683766e Mon Sep 17 00:00:00 2001 +From: Simon Brunning +Date: Tue, 18 Jun 2024 15:45:48 +0100 +Subject: [PATCH] Remove obsolete numpy shorthand types which were removed in + numpy 2.0 + +--- + tests/hamcrest_unit_test/number/iscloseto_test.py | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/tests/hamcrest_unit_test/number/iscloseto_test.py b/tests/hamcrest_unit_test/number/iscloseto_test.py +index b82109c..b5727f5 100644 +--- a/tests/hamcrest_unit_test/number/iscloseto_test.py ++++ b/tests/hamcrest_unit_test/number/iscloseto_test.py +@@ -100,10 +100,6 @@ def test_numpy_numeric_type_uint32(self): + def test_numpy_numeric_type_uint64(self): + self.assertTrue(isnumeric(np.uint64(1)), "Unsigned integer (0 to 18446744073709551615)") + +- @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.") +- + @unittest.skipUnless(NUMPY_AVAILABLE, "Skipped because it needs NumPy") + def test_numpy_numeric_type_float16(self): + self.assertTrue( +@@ -125,10 +121,6 @@ def test_numpy_numeric_type_float64(self): + "Double precision float: sign bit, 11 bits exponent, 52 bits mantissa", + ) + +- @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.") +- + @unittest.skipUnless(NUMPY_AVAILABLE, "Skipped because it needs NumPy") + def test_numpy_numeric_type_complex64(self): + self.assertTrue( diff --git a/python-hamcrest.spec b/python-hamcrest.spec index a758de2..c0552c2 100644 --- a/python-hamcrest.spec +++ b/python-hamcrest.spec @@ -1,10 +1,12 @@ Name: python-hamcrest Version: 2.1.0 -Release: 1 +Release: 2 Summary: Hamcrest matchers for Python License: BSD-3-Clause URL: https://github.com/hamcrest/PyHamcrest Source0: %{pypi_source pyhamcrest} +# https://github.com/hamcrest/PyHamcrest/pull/248 +Patch0: Remove-obsolete-numpy-shorthand-types-which-were-rem.patch BuildArch: noarch %description @@ -49,6 +51,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version} -v %{python3_sitelib}/* %changelog +* Thu Jun 19 2025 yaoxin <1024769339@qq.com> - 2.1.0-2 +- Remove obsolete numpy shorthand types which were removed in numpy 2.0 + * Wed Sep 04 2024 Ge Wang - 2.1.0-1 - Update package to version 2.1.0 -- Gitee