diff --git a/Remove-test-cov-arguments-to-fix-pytest-unrecognized-arguments.patch b/Remove-test-cov-arguments-to-fix-pytest-unrecognized-arguments.patch new file mode 100644 index 0000000000000000000000000000000000000000..42ce3b0b40ff0ecef7e7a38abf3a8f6e4e67e403 --- /dev/null +++ b/Remove-test-cov-arguments-to-fix-pytest-unrecognized-arguments.patch @@ -0,0 +1,27 @@ +From 7f1ec37c0b926eeda0b2625b99e535416d27501b Mon Sep 17 00:00:00 2001 +From: cherry530 <707078654@qq.com> +Date: Tue, 10 Dec 2024 15:13:49 +0800 +Subject: [PATCH] Remove test --cov=urwid arguments +to fix pytest: error: unrecognized arguments: --cov=urwid + +Signed-off-by: cherry530 <707078654@qq.com> +--- + pyproject.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyproject.toml b/pyproject.toml +index 04ec25a..3017960 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -75,7 +75,7 @@ line-length = 120 + + [tool.pytest.ini_options] + minversion = "6.0" +-addopts = "-vvvv --doctest-modules -s --cov=urwid" ++addopts = "-vvvv --doctest-modules -s" + doctest_optionflags = ["ELLIPSIS", "IGNORE_EXCEPTION_DETAIL"] + testpaths = ["urwid"] + +-- +2.47.1 + diff --git a/fix-test-failure-due-to-python11.patch b/fix-test-failure-due-to-python11.patch deleted file mode 100644 index e1159de6ec9eb889922664d32eba67e574c96fb6..0000000000000000000000000000000000000000 --- a/fix-test-failure-due-to-python11.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- urwid-2.1.2.orig/urwid/tests/test_event_loops.py -+++ urwid-2.1.2/urwid/tests/test_event_loops.py -@@ -201,15 +201,14 @@ else: - evl.alarm(0.5, lambda: 1 / 0) # Simulate error in event loop - self.assertRaises(ZeroDivisionError, evl.run) - -- def test_coroutine_error(self): -+ async def test_coroutine_error(self): - evl = self.evl - -- @asyncio.coroutine -- def error_coro(): -+ async def error_coro(): - result = 1 / 0 # Simulate error in coroutine - yield result - -- asyncio.ensure_future(error_coro()) -+ asyncio.ensure_future(await error_coro()) - self.assertRaises(ZeroDivisionError, evl.run) diff --git a/fix-use-trio-lowlevel-instead-of-trio.patch b/fix-use-trio-lowlevel-instead-of-trio.patch deleted file mode 100644 index f2f97217ca6ccee48ea1417e25a843a013b89a41..0000000000000000000000000000000000000000 --- a/fix-use-trio-lowlevel-instead-of-trio.patch +++ /dev/null @@ -1,53 +0,0 @@ -From a57465c94ba3a401531853b42e1bd071bcd2e93c Mon Sep 17 00:00:00 2001 -From: Tamas Nepusz -Date: Mon, 2 Nov 2020 15:48:51 +0100 -Subject: [PATCH] fix: use trio.lowlevel instead of trio.hazmat with Trio >= - 0.15 - ---- - urwid/_async_kw_event_loop.py | 18 +++++++++++++++--- - 1 file changed, 15 insertions(+), 3 deletions(-) - -diff --git a/urwid/_async_kw_event_loop.py b/urwid/_async_kw_event_loop.py -index d146a49..4038405 100644 ---- a/urwid/_async_kw_event_loop.py -+++ b/urwid/_async_kw_event_loop.py -@@ -42,7 +42,11 @@ class TrioEventLoop(EventLoop): - self._nursery = None - - self._sleep = trio.sleep -- self._wait_readable = trio.hazmat.wait_readable -+ try: -+ self._wait_readable = trio.lowlevel.wait_readable -+ except AttributeError: -+ # Trio 0.14 or older -+ self._wait_readable = trio.hazmat.wait_readable - - def alarm(self, seconds, callback): - """Calls `callback()` a given time from now. No parameters are passed -@@ -155,12 +159,20 @@ class TrioEventLoop(EventLoop): - - emulate_idle_callbacks = TrioIdleCallbackInstrument() - -+ try: -+ add_instrument = self._trio.lowlevel.add_instrument -+ remove_instrument = self._trio.lowlevel.remove_instrument -+ except AttributeError: -+ # Trio 0.14 or older -+ add_instrument = self._trio.hazmat.add_instrument -+ remove_instrument = self._trio.hazmat.remove_instrument -+ - with self._trio.MultiError.catch(self._handle_main_loop_exception): -- self._trio.hazmat.add_instrument(emulate_idle_callbacks) -+ add_instrument(emulate_idle_callbacks) - try: - await self._main_task() - finally: -- self._trio.hazmat.remove_instrument(emulate_idle_callbacks) -+ remove_instrument(emulate_idle_callbacks) - - def watch_file(self, fd, callback): - """Calls `callback()` when the given file descriptor has some data --- -2.39.0.windows.2 - diff --git a/python-urwid.spec b/python-urwid.spec index cd409020328c0af4bf6386a314cfbf083974946d..ee1381db3442989a0ba511f223a644ffdb01d1fe 100644 --- a/python-urwid.spec +++ b/python-urwid.spec @@ -1,13 +1,18 @@ +%define debug_package %{nil} + Name: python-urwid -Version: 2.1.2 -Release: 5 +Version: 2.6.16 +Release: 1 Summary: Console user interface library License: LGPLv2+ URL: http://excess.org/urwid/ + Source0: https://pypi.python.org/packages/source/u/urwid/urwid-%{version}.tar.gz -Patch0: fix-use-trio-lowlevel-instead-of-trio.patch Patch1: Add-script-for-detecting-character-widths-and-dumping-width-tables.patch -Patch2: fix-test-failure-due-to-python11.patch +Patch2: Remove-test-cov-arguments-to-fix-pytest-unrecognized-arguments.patch + +BuildRequires: python3-pip python3-hatchling python3-hatch-vcs python3-wheel +BuildRequires: python3-wcwidth python3-pytest %description Urwid is a console user interface library for Python. It includes @@ -28,21 +33,30 @@ find urwid -type f -name "*.py" -exec sed -i -e '/^#!\//, 1d' {} \; find urwid -type f -name "*.py" -exec chmod 644 {} \; %build -%py3_build +%pyproject_build find examples -type f -exec chmod 0644 \{\} \; -%check -PYTHON=%{__python3} %{__python3} setup.py test - %install -%py3_install +%pyproject_install + +%check +%pytest tests/ %files -n python3-urwid %doc README.rst examples docs COPYING -%{python3_sitearch}/urwid -%{python3_sitearch}/urwid-%{version}*.egg-info +%{python3_sitelib}/urwid* %changelog +* Tue Dec 10 2024 xu_ping<707078654@qq.com> - 2.6.16-1 +- Upgrade version to 2.6.16 + * Support relative scroll for ListBox + * Fix regression in TreeWidget: original widget can be overridden + * Do not use deprecated positioning in the code and examples + * Prevent a possible infinite loop in WidgetDecoration.base_widget + * Adopt ExceptionGroup handling without an external library in python 3.11+ + * Disable mouse tracking and discard input when exiting the main loop + * use "target encoding" while transcoding for output + * Sat Jul 22 2023 xu_ping<707078654@qq.com> - 2.1.2-5 - fix test failure due to python11 diff --git a/urwid-2.1.2.tar.gz b/urwid-2.1.2.tar.gz deleted file mode 100644 index 4ae0a47b9b885ac00653a58cd060d7b3764084a2..0000000000000000000000000000000000000000 Binary files a/urwid-2.1.2.tar.gz and /dev/null differ diff --git a/urwid-2.6.16.tar.gz b/urwid-2.6.16.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8f1f843e7b0b4fcf49549adaab8e3e89f6d7d28a Binary files /dev/null and b/urwid-2.6.16.tar.gz differ