aboutsummaryrefslogtreecommitdiff
path: root/circuitpython/tools/test-stubs.sh
blob: c977ad26d97cc1fb7c0a1975635f0495b9ce5fe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh -e
rm -rf test-stubs
python3 -mvenv test-stubs
. test-stubs/bin/activate
pip install mypy isort black adafruit-circuitpython-typing wheel
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)"