Skip to content

Commit 8e8c30a

Browse files
committed
Fix CI mypy: suppress unused-ignore for env-dependent type errors
- Mypy overrides: warn_unused_ignores=false for modules with type: ignore comments that are env-dependent (numpy stubs differ between local 3.12 and CI, redis/pymodbus installed on CI but not local) - Fix hardware_io: read_holding_registers count as keyword arg (pymodbus 3.x) - Resolves pre-existing CI typecheck failure (since before 69ca883) Co-Authored-By: Arcane Sapience <protoscience@anulum.li>
1 parent e83fcc0 commit 8e8c30a

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

pyproject.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,16 @@ warn_unused_ignores = true
128128
module = ["scpn_phase_orchestrator.grpc_gen.spo_pb2", "scpn_phase_orchestrator.grpc_gen.spo_pb2_grpc"]
129129
ignore_errors = true
130130

131+
[[tool.mypy.overrides]]
132+
module = [
133+
"scpn_phase_orchestrator.adapters.modbus_tls",
134+
"scpn_phase_orchestrator.adapters.hardware_io",
135+
"scpn_phase_orchestrator.adapters.redis_store",
136+
"scpn_phase_orchestrator.coupling.connectome",
137+
"scpn_phase_orchestrator.upde.prediction",
138+
]
139+
warn_unused_ignores = false
140+
131141
[tool.pytest.ini_options]
132142
testpaths = ["tests"]
133143
addopts = "-v --tb=short"

src/scpn_phase_orchestrator/adapters/hardware_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def disconnect(self) -> None:
220220

221221
def read_holding_registers(self, address: int, count: int = 1) -> NDArray:
222222
"""Read holding registers, return as float64 array."""
223-
result = self._client.read_holding_registers(address, count)
223+
result = self._client.read_holding_registers(address, count=count)
224224
if result.isError():
225225
return np.zeros(count)
226226
return np.array(result.registers, dtype=np.float64)

src/scpn_phase_orchestrator/adapters/modbus_tls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
HAS_PYMODBUS = True
2525
except ImportError:
26-
ModbusTlsClient = None
26+
ModbusTlsClient = None # type: ignore[assignment,misc]
2727
HAS_PYMODBUS = False
2828

2929

0 commit comments

Comments
 (0)