[project]
name = "{{ service_name }}-server"
version = "0.1.0"
description = "micro Python service ({{ service_name }})"
requires-python = ">=3.11"
license = { text = "Apache-2.0" }

# Async-by-default. tonin carries the runtime framework (Service
# builder, JwtValidator, asyncpg/redis.asyncio State, job.bootstrap,
# OTel telemetry init). The local client crate carries the generated
# stubs + the shared AuthCtx via tonin-client.
dependencies = [
  "tonin",
  "{{ service_name }}-client",
  "grpcio>=1.66",
  "protobuf>=5",
]

[project.optional-dependencies]
codegen = [
  "grpcio-tools>=1.66",
]
test = [
  "pytest>=8",
  "pytest-asyncio>=0.23",
]

[project.scripts]
{{ service_name }} = "{{ service_name_snake }}_server.main:run"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["src/{{ service_name_snake }}_server"]

[tool.pytest.ini_options]
asyncio_mode = "auto"

# `<svc>-client` is always a sibling path dep; the framework packages
# resolve from PyPI by default. Add a `[tool.uv.sources]` block for
# local dev:
#
#     [tool.uv.sources]
#     tonin = { path = "/path/to/tonin/python/tonin" }
#     tonin-client = { path = "/path/to/tonin/python/tonin-client" }
[tool.uv.sources]
"{{ service_name }}-client" = { path = "../client-python" }
