adafruit / Adafruit_Blinka

Add CircuitPython hardware API and libraries to MicroPython & CPython devices
https://learn.adafruit.com/circuitpython-on-raspberrypi-linux
MIT License
453 stars 340 forks source link

Add typing information to micropython #608

Closed jepler closed 2 years ago

jepler commented 2 years ago

This requires converting it into a package so that it can have a "py.typed" file.

After this, a package using micropython.const can be type checked

makermelissa commented 2 years ago

Thanks. It looks like this change should be fine. Have you tested on MicroPython and Linux? Blinka has been super touchy about adding typing info in the past because it's supposed to work in such a wide variety of environments.

In fact, in the future, I think splitting it up a bit more internally I think would be helpful with fixing this touchiness. I'll make another issue regarding this in more detail.

jepler commented 2 years ago

No, I did not test anything.

An alternative is to provide micropython.pyi, I could PR that approach instead.

jepler commented 2 years ago

Let's just go the #610 route.

makermelissa commented 2 years ago

Sounds good. Thanks.