read.markets/pyproject.toml
Giorgio Gilestro 80e2ec53ac test: standalone test container, isolated from the live prod stack
Adds a `test` stage to the Dockerfile (prod deps + pytest + aiosqlite via
the `dev` extras, never shipped) and a docker-compose.test.yml that runs
it under its own Compose project name (`cassandra-test`). The project-name
isolation matters because this host runs prod — a wrong `compose up` would
otherwise recreate the live `app` container; namespaced project means the
test container can't touch any prod container/network/volume.

Tests use an in-memory aiosqlite DB (per tests/conftest.py) so the
container has no MariaDB / Redis dependency and nothing on the prod DB
is observed or mutated.

Also adds aiosqlite to dev extras — tests have always implicitly needed
it (the conftest pins DATABASE_URL to sqlite+aiosqlite:///:memory:); the
declaration was just missing.

Usage:
  docker compose -f docker-compose.test.yml run --rm test
  docker compose -f docker-compose.test.yml run --rm test pytest -k unsubscribe
2026-05-25 23:58:55 +02:00

50 lines
1.1 KiB
TOML

[project]
name = "cassandra"
version = "0.1.0"
description = "Containerised macro-strategy dashboard — market data, news, portfolios, AI daily log."
requires-python = ">=3.13"
dependencies = [
"fastapi>=0.115",
"uvicorn[standard]>=0.32",
"jinja2>=3.1",
"python-multipart>=0.0.12",
"sqlalchemy[asyncio]>=2.0.36",
"aiomysql>=0.2.0",
"alembic>=1.14",
"pydantic>=2.9",
"pydantic-settings>=2.6",
"httpx>=0.28",
"apscheduler>=3.10",
"tenacity>=9.0",
"structlog>=24.4",
"argon2-cffi>=23.1",
"cryptography>=43.0",
"itsdangerous>=2.2",
"email-validator>=2.2",
"aiosmtplib>=3.0",
"redis[hiredis]>=5.2",
]
[project.optional-dependencies]
dev = [
"pytest>=8.3",
"pytest-asyncio>=0.24",
"pytest-httpx>=0.34",
"aiosqlite>=0.20",
"ruff>=0.7",
]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
[tool.ruff]
line-length = 100
target-version = "py313"
[build-system]
requires = ["setuptools>=68"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
packages = ["app", "app.services", "app.jobs", "app.routers"]