mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
3fe578cf26
* async++, small powerstrip improvements * use asyncclick instead of click, allows defining the commands with async def to avoid manual eventloop/asyncio.run handling * improve powerstrip support: * new powerstrip api: turn_{on,off}_by_{name,index} methods * cli: fix on/off for powerstrip using the new apis * add missing update()s for cli's hsv, led, temperature (fixes #43) * prettyprint the received payloads when debug mode in use * cli: debug mode can be activated now with '-d' * update requirements_test.txt * remove outdated click-datetime, replace click with asyncclick * debug is a flag * make smartstripplug to inherit the sysinfo from its parent, allows for simple access of general plug properties * proper bound checking for index accesses, allow controlling the plug at index 0 * remove the mess of turn_{on,off}_by_{name,index}, get_plug_by_{name,index} are enough. * adapt cli to use that * allow changing the alias per index * use f-strings consistently everywhere in the cli * add tests for get_plug_by_{index,name}
62 lines
1.2 KiB
INI
62 lines
1.2 KiB
INI
[tox]
|
|
envlist=py37,py38,flake8,linting,typing
|
|
skip_missing_interpreters = True
|
|
|
|
[tox:travis]
|
|
3.7 = py37
|
|
3.8 = py38
|
|
|
|
[testenv]
|
|
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
|
|
deps = -r{toxinidir}/requirements_test.txt
|
|
commands=
|
|
pytest --cov --cov-config=tox.ini kasa
|
|
|
|
[testenv:flake8]
|
|
deps=
|
|
flake8
|
|
flake8-docstrings
|
|
commands=flake8 kasa
|
|
|
|
[testenv:typing]
|
|
skip_install=true
|
|
deps=mypy
|
|
commands=mypy --ignore-missing-imports kasa
|
|
|
|
[flake8]
|
|
exclude = .git,.tox,__pycache__,kasa/tests/newfakes.py,kasa/tests/test_fixtures.py
|
|
max-line-length = 88
|
|
per-file-ignores =
|
|
kasa/tests/*.py:D100,D101,D102,D103,D104
|
|
setup.py:D100
|
|
ignore = D105, D107, E203, E501, W503
|
|
#ignore = E203, E266, E501, W503, F403, F401
|
|
#max-complexity = 18
|
|
#select = B,C,E,F,W,T4,B9
|
|
|
|
[testenv:lint]
|
|
deps = pre-commit
|
|
skip_install = true
|
|
commands = pre-commit run --all-files
|
|
|
|
[coverage:run]
|
|
source = kasa
|
|
branch = True
|
|
omit =
|
|
kasa/tests/*
|
|
|
|
[coverage:report]
|
|
exclude_lines =
|
|
# ignore abstract methods
|
|
raise NotImplementedError
|
|
def __repr__
|
|
|
|
[isort]
|
|
multi_line_output=3
|
|
include_trailing_comma=True
|
|
force_grid_wrap=0
|
|
use_parentheses=True
|
|
line_length=88
|
|
known_first_party=kasa
|
|
known_third_party=click,pytest,setuptools,voluptuous
|