Skip to content

Commit

Permalink
build: bump Python to 3.12 and update ruff config
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Kaechele <felix@kaechele.ca>
  • Loading branch information
kaechele committed Mar 5, 2024
1 parent ee51d8a commit 945644b
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/kaechele/pre-commit-mirror-prettier
rev: v3.2.4
rev: v3.2.5
hooks:
- id: prettier
exclude: "(CHANGELOG.md)"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
rev: v0.3.0
hooks:
- id: ruff-format
name: ruff (format)
Expand Down
1 change: 1 addition & 0 deletions custom_components/napoleon_efire/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The Napoleon eFIRE integration."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions custom_components/napoleon_efire/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Config flow for Napoleon eFIRE integration."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions custom_components/napoleon_efire/coordinator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The Napoleon eFIRE integration."""

from __future__ import annotations

import asyncio
Expand Down
1 change: 1 addition & 0 deletions custom_components/napoleon_efire/entity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Platform for shared base classes for sensors."""

from __future__ import annotations

import homeassistant.helpers.device_registry as dr
Expand Down
1 change: 1 addition & 0 deletions custom_components/napoleon_efire/fan.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Fan definition for Efire."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions custom_components/napoleon_efire/light.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Napoleon eFIRE lights."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions custom_components/napoleon_efire/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The Napoleon eFIRE integration models."""

from __future__ import annotations

from dataclasses import dataclass
Expand Down
1 change: 1 addition & 0 deletions custom_components/napoleon_efire/switch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define switch func."""

from __future__ import annotations

from collections.abc import Awaitable, Callable
Expand Down
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ authors = [
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
Expand Down Expand Up @@ -70,8 +69,9 @@ push = "semantic-release version"

# see https://github.com/home-assistant/core/blob/dev/pyproject.toml
[tool.ruff]
target-version = "py310"
target-version = "py312"

[tool.ruff.lint]
select = [
"B002", # Python does not support the unary prefix increment
"B007", # Loop control variable {name} not used within loop body
Expand Down Expand Up @@ -166,7 +166,7 @@ ignore = [

]

[tool.ruff.flake8-import-conventions.extend-aliases]
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
voluptuous = "vol"
"homeassistant.helpers.area_registry" = "ar"
"homeassistant.helpers.config_validation" = "cv"
Expand All @@ -175,14 +175,14 @@ voluptuous = "vol"
"homeassistant.helpers.issue_registry" = "ir"
"homeassistant.util.dt" = "dt_util"

[tool.ruff.flake8-pytest-style]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false

[tool.ruff.flake8-tidy-imports.banned-api]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"async_timeout".msg = "use asyncio.timeout instead"
"pytz".msg = "use zoneinfo instead"

[tool.ruff.isort]
[tool.ruff.lint.isort]
force-sort-within-sections = true
known-first-party = [
"homeassistant",
Expand All @@ -191,7 +191,7 @@ known-first-party = [
combine-as-imports = true
split-on-trailing-comma = false

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

[tool.semantic_release]
Expand Down

0 comments on commit 945644b

Please sign in to comment.