aio-libs / aiokafka

asyncio client for kafka
http://aiokafka.readthedocs.io/
Apache License 2.0
1.08k stars 224 forks source link

Fix typing bugs found by beartype #993

Closed ods closed 3 months ago

ods commented 3 months ago

Try pytest-beartype, as suggested by @antonagestam . Only two bugs found so far, doesn't seem enough to add it to CI.

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.45%. Comparing base (256ce17) to head (a4dc676).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #993 +/- ## ======================================= Coverage 95.45% 95.45% ======================================= Files 112 112 Lines 16706 16706 Branches 2673 2673 ======================================= Hits 15946 15946 Misses 479 479 Partials 281 281 ``` | [Flag](https://app.codecov.io/gh/aio-libs/aiokafka/pull/993/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aio-libs) | Coverage Δ | | |---|---|---| | [cext](https://app.codecov.io/gh/aio-libs/aiokafka/pull/993/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aio-libs) | `92.17% <100.00%> (ø)` | | | [integration](https://app.codecov.io/gh/aio-libs/aiokafka/pull/993/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aio-libs) | `95.09% <100.00%> (ø)` | | | [purepy](https://app.codecov.io/gh/aio-libs/aiokafka/pull/993/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aio-libs) | `94.91% <100.00%> (ø)` | | | [unit](https://app.codecov.io/gh/aio-libs/aiokafka/pull/993/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aio-libs) | `46.41% <100.00%> (ø)` | | 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=aio-libs#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.

antonagestam commented 3 months ago

Cool stuff, I hope it at least brings some confidence to the type hints 👍

ods commented 3 months ago

I hope it at least brings some confidence to the type hints 👍

Unfortunately it doesn't catch even simple and obvious bugs. So, I'd like to find another runtime checker.

antonagestam commented 3 months ago

@ods FWIW, there's also typeguard: https://github.com/agronholm/typeguard

ods commented 3 months ago

FWIW, there's also typeguard: https://github.com/agronholm/typeguard

Right, but the use is not as simple as "install and add command line option", as it is with beartype