From db00030ad236d90fca4d4134de6759b19ead358c Mon Sep 17 00:00:00 2001 From: Andre Weber <138565883+wba2hi@users.noreply.github.com> Date: Wed, 8 May 2024 15:50:55 +0200 Subject: [PATCH] Subscription not providing Updates for Array Types (#27) * Fix Subscription not providing Updates for Array Types closes: #26 --- kuksa-client/kuksa_client/cli_backend/grpc.py | 2 +- kuksa-client/kuksa_client/grpc/__init__.py | 2 +- kuksa-client/pyproject.toml | 2 +- kuksa-client/requirements.txt | 32 ++++---- kuksa-client/setup.cfg | 2 +- kuksa-client/test-requirements.txt | 80 +++++++++---------- 6 files changed, 54 insertions(+), 66 deletions(-) diff --git a/kuksa-client/kuksa_client/cli_backend/grpc.py b/kuksa-client/kuksa_client/cli_backend/grpc.py index 92efcc9..564baad 100644 --- a/kuksa-client/kuksa_client/cli_backend/grpc.py +++ b/kuksa-client/kuksa_client/cli_backend/grpc.py @@ -38,7 +38,7 @@ def callback_wrapper(callback: Callable[[str], None]) -> Callable[[Iterable[EntryUpdate]], None]: def wrapper(updates: Iterable[EntryUpdate]) -> None: - callback(json.dumps([update.to_dict() for update in updates])) + callback(json.dumps([update.to_dict() for update in updates], cls=DatabrokerEncoder)) return wrapper diff --git a/kuksa-client/kuksa_client/grpc/__init__.py b/kuksa-client/kuksa_client/grpc/__init__.py index 7799592..f2f569f 100644 --- a/kuksa-client/kuksa_client/grpc/__init__.py +++ b/kuksa-client/kuksa_client/grpc/__init__.py @@ -331,7 +331,7 @@ def from_message(cls, message: types_pb2.Datapoint): timestamp = message.timestamp.ToDatetime( tzinfo=datetime.timezone.utc, ) - except OverflowError: + except ValueError: logger.error("Timestamp %d out of accepted range, value ignored!", message.timestamp.seconds) diff --git a/kuksa-client/pyproject.toml b/kuksa-client/pyproject.toml index 95bec9c..a7afaca 100644 --- a/kuksa-client/pyproject.toml +++ b/kuksa-client/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "grpcio-tools>=1.54.2", + "grpcio-tools>=1.63.0", "setuptools>=42", "setuptools-git-versioning", "wheel", diff --git a/kuksa-client/requirements.txt b/kuksa-client/requirements.txt index 0337b90..d822e79 100644 --- a/kuksa-client/requirements.txt +++ b/kuksa-client/requirements.txt @@ -2,36 +2,32 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile --resolver=backtracking setup.cfg +# pip-compile setup.cfg # -attrs==23.1.0 +attrs==23.2.0 # via cmd2 cmd2==1.5.0 - # via kuksa-client (setup.cfg) + # via kuksa_client (setup.cfg) colorama==0.4.6 # via cmd2 -decorator==5.1.1 - # via jsonpath-ng -grpcio==1.56.2 +grpcio==1.63.0 # via grpcio-tools -grpcio-tools==1.56.2 - # via kuksa-client (setup.cfg) -jsonpath-ng==1.5.3 - # via kuksa-client (setup.cfg) +grpcio-tools==1.63.0 + # via kuksa_client (setup.cfg) +jsonpath-ng==1.6.1 + # via kuksa_client (setup.cfg) ply==3.11 # via jsonpath-ng -protobuf==4.23.4 +protobuf==5.26.1 # via grpcio-tools -pygments==2.15.1 - # via kuksa-client (setup.cfg) +pygments==2.18.0 + # via kuksa_client (setup.cfg) pyperclip==1.8.2 # via cmd2 -six==1.16.0 - # via jsonpath-ng -wcwidth==0.2.6 +wcwidth==0.2.13 # via cmd2 -websockets==11.0.3 - # via kuksa-client (setup.cfg) +websockets==12.0 + # via kuksa_client (setup.cfg) # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/kuksa-client/setup.cfg b/kuksa-client/setup.cfg index c90a109..d79c1a7 100644 --- a/kuksa-client/setup.cfg +++ b/kuksa-client/setup.cfg @@ -27,7 +27,7 @@ install_requires = websockets >= 10.1 cmd2 >= 1.4, <2.0 pygments >= 2.15 - grpcio-tools >= 1.54.2 + grpcio-tools >= 1.63.0 jsonpath-ng >= 1.5.3 packages = find: diff --git a/kuksa-client/test-requirements.txt b/kuksa-client/test-requirements.txt index f97e362..7043bc4 100644 --- a/kuksa-client/test-requirements.txt +++ b/kuksa-client/test-requirements.txt @@ -2,86 +2,78 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile --extra=test --output-file=test-requirements.txt --resolver=backtracking setup.cfg +# pip-compile --extra=test --output-file=test-requirements.txt setup.cfg # -astroid==2.15.6 +astroid==3.1.0 # via pylint -attrs==23.1.0 +attrs==23.2.0 # via cmd2 cmd2==1.5.0 - # via kuksa-client (setup.cfg) + # via kuksa_client (setup.cfg) colorama==0.4.6 # via cmd2 -coverage[toml]==7.2.7 +coverage[toml]==7.5.1 # via pytest-cov -decorator==5.1.1 - # via jsonpath-ng -dill==0.3.6 +dill==0.3.8 # via pylint -exceptiongroup==1.1.2 +exceptiongroup==1.2.1 # via pytest -grpcio==1.56.2 +grpcio==1.63.0 # via grpcio-tools -grpcio-tools==1.56.2 - # via kuksa-client (setup.cfg) +grpcio-tools==1.63.0 + # via kuksa_client (setup.cfg) iniconfig==2.0.0 # via pytest -isort==5.12.0 +isort==5.13.2 # via pylint -jsonpath-ng==1.5.3 - # via kuksa-client (setup.cfg) -lazy-object-proxy==1.9.0 - # via astroid +jsonpath-ng==1.6.1 + # via kuksa_client (setup.cfg) mccabe==0.7.0 # via pylint -packaging==23.1 +packaging==24.0 # via pytest -platformdirs==3.9.1 +platformdirs==4.2.1 # via pylint -pluggy==1.2.0 +pluggy==1.5.0 # via pytest ply==3.11 # via jsonpath-ng -protobuf==4.23.4 +protobuf==5.26.1 # via grpcio-tools -pygments==2.15.1 - # via kuksa-client (setup.cfg) -pylint==2.17.4 - # via kuksa-client (setup.cfg) +pygments==2.18.0 + # via kuksa_client (setup.cfg) +pylint==3.1.0 + # via kuksa_client (setup.cfg) pyperclip==1.8.2 # via cmd2 -pytest==7.4.0 +pytest==8.2.0 # via - # kuksa-client (setup.cfg) + # kuksa_client (setup.cfg) # pytest-asyncio # pytest-cov # pytest-mock # pytest-timeout -pytest-asyncio==0.21.1 - # via kuksa-client (setup.cfg) -pytest-cov==4.1.0 - # via kuksa-client (setup.cfg) -pytest-mock==3.11.1 - # via kuksa-client (setup.cfg) -pytest-timeout==2.1.0 - # via kuksa-client (setup.cfg) -six==1.16.0 - # via jsonpath-ng +pytest-asyncio==0.23.6 + # via kuksa_client (setup.cfg) +pytest-cov==5.0.0 + # via kuksa_client (setup.cfg) +pytest-mock==3.14.0 + # via kuksa_client (setup.cfg) +pytest-timeout==2.3.1 + # via kuksa_client (setup.cfg) tomli==2.0.1 # via # coverage # pylint # pytest -tomlkit==0.11.8 +tomlkit==0.12.4 # via pylint -typing-extensions==4.7.1 +typing-extensions==4.11.0 # via astroid -wcwidth==0.2.6 +wcwidth==0.2.13 # via cmd2 -websockets==11.0.3 - # via kuksa-client (setup.cfg) -wrapt==1.15.0 - # via astroid +websockets==12.0 + # via kuksa_client (setup.cfg) # The following packages are considered to be unsafe in a requirements file: # setuptools