Jamie- / openvpn-api

A Python API for the OpenVPN management interface.
MIT License
60 stars 18 forks source link

Run mypy in travis #11

Closed D0han closed 4 years ago

D0han commented 4 years ago

This PR adds mypy to travis, to make use of type annotations.

Currently it shows 24 errors that could use some rethinking.

Jamie- commented 4 years ago

Now down to 11 errors. I couldn't work out how to get type hinting working successfully on _socket in VPN. That will knock the error count down even more.

Also the issues with parse_raw receiving None I need to look at but I haven't finished implementing kill/client-kill yet but when I've finished that, those should be better.

D0han commented 4 years ago

I suspect you had problems because of shadowed name. Proposal in #16.

Seems that after #16 mypy only complains about Optional being used as if it would not be optional. Hard to disagree.

Jamie- commented 4 years ago

16 merged and now down to 7.

Jamie- commented 4 years ago

Implemented parsing output of kill and client-kill properly in https://github.com/Jamie-/openvpn-api/commit/db1f14331130c73b2b2bf9906d47b526d034978f and knocked down to 3 errors.

Jamie- commented 4 years ago

Down to 1 after https://github.com/Jamie-/openvpn-api/commit/977f3f2067195ecbdad91bd6e6aea8bb2457a6a8

Jamie- commented 4 years ago

Got added with final mypy fixes in: 6a2699bb00d1062747d18d5248a84cdf15c4f3fa