Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
Update CI configuration and dependencies (#41)
Browse files Browse the repository at this point in the history
* Update CI

* Change CI environment config

* Update dependencies and lint
  • Loading branch information
andrewsayre committed Oct 5, 2020
1 parent e3f26a5 commit 8b75a30
Show file tree
Hide file tree
Showing 25 changed files with 73 additions and 184 deletions.
17 changes: 8 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ language: python
matrix:
fast_finish: true
include:
- python: '3.6'
env: TOXENV=lint
- python: '3.6'
env: TOXENV=cov
after_success: coveralls
- python: '3.7'
env: TOXENV=py37
dist: xenial
- python: "3.8"
env: TOXENV=lint
- python: "3.8"
env: TOXENV=cov
after_success: coveralls
- python: "3.7"
env: TOXENV=py37
install: pip install -U tox coveralls
script: tox
deploy:
Expand All @@ -21,4 +20,4 @@ deploy:
skip_existing: true
on:
tags: true
condition: $TOXENV = lint
condition: $TOXENV = lint
32 changes: 6 additions & 26 deletions pysmartthings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
Attribute,
Capability,
)
from .const import ( # noqa
__title__,
__version__,
)
from .const import __title__, __version__ # noqa
from .device import (
DEVICE_TYPE_DTH,
DEVICE_TYPE_ENDPOINT_APP,
Expand All @@ -36,36 +33,19 @@
DeviceStatus,
DeviceStatusBase,
)
from .errors import (
APIErrorDetail,
APIInvalidGrant,
APIResponseError,
)
from .errors import APIErrorDetail, APIInvalidGrant, APIResponseError
from .installedapp import (
InstalledApp,
InstalledAppEntity,
InstalledAppStatus,
InstalledAppType,
)
from .location import (
Location,
LocationEntity,
)
from .location import Location, LocationEntity
from .oauthtoken import OAuthToken
from .room import (
Room,
RoomEntity,
)
from .scene import (
Scene,
SceneEntity,
)
from .room import Room, RoomEntity
from .scene import Scene, SceneEntity
from .smartthings import SmartThings
from .subscription import (
SourceType,
Subscription,
SubscriptionEntity,
)
from .subscription import SourceType, Subscription, SubscriptionEntity

