Skip to content

Commit

Permalink
Revert introduced errors in message and test_message and fix more myp…
Browse files Browse the repository at this point in the history
…y issues.
  • Loading branch information
BenediktBurger committed Jul 13, 2023
1 parent 8b02176 commit 75c9d10
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# mypy: ignore-errors
#
# PyLeco documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 6 13:06:00 2015.
Expand Down
2 changes: 1 addition & 1 deletion pyleco/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# If a user has setuptools_scm installed, assume they want the most up to date version string.
# Alternatively, we could use a dummy dev module that is never packaged whose presence signals
# that we are in an editable install/repo, see https://github.com/pycalphad/pycalphad/pull/341
import setuptools_scm
import setuptools_scm # type: ignore
__version__ = setuptools_scm.get_version(root='..', relative_to=__file__)
del setuptools_scm
except (ImportError, LookupError):
Expand Down
4 changes: 2 additions & 2 deletions pyleco/core/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ class Message:
- 0 or more `payload` frames
If you do not specify a sender, the sending program shall add it itself.
The :attr:`data` attribute is the content of the first :attr:`payload` frame. It can be set with asfd asd
The :attr:`data` attribute is the content of the first :attr:`payload` frame. It can be set with
the corresponding argument.
All attributes, except the official frames, are for convenience.
"""

version: bytes = VERSION_B
receiver: str
receiver: bytes
sender: bytes
header: bytes
payload: list[bytes]
Expand Down
4 changes: 2 additions & 2 deletions pyleco/core/rpc_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

from typing import Any

from jsonrpc2pyclient._irpcclient import IRPCClient
from jsonrpc2pyclient._irpcclient import IRPCClient # type: ignore


class RPCGenerator(IRPCClient):
Expand All @@ -45,4 +45,4 @@ def get_result_from_response(self, data: bytes | str) -> Any:

def clear_id_list(self) -> None:
"""Reset the list of created ids."""
self._ids = {}
self._ids: dict[int, int] = {}
2 changes: 1 addition & 1 deletion pyleco/core/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import json
from typing import Optional, NamedTuple

from uuid_extensions import uuid7 # as long as uuid does not yet support UUIDv7
from uuid_extensions import uuid7 # type: ignore # as long as uuid does not yet support UUIDv7
from jsonrpcobjects.objects import (RequestObject, RequestObjectParams,
ResultResponseObject,
ErrorResponseObject,
Expand Down
4 changes: 2 additions & 2 deletions tests/core/test_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

from pyleco.core.message import Message

# asdf asdf asfd

cid = b"conversation_id;"


Expand Down Expand Up @@ -85,7 +85,7 @@ def test_message_data_str_to_binary_data(self):


class Test_Message_from_frames:
def test_message_from_frames(self, message: str):
def test_message_from_frames(self, message: Message):
message.version = b"diff" # also if the version is different
assert Message.from_frames(*message.to_frames()) == message

Expand Down

0 comments on commit 75c9d10

Please sign in to comment.