forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Milestone
Description
mypy -c 'import busio; b: busio.I2C; b.readfrom_into(0x30, b"")'
Is supposed to fail because readfrom_into()
needs to write into the buffer but is given a byte string. However, it doesn't. WriteableBuffer includes two string types that break the whole thing. If you remove them, then the test will fail.
Running mypy on the typing module gives a clue in how it fails:
mypy circuitpython_typing
circuitpython_typing/http.py:16: error: Skipping analyzing "adafruit_requests": module is installed, but missing library stubs or py.typed marker [import-untyped]
circuitpython_typing/device_drivers.py:12: error: Skipping analyzing "adafruit_bus_device.i2c_device": module is installed, but missing library stubs or py.typed marker [import-untyped]
circuitpython_typing/device_drivers.py:12: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
circuitpython_typing/__init__.py:39: error: Name "rgbmatrix" is not defined [name-defined]
circuitpython_typing/__init__.py:40: error: Name "ulab" is not defined [name-defined]
circuitpython_typing/__init__.py:48: error: Name "rgbmatrix" is not defined [name-defined]
circuitpython_typing/__init__.py:49: error: Name "ulab" is not defined [name-defined]
circuitpython_typing/__init__.py:131: error: Name "audiocore" is not defined [name-defined]
circuitpython_typing/__init__.py:132: error: Name "audiocore" is not defined [name-defined]
circuitpython_typing/__init__.py:133: error: Name "audiomixer" is not defined [name-defined]
circuitpython_typing/__init__.py:134: error: Name "audiomp3" is not defined [name-defined]
circuitpython_typing/__init__.py:135: error: Name "synthio" is not defined [name-defined]
circuitpython_typing/__init__.py:141: error: Name "rgbmatrix" is not defined [name-defined]
circuitpython_typing/__init__.py:144: error: Name "alarm" is not defined [name-defined]
circuitpython_typing/socket.py:129: error: Name "_FakeSSLContext" is not defined [name-defined]
Found 14 errors in 4 files (checked 8 source files)
It seems we have a circular dependency between circuitpython_typing and circuitpython stubs.