__all__ = [
# app
Expand Down
18 changes: 5 additions & 13 deletions pysmartthings/api.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
"""Utility for invoking the SmartThings Cloud API."""

from aiohttp import (
BasicAuth,
ClientSession,
)
from typing import (
Optional,
Sequence,
)

from .errors import (
APIInvalidGrant,
APIResponseError,
)
from typing import Optional, Sequence

from aiohttp import BasicAuth, ClientSession

from .errors import APIInvalidGrant, APIResponseError

API_OAUTH_TOKEN = "https://auth-global.api.smartthings.com/oauth/token"
API_BASE = "https://api.smartthings.com/v1/"
Expand Down
6 changes: 1 addition & 5 deletions pysmartthings/app.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
"""Define the app module."""

import re

from typing import (
List,
Optional,
)
from typing import List, Optional

from .api import Api
from .entity import Entity
Expand Down
24 changes: 4 additions & 20 deletions pysmartthings/device.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
"""Defines a SmartThings device."""
from collections import (
defaultdict,
namedtuple,
)
import re

from collections import defaultdict, namedtuple
import colorsys
from typing import (
Any,
Dict,
Mapping,
Optional,
Sequence,
Tuple,
)
import re
from typing import Any, Dict, Mapping, Optional, Sequence, Tuple

from .api import Api
from .capability import (
ATTRIBUTE_OFF_VALUES,
ATTRIBUTE_ON_VALUES,
Attribute,
Capability,
)
from .capability import ATTRIBUTE_OFF_VALUES, ATTRIBUTE_ON_VALUES, Attribute, Capability
from .entity import Entity

DEVICE_TYPE_OCF = "OCF"
Expand Down
5 changes: 1 addition & 4 deletions pysmartthings/errors.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
"""Define errors that can be returned from the SmartThings API."""
import json
from typing import Optional, Sequence

from aiohttp import ClientResponseError
from typing import (
Optional,
Sequence,
)

UNAUTHORIZED_ERROR = (
"Authorization for the API is required, but the request has not been "
Expand Down
5 changes: 1 addition & 4 deletions pysmartthings/location.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
"""Define the SmartThing location."""

from typing import (
List,
Optional,
)
from typing import List, Optional

from .api import Api
from .entity import Entity
Expand Down
11 changes: 2 additions & 9 deletions pysmartthings/oauthtoken.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
"""Define the oauth module."""

from datetime import (
datetime,
timedelta,
)

from typing import (
List,
Optional,
)
from datetime import datetime, timedelta
from typing import List, Optional

from .api import Api

Expand Down
5 changes: 1 addition & 4 deletions pysmartthings/room.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
"""Defines the rooms module."""
from typing import (
Dict,
Optional,
)
from typing import Dict, Optional

from .api import Api
from .entity import Entity
Expand Down
5 changes: 1 addition & 4 deletions pysmartthings/scene.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
"""Define the scene module."""
from typing import (
Dict,
Optional,
)
from typing import Dict, Optional

from .api import Api
from .entity import Entity
Expand Down
22 changes: 5 additions & 17 deletions pysmartthings/smartthings.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
"""Define the SmartThings Cloud API."""

from typing import List, Optional, Sequence

from aiohttp import ClientSession
from typing import (
List,
Optional,
Sequence,
)

from .api import Api
from .app import (
Expand All @@ -19,21 +16,12 @@
AppSettingsEntity,
)
from .device import DeviceEntity
from .installedapp import (
InstalledAppEntity,
InstalledAppStatus,
)
from .installedapp import InstalledAppEntity, InstalledAppStatus
from .location import LocationEntity
from .oauthtoken import OAuthToken
from .room import (
Room,
RoomEntity,
)
from .room import Room, RoomEntity
from .scene import SceneEntity
from .subscription import (
Subscription,
SubscriptionEntity,
)
from .subscription import Subscription, SubscriptionEntity


class SmartThings:
Expand Down
5 changes: 1 addition & 4 deletions pysmartthings/subscription.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
"""Define the subscription module."""

from enum import Enum
from typing import (
Any,
Optional,
)
from typing import Any, Optional

from .api import Api
from .entity import Entity
Expand Down
18 changes: 9 additions & 9 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
black==19.10b0
coveralls==2.1.1
flake8==3.8.3
black==20.8b1
coveralls==2.1.2
flake8==3.8.4
flake8-docstrings==1.5.0
pydocstyle==5.0.2
isort==4.2.5
pylint==2.5.3
pytest==5.4.3
pydocstyle==5.1.1
isort==5.5.4
pylint==2.6.0
pytest==6.1.1
pytest-asyncio==0.14.0
pytest-cov==2.10.0
pytest-cov==2.10.1
pytest-timeout==1.4.2
yarl==1.4.2
yarl==1.6.0
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import glob
import re

import pytest

from pysmartthings.api import (
API_APP,
API_APP_OAUTH,
Expand All @@ -27,7 +29,6 @@
Api,
)
from pysmartthings.smartthings import SmartThings
import pytest

from .utilities import ClientMocker

Expand Down
3 changes: 2 additions & 1 deletion tests/test_app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Define tests for the app module."""

import pytest

from pysmartthings.app import (
APP_TYPE_LAMBDA,
APP_TYPE_WEBHOOK,
Expand All @@ -11,7 +13,6 @@
AppSettings,
AppSettingsEntity,
)
import pytest

from .conftest import APP_ID
from .utilities import get_json
Expand Down
14 changes: 4 additions & 10 deletions tests/test_device.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"""Tests for the Device file."""

from pysmartthings.capability import (
Attribute,
Capability,
)
import pytest

from pysmartthings.capability import Attribute, Capability
from pysmartthings.device import (
DEVICE_TYPE_DTH,
DEVICE_TYPE_UNKNOWN,
Expand All @@ -12,13 +11,8 @@
DeviceStatus,
Status,
)
import pytest

from .conftest import (
DEVICE_ID,
LOCATION_ID,
ROOM_ID,
)
from .conftest import DEVICE_ID, LOCATION_ID, ROOM_ID
from .utilities import get_json


Expand Down
8 changes: 3 additions & 5 deletions tests/test_installedapp.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
"""Tests for the installedapp module."""

import pytest

from pysmartthings.installedapp import (
InstalledApp,
InstalledAppEntity,
InstalledAppStatus,
InstalledAppType,
)
import pytest

from .conftest import (
APP_ID,
INSTALLED_APP_ID,
)
from .conftest import APP_ID, INSTALLED_APP_ID
from .utilities import get_json


Expand Down
6 changes: 2 additions & 4 deletions tests/test_location.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
"""Tests for the Location module."""

from pysmartthings.location import (
Location,
LocationEntity,
)
import pytest

from pysmartthings.location import Location, LocationEntity

from .conftest import LOCATION_ID
from .utilities import get_json

Expand Down
Loading

0 comments on commit 8b75a30

Please sign in to comment.