python-kasa/kasa/tests/smart/modules
Steven B 416d3118bf
Configure mypy to run in virtual environment and fix resulting issues (#989)
For some time I've noticed that my IDE is reporting mypy errors that the
pre-commit hook is not picking up. This is because [mypy
mirror](https://github.com/pre-commit/mirrors-mypy) runs in an isolated
pre-commit environment which does not have dependencies installed and it
enables `--ignore-missing-imports` to avoid errors.

This is [advised against by
mypy](https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-library-stubs-or-py-typed-marker)
for obvious reasons:

> We recommend avoiding --ignore-missing-imports if possible: it’s
equivalent to adding a # type: ignore to all unresolved imports in your
codebase.

This PR configures the mypy pre-commit hook to run in the virtual
environment and addresses the additional errors identified as a result.
It also introduces a minimal mypy config into the `pyproject.toml`

[mypy errors identified without the fixes in this
PR](https://github.com/user-attachments/files/15896693/mypyerrors.txt)
2024-06-19 15:07:59 +02:00
..
__init__.py Add T315 fixture, tests for humidity&temperature modules (#802) 2024-03-06 18:04:09 +00:00
test_autooff.py Support smart child modules queries (#967) 2024-06-10 16:47:00 +02:00
test_contact.py Make Light and Fan a common module interface (#911) 2024-05-13 17:34:44 +01:00
test_fan.py Do not expose child modules on parent devices (#964) 2024-06-10 05:59:37 +01:00
test_firmware.py Configure mypy to run in virtual environment and fix resulting issues (#989) 2024-06-19 15:07:59 +02:00
test_humidity.py Make Light and Fan a common module interface (#911) 2024-05-13 17:34:44 +01:00
test_light_effect.py Make Light and Fan a common module interface (#911) 2024-05-13 17:34:44 +01:00
test_temperature.py Make Light and Fan a common module interface (#911) 2024-05-13 17:34:44 +01:00
test_temperaturecontrol.py Make Light and Fan a common module interface (#911) 2024-05-13 17:34:44 +01:00
test_waterleak.py Make Light and Fan a common module interface (#911) 2024-05-13 17:34:44 +01:00