diff --git a/.devcontainer.json b/.devcontainer.json index 4ec5f01..3bccecd 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -1,6 +1,20 @@ { "name": "andrew-codechimp/hive-local-thermostat", "image": "mcr.microsoft.com/vscode/devcontainers/python:3.12", + "features": { + "ghcr.io/devcontainers/features/github-cli:1": { + "installDirectlyFromGitHubRelease": true, + "version": "latest" + }, + "ghcr.io/devcontainers/features/node:1": { + "nodeGypDependencies": true, + "version": "lts" + }, + "ghcr.io/devcontainers-contrib/features/poetry:2": { + "version": "latest" + }, + "ghcr.io/devcontainers/features/rust:1": {} + }, "postCreateCommand": "scripts/setup", "forwardPorts": [ 8123 @@ -41,8 +55,5 @@ } } }, - "remoteUser": "vscode", - "features": { - "ghcr.io/devcontainers/features/rust:1": {} - } + "remoteUser": "vscode" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..04a3fc6 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,119 @@ +[tool.poetry] +authors = ["Andrew Jackson "] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Framework :: AsyncIO", + "Intended Audience :: Developers", + "Natural Language :: English", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3", +] +description = "HA-Hive-Local-Thermostat - Hive Local Thermostat for Home Assistant" +documentation = "https://github.com/andrew-codechimp/HA-Hive-Local-Thermostat" +homepage = "https://github.com/andrew-codechimp/HA-Hive-Local-Thermostat" +license = "MIT" +maintainers = ["Andrew Jackson "] +name = "HA-Hive-Local-Thermostat" +packages = [] +readme = "README.md" +repository = "https://github.com/andrew-codechimp/HA-Hive-Local-Thermostat" +version = "0.0.0" + +[tool.poetry.dependencies] +homeassistant = "2024.7.0" +python = ">=3.12,<3.13" + +[tool.poetry.group.dev.dependencies] +hass-nabucasa = "0.78.0" +pre-commit = "3.6.2" +pre-commit-hooks = "4.5.0" +pylint = "3.1.0" +ruff = "0.2.2" + +[tool.poetry.urls] +"Bug Tracker" = "https://github.com/andrew-codechimp/HA-Hive-Local-Thermostat/issues" +Changelog = "https://github.com/andrew-codechimp/HA-Hive-Local-Thermostat/releases" + +[build-system] +build-backend = "poetry.core.masonry.api" +requires = ["poetry-core"] + +[tool.ruff] +ignore = [ + "ANN101", # Self... explanatory + "ANN401", # Opiniated warning on disallowing dynamically typed expressions + "D203", # Conflicts with other rules + "D213", # Conflicts with other rules + "TID252", # Relative imports + "RUF012", # Just broken + + # Formatter conflicts + "COM812", + "COM819", + "D206", + "E501", + "ISC001", + "Q000", + "Q001", + "Q002", + "Q003", + "W191", +] +select = ["ALL"] +src = ["custom_components/hive_local_thermostat"] + +[tool.ruff.flake8-import-conventions.extend-aliases] +"homeassistant.helpers.area_registry" = "ar" +"homeassistant.helpers.config_validation" = "cv" +"homeassistant.helpers.device_registry" = "dr" +"homeassistant.helpers.entity_registry" = "er" +"homeassistant.helpers.issue_registry" = "ir" +voluptuous = "vol" + +[tool.ruff.isort] +force-sort-within-sections = true +known-first-party = ["homeassistant"] +combine-as-imports = true + +[tool.pylint."MESSAGES CONTROL"] +# Reasons disabled: +# format - handled by ruff +# duplicate-code - unavoidable +# used-before-assignment - false positives with TYPE_CHECKING structures +disable = [ + "abstract-method", + "duplicate-code", + "format", + "unexpected-keyword-arg", + "used-before-assignment", +] + +[tool.mypy] +# Specify the target platform details in config, so your developers are +# free to run mypy on Windows, Linux, or macOS and get consistent +# results. +platform = "linux" +python_version = "3.12" + +# show error messages from unrelated files +follow_imports = "normal" + +# suppress errors about unsatisfied imports +ignore_missing_imports = true + +# be strict +check_untyped_defs = true +disallow_any_generics = true +# disallow_incomplete_defs = true +disallow_subclassing_any = true +disallow_untyped_calls = true +disallow_untyped_decorators = true +# disallow_untyped_defs = true +no_implicit_optional = true +strict_optional = true +warn_incomplete_stub = true +warn_no_return = true +warn_redundant_casts = true +warn_return_any = true +warn_unused_configs = true +warn_unused_ignores = true