diff --git a/gh-pr184_tests.patch b/gh-pr184_tests.patch new file mode 100644 index 0000000..d759cd0 --- /dev/null +++ b/gh-pr184_tests.patch @@ -0,0 +1,98 @@ +From 1b229fadbadf3c5d94b0a9a53461ea7157bb1bff Mon Sep 17 00:00:00 2001 +From: Josh Holbrook +Date: Mon, 26 May 2025 11:18:43 -0800 +Subject: [PATCH 1/2] Remove fixture from trio test + +--- + tests/test_trio.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tests/test_trio.py b/tests/test_trio.py +index 4ac814c..3edc54f 100644 +--- a/tests/test_trio.py ++++ b/tests/test_trio.py +@@ -12,7 +12,7 @@ class PyeeTestError(Exception): + + + @pytest.mark.trio +-async def test_trio_emit(): ++async def test_trio_emit() -> None: + """Test that the trio event emitter can handle wrapping + coroutines + """ +@@ -35,7 +35,7 @@ async def event_handler(): + + + @pytest.mark.trio +-async def test_trio_once_emit(): ++async def test_trio_once_emit() -> None: + """Test that trio event emitters also wrap coroutines when + using once + """ +@@ -58,7 +58,7 @@ async def event_handler(): + + + @pytest.mark.trio +-async def test_trio_error(): ++async def test_trio_error() -> None: + """Test that trio event emitters can handle errors when + wrapping coroutines + """ +@@ -86,7 +86,7 @@ async def handle_error(exc): + + + @pytest.mark.trio +-async def test_sync_error(event_loop): ++async def test_sync_error() -> None: + """Test that regular functions have the same error handling as coroutines""" + + async with TrioEventEmitter() as ee: + +From b1624101d42df56177f6b6461e73c20039cb9b92 Mon Sep 17 00:00:00 2001 +From: Josh Holbrook +Date: Mon, 26 May 2025 11:24:41 -0800 +Subject: [PATCH 2/2] Type check trio tests + +--- + tests/test_trio.py | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/tests/test_trio.py b/tests/test_trio.py +index 3edc54f..5c42ec8 100644 +--- a/tests/test_trio.py ++++ b/tests/test_trio.py +@@ -1,5 +1,7 @@ + # -*- coding: utf-8 -*- + ++from typing import NoReturn ++ + import pytest + import pytest_trio.plugin # type: ignore # noqa + import trio +@@ -64,7 +66,7 @@ async def test_trio_error() -> None: + """ + + async with TrioEventEmitter() as ee: +- send, rcv = trio.open_memory_channel(1) ++ send, rcv = trio.open_memory_channel[PyeeTestError](1) + + @ee.on("event") + async def event_handler(): +@@ -90,14 +92,14 @@ async def test_sync_error() -> None: + """Test that regular functions have the same error handling as coroutines""" + + async with TrioEventEmitter() as ee: +- send, rcv = trio.open_memory_channel(1) ++ send, rcv = trio.open_memory_channel[PyeeTestError](1) + + @ee.on("event") +- def sync_handler(): ++ def sync_handler() -> NoReturn: + raise PyeeTestError() + + @ee.on("error") +- async def handle_error(exc): ++ async def handle_error(exc) -> None: + async with send: + await send.send(exc) + diff --git a/pyee-12.1.1.tar.gz b/pyee-12.1.1.tar.gz deleted file mode 100644 index 5efc69c..0000000 --- a/pyee-12.1.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bbc33c09e2ff827f74191e3e5bbc6be7da02f627b7ec30d86f5ce1a6fb2424a3 -size 30915 diff --git a/pyee-13.0.0.tar.gz b/pyee-13.0.0.tar.gz new file mode 100644 index 0000000..2580db6 --- /dev/null +++ b/pyee-13.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b391e3c5a434d1f5118a25615001dbc8f669cf410ab67d04c4d4e07c55481c37 +size 31250 diff --git a/python-pyee.changes b/python-pyee.changes index 58c22b0..74bf5e1 100644 --- a/python-pyee.changes +++ b/python-pyee.changes @@ -1,3 +1,26 @@ +------------------------------------------------------------------- +Fri Jul 11 10:38:21 UTC 2025 - Georg Pfuetzenreuter + +- Add gh-pr184_tests.patch to repair failing tests + +------------------------------------------------------------------- +Sat Jun 28 07:30:03 UTC 2025 - Georg Pfuetzenreuter + +- update to 13.0.0: + * Type checking improvements + * Introduce overloads for ee.on + * Add None return type for functions as appropriate + * Type self as Any in all methods + * Local and CI tasks for type checking with mypy + * mypy type checking passes + * pyright type checking passes + * Addition of mypy to development dependencies + * Removed conditional import of iscoroutine + * This was implemented to support Python 3.3, which was dropped long ago + * Removed type stub for twisted.python.Failure + * This was to address a typing issue in unsupported versions of Twisted + * Export Handler type in pyee/__init__.py + ------------------------------------------------------------------- Tue Feb 25 20:36:45 UTC 2025 - Dirk Müller diff --git a/python-pyee.spec b/python-pyee.spec index 6f355e0..ea77574 100644 --- a/python-pyee.spec +++ b/python-pyee.spec @@ -18,16 +18,17 @@ %{?sle15_python_module_pythons} Name: python-pyee -Version: 12.1.1 +Version: 13.0.0 Release: 0 Summary: A port of node.js's EventEmitter to python License: MIT URL: https://github.com/jfhbrook/pyee Source: https://files.pythonhosted.org/packages/source/p/pyee/pyee-%{version}.tar.gz +# https://github.com/jfhbrook/pyee/pull/184 +Patch0: gh-pr184_tests.patch BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} -BuildRequires: %{python_module vcversioner} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -45,7 +46,7 @@ pyee supplies an ``EventEmitter`` object similar to the ``EventEmitter`` from Node.js. %prep -%setup -q -n pyee-%{version} +%autosetup -n pyee-%{version} -p1 %build %pyproject_wheel