adafruit / Adafruit_CircuitPython_ADS1x15

CircuitPython drivers for the ADS1x15 series of ADCs.
MIT License
140 stars 59 forks source link

Adding typing #86

Closed scirelli closed 2 years ago

scirelli commented 2 years ago

Adding .venv to the ignore list so it doesn't accidentally get added Adding py.typed file to signify this library has typing information Fixed typing errors found by mypy

Addresses issue #83

scirelli commented 2 years ago

I'm not sure how to test the changes. Any advice?

scirelli commented 2 years ago

Looks like black made some changes. Is there a way to rerun the pipeline?

tekktrik commented 2 years ago

Nice! I'll try to take a look at this soon, but maybe someone else will first!

scirelli commented 2 years ago

These changes all look reasonable to me and I don’t see any problems. But I can’t find this board in my collection, so I personally would feel better if someone verified it on the hardware before merging.

I have a bbb and ads1115, but not an ads1015

tekktrik commented 2 years ago

@scirelli, can you use the generics from the typing module like Dict and List instead of built-ins? Using built-ins as generics wasn't available in Python 3.7.

tekktrik commented 2 years ago

@scirelli let me know when I should re-review

scirelli commented 2 years ago

I have not had a chance to test on actual hardware. Other than that I addressed all PR comments.

Which tests should I run? I was looking at the simple one in examples.

tekktrik commented 2 years ago

I also realize that I haven't reviewed the property getters and setters, I'll do that in a few hours. Sorry for the delay!

scirelli commented 2 years ago

Thanks! I learned a few things, still new to Python typing.