jhugon / ascii-serial-com

Serial communication library between computers and microcontrollers, FPGAs, etc. Uses only ASCII
GNU General Public License v3.0
0 stars 0 forks source link

Python mypy fails #14

Closed jhugon closed 2 years ago

jhugon commented 2 years ago

Need to add back into CI when fixed

jhugon commented 2 years ago

Run mypy asciiserialcom 7 asciiserialcom/message.py:197: error: On Python 3 '{}'.format(b'abc') produces "b'abc'", not 'abc'; use '{!r}'.format(b'abc') if this is desired behavior 8 asciiserialcom/asciiSerialCom.py:10: error: Skipping analyzing "trio._file_io": found module but no type hints or library stubs 9 asciiserialcom/asciiSerialCom.py:10: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports 10 asciiserialcom/asciiSerialCom.py:68: error: On Python 3 '{}'.format(b'abc') produces "b'abc'", not 'abc'; use '{!r}'.format(b'abc') if this is desired behavior 11 asciiserialcom/asciiSerialCom.py:71: error: On Python 3 '{}'.format(b'abc') produces "b'abc'", not 'abc'; use '{!r}'.format(b'abc') if this is desired behavior 12 asciiserialcom/asciiSerialCom.py:254: error: Argument 1 to "unpack" of "ASC_Message" has incompatible type "Sequence[Any]"; expected "Union[bytes, bytearray]" 13 asciiserialcom/device.py:212: error: Argument 1 to "unpack" of "ASC_Message" has incompatible type "Sequence[Any]"; expected "Union[bytes, bytearray]" 14 Found 6 errors in 3 files (checked 11 source files)

jhugon commented 2 years ago

Could use x.decode(errors=“replace”) in format strings to get rid of format string error