Skip to content

Commit 7572508

Browse files
authored
Pin python 3.13.0 and update ruff. (#2487)
1 parent cadbec7 commit 7572508

File tree

11 files changed

+26
-44
lines changed

11 files changed

+26
-44
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636
fail-fast: false
3737
matrix:
3838
os: [ubuntu-latest, macos-latest, windows-latest]
39-
python: ['3.9', '3.10', '3.11', '3.12', "3.13"]
39+
python: ['3.9', '3.10', '3.11', '3.12', "3.13.0"]
4040
include:
4141
- python: '3.9'
4242
run_lint: true
43-
- python: '3.13'
43+
- python: '3.13.0'
4444
run_doc: true
4545
run_lint: true
4646
- os: macos-latest

examples/message_parser.py

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -93,40 +93,22 @@ def check_errors(self, decoder, message):
9393
def report(self, message):
9494
"""Print the message information."""
9595
print(
96-
"%-15s = %s" # pylint: disable=consider-using-f-string
97-
% (
98-
"name",
99-
message.__class__.__name__,
100-
)
96+
f"{'name':.15s} = {message.__class__.__name__}"
10197
)
10298
for k_dict, v_dict in message.__dict__.items():
10399
if isinstance(v_dict, dict):
104-
print("%-15s =" % k_dict) # pylint: disable=consider-using-f-string
100+
print(f"{k_dict:.15s} =")
105101
for k_item, v_item in v_dict.items():
106-
print(
107-
" %-12s => %s" # pylint: disable=consider-using-f-string
108-
% (k_item, v_item)
102+
print(f" {k_item:.12s} => {v_item}"
109103
)
110104
elif isinstance(v_dict, collections.abc.Iterable):
111-
print("%-15s =" % k_dict) # pylint: disable=consider-using-f-string
105+
print(f"{k_dict:.15s} =")
112106
value = str([int(x) for x in v_dict])
113107
for line in textwrap.wrap(value, 60):
114-
print(
115-
"%-15s . %s" # pylint: disable=consider-using-f-string
116-
% ("", line)
117-
)
108+
print(f"{' ':.15s} . {line}")
118109
else:
119-
print(
120-
"%-15s = %s" # pylint: disable=consider-using-f-string
121-
% (k_dict, hex(v_dict))
122-
)
123-
print(
124-
"%-15s = %s" # pylint: disable=consider-using-f-string
125-
% (
126-
"documentation",
127-
message.__doc__,
128-
)
129-
)
110+
print(f"{k_dict:.15s} = {hex(v_dict)}")
111+
print("{'documentation':.15s} = {message.__doc__}")
130112

131113

132114
# -------------------------------------------------------------------------- #

pymodbus/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"ExceptionResponse",
88
"FramerType",
99
"ModbusException",
10-
"pymodbus_apply_logging_config",
1110
"__version__",
1211
"__version_full__",
12+
"pymodbus_apply_logging_config",
1313
]
1414

1515
from pymodbus.exceptions import ModbusException

pymodbus/datastore/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
__all__ = [
44
"ModbusBaseSlaveContext",
55
"ModbusSequentialDataBlock",
6-
"ModbusSparseDataBlock",
7-
"ModbusSlaveContext",
86
"ModbusServerContext",
97
"ModbusSimulatorContext",
8+
"ModbusSlaveContext",
9+
"ModbusSparseDataBlock",
1010
]
1111

1212
from pymodbus.datastore.context import (

pymodbus/datastore/simulator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ def loop_validate(self, address, end_address, fx_write):
542542
i = address
543543
while i < end_address:
544544
reg = self.registers[i]
545-
if fx_write and not reg.access or reg.type == CellType.INVALID:
545+
if (fx_write and not reg.access) or reg.type == CellType.INVALID:
546546
return False
547547
if not self.type_exception:
548548
i += 1

pymodbus/device.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99

1010
__all__ = [
11-
"ModbusPlusStatistics",
12-
"ModbusDeviceIdentification",
1311
"DeviceInformationFactory",
12+
"ModbusDeviceIdentification",
13+
"ModbusPlusStatistics",
1414
]
1515

1616
import struct

pymodbus/exceptions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"""
55

66
__all__ = [
7-
"ModbusIOException",
8-
"ParameterException",
9-
"NotImplementedException",
107
"ConnectionException",
11-
"NoSuchSlaveException",
128
"InvalidMessageReceivedException",
139
"MessageRegisterException",
10+
"ModbusIOException",
11+
"NoSuchSlaveException",
12+
"NotImplementedException",
13+
"ParameterException",
1414
]
1515

1616

pymodbus/framer/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""Framer."""
22
__all__ = [
3-
"FramerBase",
4-
"FramerType",
53
"FramerAscii",
4+
"FramerBase",
65
"FramerRTU",
76
"FramerSocket",
8-
"FramerTLS"
7+
"FramerTLS",
8+
"FramerType"
99
]
1010

1111
from pymodbus.framer.ascii import FramerAscii

pymodbus/server/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"""
55

66
__all__ = [
7-
"get_simulator_commandline",
87
"ModbusSerialServer",
98
"ModbusSimulatorServer",
109
"ModbusTcpServer",
@@ -20,6 +19,7 @@
2019
"StartTcpServer",
2120
"StartTlsServer",
2221
"StartUdpServer",
22+
"get_simulator_commandline",
2323
]
2424

2525
from pymodbus.server.async_io import (

pymodbus/transport/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""Transport."""
22
__all__ = [
3+
"NULLMODEM_HOST",
34
"CommParams",
45
"CommType",
56
"ModbusProtocol",
6-
"NULLMODEM_HOST",
77
]
88

99
from pymodbus.transport.transport import (

0 commit comments

Comments
 (0)