mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-04-26 16:46:23 +00:00
Add flake8 to tox, disable qa on pyHS100/__init__.py, fix py27 compatibility (#31)
This commit is contained in:
parent
2d6376b597
commit
5dc94cd5c8
@ -1,3 +1,4 @@
|
||||
# flake8: noqa
|
||||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
from pyHS100.pyHS100 import SmartBulb, SmartPlug, TPLinkSmartHomeProtocol, SmartPlugException
|
||||
|
@ -17,6 +17,7 @@ http://www.apache.org/licenses/LICENSE-2.0
|
||||
# python2 compatibility
|
||||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
from future.utils import raise_from
|
||||
try:
|
||||
basestring
|
||||
except NameError:
|
||||
@ -70,7 +71,7 @@ class SmartDevice(object):
|
||||
request={target: {cmd: arg}}
|
||||
)
|
||||
except Exception as ex:
|
||||
raise SmartPlugException(ex) from ex
|
||||
raise_from(SmartPlugException(), ex)
|
||||
|
||||
if target not in response:
|
||||
raise SmartPlugException("No required {} in response: {}".format(target, response))
|
||||
|
13
tox.ini
13
tox.ini
@ -1,13 +1,22 @@
|
||||
[tox]
|
||||
envlist=py27,py34,py35
|
||||
envlist=py27,py34,py35,py36,flake8
|
||||
|
||||
[tox:travis]
|
||||
2.7 = py27
|
||||
3.4 = py34
|
||||
3.5 = py35
|
||||
3.6 = py36
|
||||
|
||||
[testenv]
|
||||
deps=
|
||||
future
|
||||
pytest
|
||||
voluptuous
|
||||
commands=py.test
|
||||
commands=py.test pyHS100
|
||||
|
||||
[testenv:flake8]
|
||||
deps=flake8
|
||||
commands=flake8 pyHS100
|
||||
|
||||
[flake8]
|
||||
exclude = .git,.tox,__pycache__,pyHS100/tests/fakes.py
|
||||
|
Loading…
x
Reference in New Issue
Block a user