Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aiofiles import cleanup, fix warnings in pyproject.toml #906

Merged
merged 3 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading