ansible / ansible-sdk

The Ansible SDK
Apache License 2.0
25 stars 14 forks source link

Type annotation fixups + enforcement #81

Open nitzmahone opened 1 year ago

nitzmahone commented 1 year ago

A number of the generic type annotations used on SDK methods need some attention- they were passing mypy validation at some point, but my original desire for minimum DRY through generic narrowing on inherited/abstract methods has led to the type annotations being difficult to maintain and inscrutable in both Python autodoc and most IDE completion engines. They're also failing in mypy again, since we're not enforcing those checks in CI.

IMO type annotations on a developer-focused library need to favor IDE completion and human-readability in docs over pedantic correctness and DRY, so re-declaring more narrow versions on the leaf method declarations is preferable to all the wizzy generic stuff, and should be easier to maintain and grok anyway.

Shrews commented 1 year ago

PR #80 would take care of enabling the sanity tests after the code base is cleaned up.