mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-12-03 13:53:21 +01:00
Merge branch 'main' into debug_crash_win32
This commit is contained in:
commit
b7c78432ba
@ -13,7 +13,7 @@ repos:
|
|||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: [--py39-plus]
|
args: [--py39-plus]
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.5.4
|
rev: v0.6.3
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: [--fix]
|
args: [--fix]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import timeit
|
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
import timeit
|
||||||
|
|
||||||
from aioesphomeapi import APIConnection
|
from aioesphomeapi import APIConnection
|
||||||
from aioesphomeapi.api_pb2 import (
|
from aioesphomeapi.api_pb2 import (
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
pylint==3.2.6
|
pylint==3.2.6
|
||||||
ruff==0.5.4
|
ruff==0.6.3
|
||||||
flake8==7.1.1
|
flake8==7.1.1
|
||||||
isort==5.13.2
|
isort==5.13.2
|
||||||
mypy==1.11.2
|
mypy==1.11.2
|
||||||
|
@ -7,20 +7,26 @@ from subprocess import check_call
|
|||||||
root_dir = Path(__file__).absolute().parent.parent
|
root_dir = Path(__file__).absolute().parent.parent
|
||||||
os.chdir(root_dir)
|
os.chdir(root_dir)
|
||||||
|
|
||||||
check_call([
|
check_call(
|
||||||
"protoc", "--python_out=aioesphomeapi", "-I", "aioesphomeapi",
|
[
|
||||||
"aioesphomeapi/api.proto", "aioesphomeapi/api_options.proto"
|
"protoc",
|
||||||
])
|
"--python_out=aioesphomeapi",
|
||||||
|
"-I",
|
||||||
|
"aioesphomeapi",
|
||||||
|
"aioesphomeapi/api.proto",
|
||||||
|
"aioesphomeapi/api_options.proto",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
# https://github.com/protocolbuffers/protobuf/issues/1491
|
# 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(
|
content = api_file.read_text().replace(
|
||||||
"import api_options_pb2 as api__options__pb2",
|
"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)
|
api_file.write_text(content)
|
||||||
|
|
||||||
for fname in ['api_pb2.py', 'api_options_pb2.py']:
|
for fname in ["api_pb2.py", "api_options_pb2.py"]:
|
||||||
file = root_dir / 'aioesphomeapi' / fname
|
file = root_dir / "aioesphomeapi" / fname
|
||||||
content = '# type: ignore\n' + file.read_text()
|
content = "# type: ignore\n" + file.read_text()
|
||||||
file.write_text(content)
|
file.write_text(content)
|
||||||
|
3
setup.py
3
setup.py
@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""aioesphomeapi setup script."""
|
"""aioesphomeapi setup script."""
|
||||||
import os
|
|
||||||
from distutils.command.build_ext import build_ext
|
from distutils.command.build_ext import build_ext
|
||||||
|
import os
|
||||||
|
|
||||||
from setuptools import find_packages, setup
|
from setuptools import find_packages, setup
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user