meshtastic / python

The Python CLI and API for talking to Meshtastic devices
https://meshtastic.org
410 stars 170 forks source link

Add a variety of type annotations for mypy #681

Closed william-stearns closed 3 weeks ago

william-stearns commented 1 month ago

Replacing #597 (I'm sure there's a more elegant way to do this.) Fixes a single missing "import io" in stream_interface.py

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 85.10638% with 21 lines in your changes missing coverage. Please review.

Project coverage is 60.35%. Comparing base (0deb1d7) to head (384063d). Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
meshtastic/ble_interface.py 43.75% 9 Missing :warning:
meshtastic/stream_interface.py 70.00% 6 Missing :warning:
meshtastic/util.py 94.00% 3 Missing :warning:
meshtastic/__main__.py 90.00% 2 Missing :warning:
meshtastic/tcp_interface.py 95.45% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #681 +/- ## ========================================== - Coverage 60.37% 60.35% -0.03% ========================================== Files 24 24 Lines 3793 3811 +18 ========================================== + Hits 2290 2300 +10 - Misses 1503 1511 +8 ``` | [Flag](https://app.codecov.io/gh/meshtastic/python/pull/681/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=meshtastic) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/meshtastic/python/pull/681/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=meshtastic) | `60.35% <85.10%> (-0.03%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=meshtastic#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ianmcorvidae commented 3 weeks ago

Hi @william-stearns -- I went through and fixed the rest of the mypy complaints locally and pushed that up here. Sorry about the back and forth on this and thanks again for contributing! I'll get this merged now that CI is happy.