-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
216 lines (196 loc) · 5.72 KB
/
pyproject.toml
File metadata and controls
216 lines (196 loc) · 5.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
[project]
name = "habla-hermano"
version = "0.1.0"
description = "AI language tutor: A0 to B1 with LangGraph"
readme = "README.md"
requires-python = ">=3.11"
license = { text = "MIT" }
authors = [{ name = "Abhishek" }]
dependencies = [
# Web framework
"fastapi>=0.115.0",
"uvicorn[standard]>=0.32.0",
"jinja2>=3.1.0",
"python-multipart>=0.0.12",
# Database & Auth (Supabase)
"supabase>=2.0.0",
"PyJWT>=2.8.0",
"psycopg[binary,pool]>=3.1.0",
# LangGraph + LangChain
"langchain>=0.3.0",
"langchain-anthropic>=0.3.0",
"langgraph>=0.2.0",
"langgraph-checkpoint>=2.0.0",
"langgraph-checkpoint-postgres>=2.0.0",
# Configuration
"pydantic-settings>=2.0.0",
"python-dotenv>=1.0.0",
# Rate limiting
"ratelimit>=2.2.1",
# SSE streaming
"sse-starlette>=2.0.0",
# HTML sanitization & Markdown rendering
"nh3>=0.3.3",
"markdown>=3.7",
# Cookie signing
"itsdangerous>=2.1.0",
# Speech-to-text/text-to-speech (Deepgram)
"deepgram-sdk>=6.0.0",
# HTTP client (used in REST TTS proxy fallback)
"httpx>=0.25.0",
# WebSocket client (used in streaming TTS proxy)
"websockets>=13.0",
# Structured logging
"python-json-logger>=3.0.0",
"cryptography>=46.0.3",
# Error monitoring
"sentry-sdk[fastapi]>=2.0.0",
]
[project.optional-dependencies]
dev = [
# Testing
"pytest>=8.0.0",
"pytest-asyncio>=0.24.0",
"pytest-cov>=6.0.0",
"pytest-xdist>=3.0.0",
"httpx>=0.28.0",
# Linting & Formatting
"ruff>=0.8.0",
"mypy>=1.13.0",
# Pre-commit
"pre-commit>=4.0.0",
# Type stubs
"types-aiofiles>=24.1.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src"]
# =============================================================================
# Ruff Configuration
# =============================================================================
[tool.ruff]
target-version = "py311"
line-length = 100
src = ["src", "tests"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"PTH", # flake8-use-pathlib
"ERA", # eradicate (commented out code)
"PL", # Pylint
"RUF", # Ruff-specific rules
]
ignore = [
"E501", # line too long (handled by formatter)
"PLR0913", # too many arguments
"PLR2004", # magic value comparison
]
[tool.ruff.lint.isort]
known-first-party = ["src"]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["ARG", "PLR2004", "PLC0415", "SIM117"] # Allow late imports and nested with for mocking
"src/agent/nodes/*.py" = ["PLC0415"] # Lazy imports to avoid circular dependency with src.api.config
"src/api/routes/lessons.py" = ["PLC0415"] # Lazy imports for lesson subgraphs to avoid circular dependency
"src/services/paths.py" = ["PLC0415"] # Lazy import in factory to avoid circular dependency
"src/services/adaptive.py" = ["PLC0415"] # Lazy imports in factory to avoid circular dependency
"src/api/routes/voice.py" = ["PLC0415"] # Lazy imports for optional deepgram-sdk
"src/api/main.py" = ["PLR0915"] # create_app is inherently large (middleware + routes + error handlers)
# =============================================================================
# MyPy Configuration
# =============================================================================
[tool.mypy]
python_version = "3.11"
strict = true
warn_return_any = true
warn_unused_ignores = false # Disabled due to ChatAnthropic type stubs inconsistency
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_configs = true
show_error_codes = true
show_column_numbers = true
[[tool.mypy.overrides]]
module = [
"langgraph.*",
"langchain.*",
"langchain_anthropic.*",
"langchain_core.*",
"supabase.*",
"gotrue.*",
"postgrest.*",
"psycopg.*",
"psycopg_pool.*",
"yaml.*",
"jwt.*",
"ratelimit.*",
"sse_starlette.*",
"itsdangerous.*",
"deepgram.*",
"websockets.*",
"markdown.*",
"sentry_sdk.*",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "src.db.repository"
ignore_errors = true # Supabase client JSON types are too loose for strict mypy
[[tool.mypy.overrides]]
module = "src.db.models"
disallow_untyped_defs = true
[[tool.mypy.overrides]]
module = "src.services.*"
disallow_untyped_defs = true
# =============================================================================
# Pytest Configuration
# =============================================================================
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
addopts = [
"-v",
"--tb=short",
"--strict-markers",
"-n",
"auto",
]
markers = [
"slow: marks tests as slow",
"integration: marks tests requiring external services",
]
# =============================================================================
# Coverage Configuration
# =============================================================================
[tool.coverage.run]
source = ["src"]
branch = true
omit = ["*/tests/*", "*/__pycache__/*"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]
fail_under = 70
show_missing = true
[dependency-groups]
dev = [
"mypy>=1.19.1",
"ruff>=0.14.11",
]