mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-05-28 18:43:40 +00:00
Add UP037 to ruff ignore list to preserve quoted TYPE_CHECKING forward references (PEP 649 lazy eval breaks get_type_hints() at runtime for TYPE_CHECKING-guarded imports). Move datetime imports into TYPE_CHECKING blocks in sensor/calculators timing.py and trend.py (TC003, type-only usage confirmed). Apply PEP 758 parenthesis-free except clauses across 7 files via ruff format with target-version=py314. Update hacs.json minimum HA version to 2026.4.0, the first HA release requiring Python 3.14. Impact: Linter config now correctly handles Python 3.14 semantics. Users need HA >= 2026.4 (Python 3.14) to use this integration.
85 lines
2.2 KiB
TOML
85 lines
2.2 KiB
TOML
[build-system]
|
|
requires = ["setuptools==82.0.1"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "tibber_prices"
|
|
version = "0.0.0" # Version is managed in manifest.json only
|
|
requires-python = ">=3.14"
|
|
|
|
[tool.setuptools]
|
|
packages = ["custom_components.tibber_prices"]
|
|
|
|
[tool.pyright]
|
|
include = ["custom_components/tibber_prices"]
|
|
exclude = [
|
|
"**/node_modules",
|
|
"**/__pycache__",
|
|
"**/.git",
|
|
"**/.github",
|
|
"**/docs",
|
|
"**/venv",
|
|
"**/.venv",
|
|
]
|
|
venvPath = "."
|
|
venv = ".venv"
|
|
typeCheckingMode = "basic"
|
|
|
|
[tool.ruff]
|
|
# Based on https://github.com/home-assistant/core/blob/dev/pyproject.toml
|
|
target-version = "py314"
|
|
line-length = 120
|
|
|
|
[tool.ruff.lint]
|
|
select = ["ALL"]
|
|
ignore = [
|
|
# "ANN101", # Missing type annotation for `self` in method
|
|
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
|
|
"D203", # no-blank-line-before-class (incompatible with formatter)
|
|
"D212", # multi-line-summary-first-line (incompatible with formatter)
|
|
"COM812", # incompatible with formatter
|
|
"ISC001", # incompatible with formatter
|
|
"UP037", # quoted annotations; needed for TYPE_CHECKING forward references
|
|
]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
"tests/*" = [
|
|
"S101", # assert is fine in tests
|
|
"PLR2004", # Magic values are fine in tests
|
|
]
|
|
"scripts/*" = [
|
|
"T201", # print() is the correct output method for CLI scripts
|
|
"INP001", # scripts/ is not a Python package (no __init__.py)
|
|
]
|
|
|
|
[tool.ruff.lint.flake8-pytest-style]
|
|
fixture-parentheses = false
|
|
|
|
[tool.ruff.lint.pyupgrade]
|
|
keep-runtime-typing = true
|
|
|
|
[tool.ruff.lint.mccabe]
|
|
max-complexity = 25
|
|
|
|
[tool.ruff.lint.isort]
|
|
force-single-line = false
|
|
known-first-party = ["custom_components", "homeassistant"]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
python_files = ["test_*.py"]
|
|
python_classes = ["Test*"]
|
|
python_functions = ["test_*"]
|
|
asyncio_default_fixture_loop_scope = "function"
|
|
addopts = "-ra -q --strict-markers"
|
|
markers = [
|
|
"unit: Unit tests (fast, no external dependencies)",
|
|
"integration: Integration tests (may use coordinator/time service)",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
test = [
|
|
"pytest>=8.0.0",
|
|
"pytest-asyncio>=0.23.0",
|
|
"pytest-homeassistant-custom-component>=0.13.0",
|
|
]
|