[packages/python3-pyhamcrest] - added upstream patch for numpy 2.x compatibility, updated dependencies

qboosh qboosh at pld-linux.org
Thu Mar 12 21:57:27 CET 2026


commit 417c4300ea1b57391f68cf90fa5666d567695fe5
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Mar 12 21:57:35 2026 +0100

    - added upstream patch for numpy 2.x compatibility, updated dependencies

 pyhamcrest-numpy2.patch | 36 ++++++++++++++++++++++++++++++++++++
 python3-pyhamcrest.spec | 22 ++++++++++++++++------
 2 files changed, 52 insertions(+), 6 deletions(-)
---
diff --git a/python3-pyhamcrest.spec b/python3-pyhamcrest.spec
index 3949994..b08d3cb 100644
--- a/python3-pyhamcrest.spec
+++ b/python3-pyhamcrest.spec
@@ -13,21 +13,30 @@ Group:		Libraries/Python
 #Source0Download: https://pypi.org/simple/pyhamcrest/
 Source0:	https://files.pythonhosted.org/packages/source/p/pyhamcrest/pyhamcrest-%{version}.tar.gz
 # Source0-md5:	c731efc9bcb93ef4f73d110f5ca8e844
+Patch0:		pyhamcrest-numpy2.patch
 URL:		https://pypi.org/project/PyHamcrest/
 BuildRequires:	python3-build
+BuildRequires:	python3-hatch-vcs
+BuildRequires:	python3-hatchling
 BuildRequires:	python3-installer
-BuildRequires:	python3-modules >= 1:3.5
+BuildRequires:	python3-modules >= 1:3.6
 %if %{with tests}
+BuildRequires:	python3-PyYAML
+%if "%{py3_ver}" == "3.6"
+BuildRequires:	python3-dataclasses
+%endif
+BuildRequires:	python3-numpy
 BuildRequires:	python3-pytest >= 5.0
 #BuildRequires:	python3-pytest-sugar
+#BuildRequires:	python3-pytest-xdist
 %endif
 BuildRequires:	rpm-pythonprov
-BuildRequires:	rpmbuild(macros) >= 1.714
+BuildRequires:	rpmbuild(macros) >= 2.044
 %if %{with doc}
 BuildRequires:	python3-alabaster >= 0.7
-BuildRequires:	sphinx-pdg-3 >= 3.0
+BuildRequires:	sphinx-pdg-3 >= 4.0
 %endif
-Requires:	python3-modules >= 1:3.5
+Requires:	python3-modules >= 1:3.6
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -58,6 +67,7 @@ Dokumentacja API modułu Pythona pyhamcrest.
 
 %prep
 %setup -q -n pyhamcrest-%{version}
+%patch -P0 -p1
 
 %build
 %py3_build_pyproject
@@ -80,7 +90,7 @@ rm -rf $RPM_BUILD_ROOT
 %py3_install_pyproject
 
 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-pyhamcrest-%{version}
-cp -a examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-pyhamcrest-%{version}
+cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-pyhamcrest-%{version}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -95,5 +105,5 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with doc}
 %files apidocs
 %defattr(644,root,root,755)
-%doc doc/_build/html/{_static,*.html,*.js}
+%doc doc/_build/html/{_static,matcher_internals,matcher_library,*.html,*.js}
 %endif
diff --git a/pyhamcrest-numpy2.patch b/pyhamcrest-numpy2.patch
new file mode 100644
index 0000000..d758efa
--- /dev/null
+++ b/pyhamcrest-numpy2.patch
@@ -0,0 +1,36 @@
+From b45547101b82d1c8fc126c7425c5a532f683766e Mon Sep 17 00:00:00 2001
+From: Simon Brunning <simon at brunningonline.net>
+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(
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-pyhamcrest.git/commitdiff/417c4300ea1b57391f68cf90fa5666d567695fe5



More information about the pld-cvs-commit mailing list