Skip to content

Commit 0b13f15

Browse files
authored
Merge pull request #19 from pymodbus-dev/ruff
Update ruff and fix type error
2 parents 3c841cd + 5ea7cd4 commit 0b13f15

File tree

3 files changed

+28
-23
lines changed

3 files changed

+28
-23
lines changed

poetry.lock

Lines changed: 21 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pymodbus_repl/server/cli.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import inspect
44
import shutil
55
from collections import defaultdict
6-
from typing import Optional
6+
from typing import Dict, Optional
77

88
import click
99
from prompt_toolkit import PromptSession, print_formatted_text
@@ -17,6 +17,9 @@
1717
from pymodbus_repl import __VERSION__ as repl_version
1818
from pymodbus_repl.lib.completer import CmdCompleter
1919
from pymodbus_repl.lib.helper import Command, style
20+
from pymodbus_repl.lib.reactive import (
21+
ReactiveServer,
22+
)
2023

2124

2225
TITLE = r"""
@@ -37,7 +40,7 @@
3740
)
3841
COMMAND_ARGS = ["response_type", "error_code", "delay_by", "clear_after", "data_len"]
3942
RESPONSE_TYPES = ["normal", "error", "delayed", "empty", "stray"]
40-
COMMANDS = {
43+
COMMANDS: Dict[str, Optional[Dict | Command]] = {
4144
"manipulator": {
4245
"response_type": None,
4346
"error_code": None,
@@ -167,7 +170,7 @@ def _print_help():
167170
_print_help()
168171

169172

170-
def print_server_config(server: "ReactiveServer", print_server_context: bool = False, *extra) -> dict: # noqa
173+
def print_server_config(server: ReactiveServer, print_server_context: bool = False, *extra):
171174
"""Print server config."""
172175
print_formatted_text()
173176
print_formatted_text(HTML("<u>Server Configs:</u>"))

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ include = ["pymodbus_repl"]
2929

3030
[tool.poetry.group.dev.dependencies]
3131
pymodbus = {git = "https://github.com/pymodbus-dev/pymodbus", rev = "dev"}
32-
ruff = "^0.2.1"
32+
ruff = "^0.5.6"
3333
coverage = "^7.4.1"
3434
pytest-xdist = "^3.5.0"
3535
pytest-cov = "^4.1.0"

0 commit comments

Comments
 (0)