Skip to content

Commit

Permalink
Use pylin runtime-typing for supporting python3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoomakethu committed Aug 8, 2022
1 parent d73ea4b commit b05cb63
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pymodbus/repl/client/mclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,9 @@ def get_clear_modbus_plus(self, data=0, **kwargs):
class ModbusSerialClient(ExtendedRequestSupport, _ModbusSerialClient):
"""Modbus serial client."""

def __init__(self, method, **kwargs):
def __init__(self, framer, **kwargs):
"""Initialize."""
super().__init__(method, **kwargs)
super().__init__(framer=framer, **kwargs)

def get_port(self):
"""Get serial Port.
Expand Down
3 changes: 2 additions & 1 deletion pymodbus/repl/server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import asyncio
import json
import logging
import typer
from typing import List
from pathlib import Path
from enum import Enum

import typer
from pymodbus.framer.socket_framer import ModbusSocketFramer
from pymodbus.repl.server.cli import run_repl
from pymodbus.server.reactive.default_config import DEFUALT_CONFIG
Expand Down
4 changes: 3 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ fail-under=10.0
# Return non-zero exit code if any of these messages/categories are detected.
fail-on=



[pylint.messages_control]
# Only show warnings with the listed confidence levels.
# confidence=
Expand Down Expand Up @@ -450,7 +452,7 @@ overgeneral-exceptions=Exception

[pylint.typing]
# app / library does need runtime introspection of type annotations.
runtime-typing = no
runtime-typing = true

This comment has been minimized.

Copy link
@janiversen

janiversen Aug 8, 2022

Collaborator

This is not a good idea, it makes the runtime quite a lot slower (and there are known problems with coroutines).

Please have a look at the .pyc files.

It is of course ok, to activate it for development purposes.

This comment has been minimized.

Copy link
@dhoomakethu

dhoomakethu Aug 8, 2022

Author Contributor

No , this should not add any additional overheads to the runtime, this is used in the cli and is used on demand (when the cli app is run) + its not part of the core pymodbus server libraries.

This comment has been minimized.

Copy link
@dhoomakethu

dhoomakethu Aug 8, 2022

Author Contributor

This comment has been minimized.

Copy link
@dhoomakethu

dhoomakethu Aug 8, 2022

Author Contributor

Also , note this is coming because of the typer library. fastapi/typer#371
Should be fixed when the upstream repo fixes this.


[pylint.deprecated_builtins]
# List of builtins function names that should not be used.
Expand Down

0 comments on commit b05cb63

Please sign in to comment.