strat-chatbot/pyproject.toml
Cal Corum 1f1048ee08 refactor: migrate Discord bot to hexagonal adapter, remove old app/ directory
Discord bot inbound adapter (adapters/inbound/discord_bot.py):
- ChatService injected directly — no HTTP roundtrip to FastAPI API
- No module-level singleton: create_bot() factory for construction
- Pure functions extracted for testing: build_answer_embed,
  build_error_embed, parse_conversation_id
- Uses message.reference.resolved cache before fetch_message
- Error embeds never leak exception details
- 19 new tests covering embed building, footer parsing, error safety

Removed old app/ directory (9 files):
- All functionality preserved in hexagonal domain/, adapters/, config/
- Old test_basic.py removed (superseded by 120 adapter/domain tests)

Other changes:
- docker-compose: api uses main:app, discord-bot uses run_discord.py
  with direct ChatService injection (no API dependency)
- Removed unused openai dependency from pyproject.toml
- Removed app/ from hatch build targets

Test suite: 120 passed, 1 skipped

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:07:36 -05:00

47 lines
941 B
TOML

[project]
name = "strat-chatbot"
version = "0.1.0"
description = "Strat-O-Matic rules Q&A chatbot"
requires-python = ">=3.11"
dependencies = [
"fastapi>=0.115.0",
"uvicorn[standard]>=0.30.0",
"discord.py>=2.5.0",
"chromadb>=0.5.0",
"sentence-transformers>=3.0.0",
"python-dotenv>=1.0.0",
"sqlalchemy>=2.0.0",
"aiosqlite>=0.19.0",
"pydantic>=2.0.0",
"pydantic-settings>=2.0.0",
"httpx>=0.27.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
"pytest-asyncio>=0.23.0",
"black>=24.0.0",
"ruff>=0.5.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["domain", "adapters", "config"]
[tool.black]
line-length = 88
target-version = ['py311']
[tool.ruff]
line-length = 88
select = ["E", "F", "B", "I"]
target-version = "py311"
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]