Files
handler/pyproject.toml
T
Claude 82183d9bca Stop tracking the built web UI; build it in the Docker image instead
src/handler/api/static/ was a committed build artifact: Next's content-hashed
chunk names churn on every build, so any two branches touching frontend/ were
guaranteed merge conflicts there, PR diffs drowned in generated churn, and a
forgotten `npm run export` could silently ship a UI older than its source.

- gitignore the export (plus frontend/out and .next were already covered) and
  remove the 52 tracked files.
- Dockerfile grows a `ui` stage (npm ci + npm run build) whose output is copied
  into the packaged tree before pip install, so the image published by docker.yml
  always carries a UI built from exactly that commit's source — the frontend
  build is now effectively part of CI with no new workflow.
- .dockerignore excludes frontend artifacts and any stale local export: COPY
  into src/handler/api/static merges, so a checkout copy must never leak in.
- pyproject: hatchling skips VCS-ignored files, so `artifacts` re-includes the
  export when present; absent it, the wheel builds fine and the API just runs
  headless (it only mounts static/ when the directory exists).
- README documents the two build paths (Docker stage vs `npm run export` for
  source installs) and the headless fallback.

Verified: wheel with the export present ships all 52 files (memory page
included); wheel without it builds clean and create_app() skips the UI mount.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WYqkoYPX8NAo1V2KyXr1pk
2026-08-05 15:43:19 +00:00

57 lines
1.6 KiB
TOML

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "handler"
version = "0.1.0"
description = "Remote control wrapper for Claude Code agents across isolated projects"
readme = "README.md"
requires-python = ">=3.11"
license = { text = "MIT" }
dependencies = [
"fastapi>=0.115,<0.116",
"uvicorn[standard]>=0.34,<0.35",
"sqlalchemy>=2.0,<2.1",
"alembic>=1.14,<1.15",
"psycopg[binary]>=3.2,<3.3",
"pydantic>=2.10,<3.0",
"pydantic-settings>=2.7,<3.0",
"httpx>=0.28,<0.29",
"cryptography>=41,<46",
]
[project.optional-dependencies]
dev = [
"pytest>=8.3,<9.0",
"respx>=0.22,<0.23",
"ruff>=0.9,<0.10",
]
[project.scripts]
handler = "handler.control.cli:main"
[tool.hatch.build.targets.wheel]
# The web UI ships whenever src/handler/api/static/ exists at build time: hatchling
# includes non-.py files in the packaged `src/handler` tree by default. The export is a
# generated artifact (gitignored) — `npm run export` produces it for source installs,
# and the Docker image's ui stage builds it before pip install. Absent the directory,
# the API simply runs headless (it only mounts static/ when present).
packages = ["src/handler"]
# Hatchling skips VCS-ignored files; `artifacts` re-includes the (gitignored) export so
# a build that has one still ships it.
artifacts = ["/src/handler/api/static"]
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]
[tool.ruff]
src = ["src", "tests"]
line-length = 100
[tool.ruff.lint]
select = ["E", "F", "I", "W", "UP", "B"]
# B008: FastAPI's Depends()/Query() in argument defaults is the framework's idiom.
ignore = ["B008"]