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

Bump ruff to 0.6.3 #936

Merged
merged 2 commits into from
Aug 29, 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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- id: pyupgrade
args: [--py39-plus]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.4
rev: v0.6.3
hooks:
- id: ruff
args: [--fix]
Expand Down
2 changes: 1 addition & 1 deletion bench/raw_ble_plain_text_with_callback.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import timeit
from functools import partial
import timeit

from aioesphomeapi import APIConnection
from aioesphomeapi.api_pb2 import (
Expand Down
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pylint==3.2.6
ruff==0.5.4
ruff==0.6.3
flake8==7.1.1
isort==5.13.2
mypy==1.11.2
Expand Down
24 changes: 15 additions & 9 deletions script/gen-protoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,26 @@ from subprocess import check_call
root_dir = Path(__file__).absolute().parent.parent
os.chdir(root_dir)

check_call([
"protoc", "--python_out=aioesphomeapi", "-I", "aioesphomeapi",
"aioesphomeapi/api.proto", "aioesphomeapi/api_options.proto"
])
check_call(
[
"protoc",
"--python_out=aioesphomeapi",
"-I",
"aioesphomeapi",
"aioesphomeapi/api.proto",
"aioesphomeapi/api_options.proto",
]
)

# https://github.com/protocolbuffers/protobuf/issues/1491
api_file = root_dir / 'aioesphomeapi' / 'api_pb2.py'
api_file = root_dir / "aioesphomeapi" / "api_pb2.py"
content = api_file.read_text().replace(
"import api_options_pb2 as api__options__pb2",
"from . import api_options_pb2 as api__options__pb2"
"from . import api_options_pb2 as api__options__pb2",
)
api_file.write_text(content)

for fname in ['api_pb2.py', 'api_options_pb2.py']:
file = root_dir / 'aioesphomeapi' / fname
content = '# type: ignore\n' + file.read_text()
for fname in ["api_pb2.py", "api_options_pb2.py"]:
file = root_dir / "aioesphomeapi" / fname
content = "# type: ignore\n" + file.read_text()
file.write_text(content)
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python3
"""aioesphomeapi setup script."""
import os

from distutils.command.build_ext import build_ext
import os

from setuptools import find_packages, setup

Expand Down
Loading