feat: project foundation — monorepo setup, shared config, redis streams, telemetry

- pyproject.toml with core deps and optional dep groups per service
- shared/config.py: Pydantic BaseSettings with TRADING_ env prefix
- shared/redis_streams.py: StreamPublisher/StreamConsumer wrappers
- shared/telemetry.py: OpenTelemetry + Prometheus metric export
- tests for Redis Streams helpers (5 passing)
This commit is contained in:
Viktor Barzin 2026-02-22 15:13:26 +00:00
parent 0ac9884b89
commit ae5b3f89d1
No known key found for this signature in database
GPG key ID: 0EB088298288D958
7 changed files with 248 additions and 0 deletions

43
pyproject.toml Normal file
View file

@ -0,0 +1,43 @@
[project]
name = "trading-bot"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = [
"sqlalchemy[asyncio]>=2.0",
"asyncpg>=0.29",
"redis>=5.0",
"pydantic>=2.0",
"pydantic-settings>=2.0",
"opentelemetry-sdk>=1.20",
"opentelemetry-exporter-prometheus>=0.45b",
"opentelemetry-api>=1.20",
"alembic>=1.13",
]
[project.optional-dependencies]
api = ["fastapi>=0.110", "uvicorn[standard]>=0.27", "websockets>=12.0", "py-webauthn>=2.0", "pyjwt[crypto]>=2.8"]
news = ["feedparser>=6.0", "praw>=7.7", "httpx>=0.27"]
sentiment = ["transformers>=4.38", "torch>=2.2", "ollama>=0.1"]
trading = ["alpaca-py>=0.21"]
backtester = ["numpy>=1.26", "pandas>=2.2"]
dev = ["pytest>=8.0", "pytest-asyncio>=0.23", "pytest-cov>=4.1", "ruff>=0.3", "mypy>=1.8"]
[build-system]
requires = ["setuptools>=70.0"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
include = ["shared*", "tests*"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
[tool.ruff]
line-length = 120
target-version = "py312"
[tool.mypy]
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true