cookiecutter-hypermodern-python icon indicating copy to clipboard operation
cookiecutter-hypermodern-python copied to clipboard

Disable type checking for imported libraries

Open Lonerider2010 opened this issue 3 years ago • 2 comments

Hello @cjolowicz, thanks for this excellent framework. That's what I was looking for. More than 30 test help to move my Python project to a higher quality level. Now I managed to get all these tests to state "successful". Then I imported an external library (Inquirer) and boom: most of the tests failed because of missing type hints! Is there a way to tell nox (with mypy and typeguard) not to type check this external library?

Lonerider2010 avatar Jun 25 '22 20:06 Lonerider2010

I'm assuming you're getting an error that mypy cannot find type definitions for a Python package? You can disable these errors by ignoring missing imports.

Example here where I've ignored missing imports a few third-party libraries.

paw-lu avatar Jul 02 '22 20:07 paw-lu

@Lonerider2010 I have a couple of projects using this templates that also use/used inquirer (now I am mostly using prompt-toolkit which has type annotations). I am also maintainer of Inquirer BTW, but type-annotations are not really in the roadmap I would say.

You can check examples: https://github.com/staticdev/irpf-investidor/commit/9474952f1e8511fffef12c19f9b98abfcaf975e7 https://github.com/staticdev/git-portfolio

staticdev avatar Aug 01 '22 18:08 staticdev