diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ca2ced45..2bd50c07 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -68,7 +68,7 @@ jobs: - run: | mk python-release owner=vkottler \ - repo=runtimepy version=2.14.3 + repo=runtimepy version=3.0.0 if: | matrix.python-version == '3.11' && matrix.system == 'ubuntu-latest' diff --git a/README.md b/README.md index f474c984..08eef1e7 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ ===================================== generator=datazen version=3.1.4 - hash=0eec08fe9632a2521fd0073da5b804b9 + hash=610bd14e939eb969ca263a9120a3bf74 ===================================== --> -# runtimepy ([2.14.3](https://pypi.org/project/runtimepy/)) +# runtimepy ([3.0.0](https://pypi.org/project/runtimepy/)) [![python](https://img.shields.io/pypi/pyversions/runtimepy.svg)](https://pypi.org/project/runtimepy/) ![Build Status](https://github.com/vkottler/runtimepy/workflows/Python%20Package/badge.svg) diff --git a/config b/config index db8aa681..782e1018 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit db8aa681a32fa6918db2c1e68adb51edae0ae0e1 +Subproject commit 782e1018098eb7faedb6936e59bbd839f1e5c111 diff --git a/local/variables/package.yaml b/local/variables/package.yaml index b92787db..4def9270 100644 --- a/local/variables/package.yaml +++ b/local/variables/package.yaml @@ -1,5 +1,5 @@ --- -major: 2 -minor: 14 -patch: 3 +major: 3 +minor: 0 +patch: 0 entry: runtimepy diff --git a/pyproject.toml b/pyproject.toml index 136d27a0..7fa7b5df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta:__legacy__" [project] name = "runtimepy" -version = "2.14.3" +version = "3.0.0" description = "A framework for implementing Python services." readme = "README.md" requires-python = ">=3.11" diff --git a/runtimepy/__init__.py b/runtimepy/__init__.py index 7eaba86f..fdd87047 100644 --- a/runtimepy/__init__.py +++ b/runtimepy/__init__.py @@ -1,7 +1,7 @@ # ===================================== # generator=datazen # version=3.1.4 -# hash=d4f579524fe603dbd5b373ea2364b9e3 +# hash=4e93b895f12cc33656430fad15c424e5 # ===================================== """ @@ -10,7 +10,7 @@ DESCRIPTION = "A framework for implementing Python services." PKG_NAME = "runtimepy" -VERSION = "2.14.3" +VERSION = "3.0.0" # runtimepy-specific content. METRICS_NAME = "metrics" diff --git a/runtimepy/net/arbiter/factory/connection.py b/runtimepy/net/arbiter/factory/connection.py index 8bad69d4..6c60d407 100644 --- a/runtimepy/net/arbiter/factory/connection.py +++ b/runtimepy/net/arbiter/factory/connection.py @@ -23,7 +23,7 @@ class ConnectionFactory: """An interface for creating client connections.""" - async def client(self, *args, **kwargs) -> _Connection: + async def client(self, name: str, *args, **kwargs) -> _Connection: """Create a client connection.""" raise NotImplementedError @@ -91,7 +91,7 @@ async def factory_client( if factory in self._conn_factories: factory_inst = self._conn_factories[factory] - conn = factory_inst.client(*args, **kwargs) + conn = factory_inst.client(name, *args, **kwargs) if not defer: conn = await conn # type: ignore diff --git a/runtimepy/net/arbiter/tcp/__init__.py b/runtimepy/net/arbiter/tcp/__init__.py index 3fb27699..2b62e434 100644 --- a/runtimepy/net/arbiter/tcp/__init__.py +++ b/runtimepy/net/arbiter/tcp/__init__.py @@ -25,9 +25,10 @@ class TcpConnectionFactory(_ConnectionFactory, _Generic[T]): kind: _Type[T] - async def client(self, *args, **kwargs) -> _Connection: + async def client(self, name: str, *args, **kwargs) -> _Connection: """Create a client connection.""" + del name assert not [*args], "Only keyword arguments are used!" return await self.kind.create_connection(**kwargs) diff --git a/runtimepy/net/arbiter/udp.py b/runtimepy/net/arbiter/udp.py index 60e9387e..8df8bad0 100644 --- a/runtimepy/net/arbiter/udp.py +++ b/runtimepy/net/arbiter/udp.py @@ -24,8 +24,9 @@ class UdpConnectionFactory( kind: _Type[T] - async def client(self, *args, **kwargs) -> _Connection: + async def client(self, name: str, *args, **kwargs) -> _Connection: """Create a client connection.""" + del name assert not [*args], "Only keyword arguments are used!" return await self.kind.create_connection(**kwargs) diff --git a/runtimepy/net/arbiter/websocket.py b/runtimepy/net/arbiter/websocket.py index 1d99af60..13c17415 100644 --- a/runtimepy/net/arbiter/websocket.py +++ b/runtimepy/net/arbiter/websocket.py @@ -28,8 +28,10 @@ class WebsocketConnectionFactory(_ConnectionFactory, _Generic[T]): kind: _Type[T] - async def client(self, *args, **kwargs) -> _Connection: + async def client(self, name: str, *args, **kwargs) -> _Connection: """Create a client connection.""" + + del name return await self.kind.create_connection(*args, **kwargs) async def server_task( diff --git a/tests/net/arbiter/test_factory.py b/tests/net/arbiter/test_factory.py index 54994294..dc6aa698 100644 --- a/tests/net/arbiter/test_factory.py +++ b/tests/net/arbiter/test_factory.py @@ -16,7 +16,7 @@ async def test_connection_factory_basic(): factory = ConnectionFactory() with raises(NotImplementedError): - await factory.client() + await factory.client("test") with raises(NotImplementedError): await factory.server_task(None, None, None) # type: ignore