2021-06-22 09:59:05 -04:00
|
|
|
#!/bin/sh -e
|
|
|
|
rm -rf test-stubs
|
|
|
|
python3 -mvenv test-stubs
|
|
|
|
. test-stubs/bin/activate
|
2022-02-28 21:27:24 -05:00
|
|
|
pip install mypy isort black adafruit-circuitpython-typing wheel
|
2021-06-22 09:59:05 -04:00
|
|
|
rm -rf circuitpython-stubs .mypy_cache
|
|
|
|
make stubs
|
|
|
|
pip install --force-reinstall circuitpython-stubs/dist/circuitpython-stubs-*.tar.gz
|
|
|
|
mypy -c 'import busio; b: busio.I2C; b.writeto(0x30, b"")'
|
|
|
|
! mypy -c 'import busio; b: busio.I2C; b.readfrom_into(0x30, b"")'
|
|
|
|
! mypy -c 'import busio; b: busio.I2C; b.write(0x30, b"")'
|
|
|
|
echo "(The above two tests are expected to show type errors)"
|