Skip to content

Commit

Permalink
Merge pull request #906 from mkmer/aiofiles-import-cleanup
Browse files Browse the repository at this point in the history
Aiofiles import cleanup, fix warnings in pyproject.toml
  • Loading branch information
fronzbot authored Apr 12, 2024
2 parents 42c37fe + 49744c0 commit e44e6ca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
4 changes: 1 addition & 3 deletions blinkpy/blinkpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import logging
import datetime
import aiofiles
from aiofiles import ospath

from requests.structures import CaseInsensitiveDict
from dateutil.parser import parse
from slugify import slugify
Expand Down Expand Up @@ -414,7 +412,7 @@ async def _parse_downloaded_items(self, result, camera, path, delay, debug):
filename = os.path.join(path, filename)

if not debug:
if await ospath.isfile(filename):
if await aiofiles.ospath.isfile(filename):
_LOGGER.info("%s already exists, skipping...", filename)
continue

Expand Down
2 changes: 1 addition & 1 deletion blinkpy/helpers/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import time
import secrets
import re
import aiofiles
from asyncio import sleep
from calendar import timegm
from functools import wraps
from getpass import getpass
import aiofiles
import dateutil.parser
from blinkpy.helpers import constants as const

Expand Down
15 changes: 7 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ include-package-data = true
include = ["blinkpy*"]

[tool.ruff]
select = [
lint.select = [
"C", # complexity
"D", # docstrings
"E", # pydocstyle
Expand All @@ -54,11 +54,11 @@ select = [
"Q000", # Double quotes found but single quotes preferred
"SIM118", # Use {key} in {dict} instead of {key} in {dict}.keys()
"TRY004", # Prefer TypeError exception for invalid type
"TRY200", # Use raise from to specify exception cause
"B904", # Use raise from to specify exception cause
"UP", # pyupgrade
"W", # pycodestyle
]
ignore = [
lint.ignore = [
"D202", # No blank lines allowed after function docstring
"D203", # 1 blank line required before class docstring
"D212", # Multi-line docstring summary should start at the first line
Expand Down Expand Up @@ -86,10 +86,9 @@ ignore = [

line-length = 88

target-version = "py311"
target-version = "py312"

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]


[tool.ruff.mccabe]
max-complexity = 25
[tool.ruff.lint.mccabe]
max-complexity = 25

0 comments on commit e44e6ca

Please sign in to comment.