From 4a60171035ac08365691e659fe007c3569c2e9ce Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Sun, 26 Apr 2026 11:23:38 -0400 Subject: [PATCH] feat: project skeleton with health endpoint --- .gitignore | 6 ++++++ .python-version | 1 + chat/__init__.py | 0 chat/app.py | 8 ++++++++ pyproject.toml | 23 +++++++++++++++++++++++ tests/__init__.py | 0 tests/test_health.py | 9 +++++++++ 7 files changed, 47 insertions(+) create mode 100644 .python-version create mode 100644 chat/__init__.py create mode 100644 chat/app.py create mode 100644 pyproject.toml create mode 100644 tests/__init__.py create mode 100644 tests/test_health.py diff --git a/.gitignore b/.gitignore index 92172f9..6bf8f70 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,9 @@ # v1 runtime data (DB, backups, snapshots, exports, config with secrets) data/ + +# Python +.venv/ +__pycache__/ +*.pyc +.pytest_cache/ diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..e4fba21 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.12 diff --git a/chat/__init__.py b/chat/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/chat/app.py b/chat/app.py new file mode 100644 index 0000000..66990d8 --- /dev/null +++ b/chat/app.py @@ -0,0 +1,8 @@ +from fastapi import FastAPI + +app = FastAPI(title="chat") + + +@app.get("/health") +def health(): + return {"status": "ok"} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..c0593a9 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,23 @@ +[project] +name = "chat" +version = "0.1.0" +requires-python = ">=3.11" +dependencies = [ + "fastapi>=0.110", + "uvicorn[standard]>=0.30", + "httpx>=0.27", + "pydantic>=2.6", + "pydantic-settings>=2.2", + "openai>=1.30", + "instructor>=1.3", + "tiktoken>=0.7", + "jinja2>=3.1", + "aiosqlite>=0.20", +] + +[project.optional-dependencies] +dev = ["pytest>=8", "pytest-asyncio>=0.23", "freezegun>=1.4"] + +[tool.pytest.ini_options] +pythonpath = ["."] +asyncio_mode = "auto" diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_health.py b/tests/test_health.py new file mode 100644 index 0000000..f44ad32 --- /dev/null +++ b/tests/test_health.py @@ -0,0 +1,9 @@ +from fastapi.testclient import TestClient +from chat.app import app + + +def test_health_endpoint_returns_ok(): + client = TestClient(app) + response = client.get("/health") + assert response.status_code == 200 + assert response.json() == {"status": "ok"}