Skip to content
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
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
- package-ecosystem: pip
directory: /
schedule:
interval: weekly
groups:
dev-dependencies:
dependency-type: development
- package-ecosystem: docker
directory: /
schedule:
interval: weekly
8 changes: 4 additions & 4 deletions .github/workflows/build_and_test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand All @@ -38,10 +38,10 @@ jobs:

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v5
uses: actions/cache@v6
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
key: venv-${{ runner.os }}-py${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_docker_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- linux/arm64
- linux/arm/v7
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- name: Set platform slug
id: platform
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ default_language_version:

repos:
- repo: https://github.com/python-poetry/poetry
rev: '2.1.3'
rev: '2.5.1'
hooks:
- id: poetry-check
- id: poetry-lock
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.0
rev: v0.17.1
hooks:
- id: ruff
args:
Expand All @@ -38,7 +38,7 @@ repos:
pass_filenames: false
stages: [pre-push]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-yaml
- id: check-added-large-files
723 changes: 435 additions & 288 deletions poetry.lock

Large diffs are not rendered by default.

27 changes: 13 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ package-mode = false
requires-poetry = '>=2.0,<3.0'

[tool.poetry.group.dev.dependencies]
pytest = "^9.0.0"
pytest = ">=9.0.3,<10.0.0"
mock = "^5.1.0"
coverage = "^7.5.4"
ruff = "^0.15.0"
pytest-cov = "^7.0.0"
pytest-asyncio = "^1.2.0"
pytest-mock = "^3.14.0"
mypy = "^1.15.0"
pylint = "^4.0.0"
pre-commit = "^4.6.0"
coverage = ">=7.16.0,<8.0.0"
ruff = ">=0.17.1,<0.18.0"
pytest-cov = ">=7.1.0,<8.0.0"
pytest-asyncio = ">=1.4.0,<2.0.0"
pytest-mock = ">=3.16.0,<4.0.0"
mypy = ">=2.4.0,<3.0.0"
pylint = ">=4.1.3,<5.0.0"
pre-commit = ">=4.7.0,<5.0.0"

[tool.poetry.dependencies]
saic-ismart-client-ng = { develop = true }
Expand Down Expand Up @@ -130,6 +130,9 @@ ignore = [
"FIX002", # Line contains TODO, consider resolving the issue
"BLE001", # Do not catch blind exception: `Exception`,
"PLR0913", # Too many arguments in function definition
"PLR0917", # Too many positional arguments in function definition
"CPY001", # Missing copyright notice at top of file
"ICN001", # Import conventions, e.g. `datetime` as `dt`
"ERA001", # Commented-out code
"PLR0912", # Logging statement uses f-string
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -187,15 +190,11 @@ strict = true
module = ["apscheduler.*"]
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = ["gmqtt.*"]
ignore_missing_imports = true
follow_untyped_imports = true

[[tool.mypy.overrides]]
module = ["publisher.mqtt_publisher"]
disallow_untyped_calls = false

[[tool.mypy.overrides]]
module = ["configuration.argparse_extensions"]
disable_error_code = ["arg-type"]
disable_error_code = ["arg-type"]
2 changes: 1 addition & 1 deletion src/handlers/vehicle_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __report_command_failure(
LOG, f"Command {command} failed", exc, level=logging.ERROR
)
elif exc is not None:
LOG.exception("Command %s failed: %s", command, detail, exc_info=exc)
LOG.error("Command %s failed: %s", command, detail, exc_info=exc)
else:
LOG.error("Command %s failed: %s", command, detail)
try:
Expand Down
2 changes: 1 addition & 1 deletion src/integrations/home_assistant/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def snake_case(s: str) -> str:


def decode_as_utf8(
byte_string: str | None | bytes | bytearray, default: str = ""
byte_string: str | bytes | bytearray | None, default: str = ""
) -> str:
if byte_string is None:
return default
Expand Down
2 changes: 1 addition & 1 deletion src/mqtt_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ async def __run_until_all_tasks_done(self) -> None:
if task.cancelled():
LOG.debug(f"{task_name!r} task was cancelled")
elif (exception := task.exception()) is not None:
LOG.exception(
LOG.error(
f"{task_name!r} task crashed with an exception",
exc_info=exception,
)
Expand Down
2 changes: 1 addition & 1 deletion src/publisher/mqtt_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(
self.vin_by_charger_connected_topic: dict[str, str] = {}
self.vin_by_imported_energy_topic: dict[str, str] = {}
self.first_connection = True
self.client: None | aiomqtt.Client = None
self.client: aiomqtt.Client | None = None
self.__running: asyncio.Task[None] | None = None
self.__connected = asyncio.Event()
self.__fatal_connect_error: SystemExit | None = None
Expand Down
Loading