diff --git a/loop.patch b/loop.patch new file mode 100644 index 0000000..49af843 --- /dev/null +++ b/loop.patch @@ -0,0 +1,16 @@ +Index: pyuv-1.4.0/tests/test_loop.py +=================================================================== +--- pyuv-1.4.0.orig/tests/test_loop.py ++++ pyuv-1.4.0/tests/test_loop.py +@@ -48,9 +48,9 @@ class LoopRunTest(TestCase): + prepare.start(prepare_cb) + self.loop.run(pyuv.UV_RUN_DEFAULT) + self.assertEqual(self.timer_called, 1) +- self.assertTrue(self.prepare_called >= 2) ++ self.assertEqual(self.prepare_called, 1) + self.loop.run(pyuv.UV_RUN_NOWAIT) +- self.assertTrue(self.prepare_called >= 3) ++ self.assertEqual(self.prepare_called, 2) + self.loop.run(pyuv.UV_RUN_DEFAULT) + self.assertEqual(self.timer_called, 10) + self.assertEqual(self.prepare_called, 10) diff --git a/python-pyuv.changes b/python-pyuv.changes index f042334..536bfa5 100644 --- a/python-pyuv.changes +++ b/python-pyuv.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Aug 29 10:00:10 UTC 2023 - Markéta Machová + +- Add patch loop.patch to fix the test failure + ------------------------------------------------------------------- Mon Jun 19 17:01:07 UTC 2023 - Scott Bradnick diff --git a/python-pyuv.spec b/python-pyuv.spec index 8366824..f611b70 100644 --- a/python-pyuv.spec +++ b/python-pyuv.spec @@ -28,6 +28,8 @@ Source: https://files.pythonhosted.org/packages/source/p/pyuv/pyuv-%{ver Patch0: tests_async_keyword.patch Patch1: tests_py3.patch Patch2: fix_building_for_Python311.patch +# PATCH-FIX-OPENSUSE mmachova@suse.com https://github.com/saghul/pyuv/issues/279 +Patch3: loop.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} @@ -41,10 +43,7 @@ BuildRequires: pkgconfig(libuv) Python interface for libuv. %prep -%setup -q -n pyuv-%{version} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 +%autosetup -p1 -n pyuv-%{version} # Force system libuv rm -r deps/libuv rmdir deps @@ -56,17 +55,8 @@ sed -i 's:"proc_:"tests/proc_:' tests/test_process.py %build export CFLAGS="%{optflags}" -%{python_expand \ -# fix for py3.10, but it doesn't work for py3.8 and lower -# https://github.com/saghul/pyuv/issues/271 -%if %{$python_version_nodots} > 38 sed -i 's/Py_REFCNT(self) = refcnt/Py_SET_REFCNT(self, refcnt)/' src/handle.c -%else -# what if python3.8 isn't first in the line? -sed -i 's/Py_SET_REFCNT(self, refcnt)/Py_REFCNT(self) = refcnt/' src/handle.c -%endif -$python setup.py build -} +%python_build %install %python_install