Skip to content

Commit

Permalink
Add ruff
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
  • Loading branch information
Danielhiversen committed Dec 28, 2023
1 parent 526f00a commit 6c9b5a3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install depencency
run: |
pip install -r requirements.txt
pip install dlint black flake8 flake8-bugbear flake8-deprecated flake8-executable isort pylint pytest pytest-cov pytest-asyncio mypy types-python-dateutil ruff
pip install dlint black flake8 flake8-bugbear flake8-deprecated flake8-executable isort pylint pytest pytest-cov pytest-asyncio mypy ruff
- name: Flake8 Code Linter
run: |
flake8 $SRC_FOLDER
Expand Down
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
packages=["tibber"],
install_requires=[
"aiohttp>=3.0.6",
"async_timeout>=1.4.0",
"gql>=3.0.0",
"python-dateutil",
"websockets>=10.0"
],
package_data={"tibber": ["py.typed"]},
version=consts["__version__"],
Expand Down
4 changes: 1 addition & 3 deletions tibber/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from typing import Any

import aiohttp
import async_timeout

from .const import API_ENDPOINT, DEFAULT_TIMEOUT, DEMO_TOKEN, __version__
from .exceptions import (
Expand Down Expand Up @@ -100,8 +99,7 @@ async def execute(
"data": payload,
}
try:
async with async_timeout.timeout(timeout):
resp = await self.websession.post(API_ENDPOINT, **post_args)
resp = await self.websession.post(API_ENDPOINT, **post_args, timeout=self.timeout)
return (await extract_response_data(resp)).get("data")
except (aiohttp.ClientError, asyncio.TimeoutError) as err:
if retry > 0:
Expand Down

0 comments on commit 6c9b5a3

Please sign in to comment.