python-kasa/kasa/tests
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
..
fixtures Add fixture for L920-5(EU) 1.0.7 (#972) 2024-06-11 20:22:32 +02:00
smart Configure mypy to run in virtual environment and fix resulting issues (#989) 2024-06-19 15:07:59 +02:00
__init__.py mass rename to (python-)kasa (#1) 2019-12-18 09:11:18 +01:00
conftest.py Fix potential infinite loop if incomplete lists returned (#920) 2024-05-19 10:34:52 +01:00
device_fixtures.py Do not add parent only modules to strip sockets (#963) 2024-06-10 06:21:21 +01:00
discovery_fixtures.py Configure mypy to run in virtual environment and fix resulting issues (#989) 2024-06-19 15:07:59 +02:00
fakeprotocol_iot.py Fix switching off light effects for iot lights strips (#961) 2024-06-07 11:29:26 +01:00
fakeprotocol_smart.py Configure mypy to run in virtual environment and fix resulting issues (#989) 2024-06-19 15:07:59 +02:00
fixtureinfo.py Enable and convert to future annotations (#838) 2024-04-17 15:39:24 +02:00
test_aestransport.py Use freezegun for testing aes http client delays (#954) 2024-06-05 18:13:10 +01:00
test_bulb.py Add some device fixtures (#948) 2024-06-04 19:24:53 +02:00
test_childdevice.py Do not add parent only modules to strip sockets (#963) 2024-06-10 06:21:21 +01:00
test_cli.py Fix to call update when only --device-family passed to cli (#987) 2024-06-19 11:01:35 +01:00
test_common_modules.py Do not expose child modules on parent devices (#964) 2024-06-10 05:59:37 +01:00
test_device_factory.py Make device initialisation easier by reducing required imports (#936) 2024-06-03 19:06:54 +01:00
test_device_type.py Refactor devices into subpackages and deprecate old names (#716) 2024-02-04 16:20:08 +01:00
test_device.py Configure mypy to run in virtual environment and fix resulting issues (#989) 2024-06-19 15:07:59 +02:00
test_deviceconfig.py Rename and deprecate exception classes (#739) 2024-02-21 16:52:55 +01:00
test_dimmer.py Fix set_state for common light modules (#929) 2024-05-22 15:33:55 +02:00
test_discovery.py Make device initialisation easier by reducing required imports (#936) 2024-06-03 19:06:54 +01:00
test_emeter.py Configure mypy to run in virtual environment and fix resulting issues (#989) 2024-06-19 15:07:59 +02:00
test_feature.py Make Light and Fan a common module interface (#911) 2024-05-13 17:34:44 +01:00
test_httpclient.py Configure mypy to run in virtual environment and fix resulting issues (#989) 2024-06-19 15:07:59 +02:00
test_iotdevice.py Configure mypy to run in virtual environment and fix resulting issues (#989) 2024-06-19 15:07:59 +02:00
test_klapprotocol.py Retry query on 403 after succesful handshake (#785) 2024-02-22 18:02:03 +01:00
test_lightstrip.py Make Light and Fan a common module interface (#911) 2024-05-13 17:34:44 +01:00
test_plug.py Refactor split smartdevice tests to test_{iot,smart}device (#822) 2024-03-15 15:55:48 +00:00
test_protocol.py Rename and deprecate exception classes (#739) 2024-02-21 16:52:55 +01:00
test_readme_examples.py Update docs with more howto examples (#968) 2024-06-19 09:53:40 +01:00
test_smartdevice.py Support smart child modules queries (#967) 2024-06-10 16:47:00 +02:00
test_smartprotocol.py Do not raise on multi-request errors on child devices (#949) 2024-06-03 20:41:55 +02:00
test_strip.py Add state features to iot strip sockets (#960) 2024-06-07 10:52:11 +01:00
test_usage.py Refactor devices into subpackages and deprecate old names (#716) 2024-02-04 16:20:08 +01:00