OpenCyphal / yakut

Simple CLI tool for diagnostics and debugging of Cyphal networks
https://opencyphal.org
MIT License
49 stars 10 forks source link

Fix execute_command test #109

Open maksimdrachov opened 4 months ago

maksimdrachov commented 4 months ago

This fixes the failing unit test tests/cmd/execute_command.py.

The issue arose due to this implemented in public_regulated_data_types:

https://github.com/OpenCyphal/public_regulated_data_types/commit/ec2788372559c8e1cf7b36f528d81074e523303e

maksimdrachov commented 4 months ago

Ok, the same errors show up on my local setup:

image
maksimdrachov commented 4 months ago

@pavel-kirienko

Can you weight in on why this is happening?

I checked .venv3.12/lib/python3.12/site-packages/pycyphal/transport/__init__.py, it has the following line:

from ._transfer import TransferFrom as TransferFrom
image
maksimdrachov commented 4 months ago

Highlighted part is where the error occurs:

image
pavel-kirienko commented 3 months ago

The MyPy errors could be related to this recent change in PyCyphal: https://github.com/OpenCyphal/pycyphal/pull/343

PyCyphal imports were considered missing by MyPy until we added the py.typed label; now it's trying to parse PyCyphal but failing for some reason. We could simply force it to shut up by adding to setup.cfg:

 [mypy-pycyphal.*]
 ignore_missing_imports = True
+ignore_errors = True

But this is not a good solution for obvious reasons. However, it is often the case with MyPy that no solution is a good one.

@maksimdrachov I've been staging minor changes on the dev branch to avoid publishing releases too often; consider changing the merge target to that branch instead.