From 5b2a7e9aa36ecdaf784324cb1f510106195d612a Mon Sep 17 00:00:00 2001 From: ThatXliner Date: Tue, 31 Dec 2024 19:57:56 -0800 Subject: [PATCH] :bug: Take 2 --- .github/workflows/release.yml | 1 + aioudp/__init__.py | 2 +- aioudp/connection.py | 4 ++-- pyproject.toml | 2 +- tests/test_connections.py | 5 ++++- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 46bbc9b..ed7e2c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,6 +24,7 @@ jobs: runs-on: ubuntu-latest permissions: id-token: write # IMPORTANT: mandatory for trusted publishing + contents: write needs: - build steps: diff --git a/aioudp/__init__.py b/aioudp/__init__.py index dabdc6d..a8934db 100644 --- a/aioudp/__init__.py +++ b/aioudp/__init__.py @@ -8,4 +8,4 @@ __all__ = ["connect", "serve", "Connection", "exceptions"] -__version__ = "2.0.0-beta3" +__version__ = "2.0.0-beta4" diff --git a/aioudp/connection.py b/aioudp/connection.py index fede772..9cddeae 100644 --- a/aioudp/connection.py +++ b/aioudp/connection.py @@ -21,7 +21,7 @@ class Connection: # TODO(ThatXliner): REFACTOR: minimal args recv_func: Callable[[], Awaitable[bytes | None]] is_closing: Callable[[], bool] get_local_addr: Callable[[], AddrType] - get_remote_addr: Callable[[], None | AddrType] + get_remote_addr: Callable[[], AddrType] closed: bool = False @property @@ -38,7 +38,7 @@ def local_address(self) -> AddrType: return self.get_local_addr() @property - def remote_address(self) -> None | AddrType: + def remote_address(self) -> AddrType: """Returns the remote address of the connection. This is their IP. .. seealso:: diff --git a/pyproject.toml b/pyproject.toml index de408e5..1f95f66 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "aioudp" description = "A better API for asynchronous UDP" authors = ["Bryan Hu "] -version = "2.0.0-beta3" +version = "2.0.0-beta4" readme = "README.md" license = "GPL-3.0-or-later" diff --git a/tests/test_connections.py b/tests/test_connections.py index c5cdc18..f11c150 100644 --- a/tests/test_connections.py +++ b/tests/test_connections.py @@ -1,5 +1,6 @@ import pytest -from hypothesis import assume, given, settings, strategies as st +from hypothesis import assume, given, settings +from hypothesis import strategies as st import aioudp from aioudp import exceptions @@ -16,6 +17,7 @@ async def one_time_echo_server(connection: aioudp.Connection) -> None: @given(data=st.binary()) +@settings(deadline=None) @pytest.mark.asyncio async def test_echo_server(data: bytes): assume(data) @@ -26,6 +28,7 @@ async def test_echo_server(data: bytes): @given(data=st.binary()) +@settings(deadline=None) @pytest.mark.asyncio async def test_recieve_closed_connection(data: bytes): assume(data)