Files
hapi/pyproject.toml
T
BobbyandClaude Opus 5.5 a01c785842 new: import-linter module boundaries (#74)
Domain packages (finance, fitness, maintenance, smart_home) and `bots/`,
with contracts: composition root above domains above platform; each
domain reachable from others only through its `service` module; `bots/`
forbidden from importing `hapi`. `just lint` runs import-linter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 17:01:01 -05:00

110 lines
2.8 KiB
TOML

[project]
name = "hapi"
version = "0.1.0"
description = "Personal, cloud-hosted API for one Household and its automations"
readme = "README.md"
requires-python = ">=3.14"
dependencies = [
"fastapi>=0.165.0",
"typer>=0.29.3",
"uvicorn>=0.54.0",
]
[project.scripts]
hapi = "hapi.cli:main"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/hapi"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
testpaths = ["tests"]
[tool.ruff]
line-length = 100
target-version = "py314"
src = ["src", "tests", "bots"]
[tool.ruff.lint]
select = [
"E", "W", "F", "I", "N", "UP", "B", "A", "C4", "DTZ", "S", "SIM", "PT",
"RET", "TID", "ASYNC", "PL", "RUF",
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["S101", "S603", "PLR2004"]
[tool.pyright]
include = ["src", "tests", "bots"]
pythonVersion = "3.14"
typeCheckingMode = "strict"
venvPath = "."
venv = ".venv"
[dependency-groups]
dev = [
"httpx>=0.29.0",
"import-linter>=2.17",
"pyright>=1.1.414",
"pytest>=9.2.0",
"pytest-asyncio>=1.5.0",
"ruff>=0.17.6",
"rust-just>=1.59.0",
]
[tool.importlinter]
root_packages = ["hapi", "bots"]
[[tool.importlinter.contracts]]
name = "Composition root above domains, domains above platform"
type = "layers"
containers = ["hapi"]
layers = [
"app : cli",
"finance : fitness : maintenance : smart_home",
"platform",
]
[[tool.importlinter.contracts]]
name = "Finance is reachable from other domains only through its service"
type = "protected"
protected_modules = ["hapi.finance"]
allowed_importers = ["hapi.app", "hapi.cli"]
ignore_imports = ["hapi.** -> hapi.finance.service"]
unmatched_ignore_imports_alerting = "none"
[[tool.importlinter.contracts]]
name = "Fitness is reachable from other domains only through its service"
type = "protected"
protected_modules = ["hapi.fitness"]
allowed_importers = ["hapi.app", "hapi.cli"]
ignore_imports = ["hapi.** -> hapi.fitness.service"]
unmatched_ignore_imports_alerting = "none"
[[tool.importlinter.contracts]]
name = "Maintenance is reachable from other domains only through its service"
type = "protected"
protected_modules = ["hapi.maintenance"]
allowed_importers = ["hapi.app", "hapi.cli"]
ignore_imports = ["hapi.** -> hapi.maintenance.service"]
unmatched_ignore_imports_alerting = "none"
[[tool.importlinter.contracts]]
name = "Smart home is reachable from other domains only through its service"
type = "protected"
protected_modules = ["hapi.smart_home"]
allowed_importers = ["hapi.app", "hapi.cli"]
ignore_imports = ["hapi.** -> hapi.smart_home.service"]
unmatched_ignore_imports_alerting = "none"
[[tool.importlinter.contracts]]
name = "Bots talk to hAPI over HTTP only"
type = "forbidden"
source_modules = ["bots"]
forbidden_modules = ["hapi"]