-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
204 lines (182 loc) · 6.11 KB
/
pyproject.toml
File metadata and controls
204 lines (182 loc) · 6.11 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
[project]
name = "codeleash"
version = "0.1.0"
description = "CodeLeash development scaffold"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
# FastAPI and core dependencies
"fastapi==0.116.1",
"uvicorn[standard]>=0.35.0",
# Supabase
"supabase>=2.18.1",
"supabase-auth>=0.5.0",
# Template rendering
"jinja2>=3.1.3",
# Environment management
"python-dotenv>=1.0.0",
# Authentication
"pyjwt>=2.8.0",
# Validation
"pydantic==2.11.7",
"pydantic-settings>=2.10.0",
"email-validator>=2.1.0",
# OpenTelemetry tracing
"opentelemetry-api>=1.36.0",
"opentelemetry-sdk>=1.36.0",
"opentelemetry-instrumentation-fastapi>=0.57b0",
"opentelemetry-instrumentation-httpx>=0.57b0",
"opentelemetry-exporter-otlp>=1.36.0",
"opentelemetry-instrumentation-logging>=0.57b0",
# Metrics collection
"prometheus-client>=0.21.0",
# Error tracking
"sentry-sdk[fastapi]>=2.39.0",
]
[project.optional-dependencies]
dev = [
# Testing
"pytest>=8.4.1",
"pytest-asyncio>=1.1.0",
"pytest-playwright>=0.7.1",
"pytest-xdist>=3.0.0",
"pytest-cov>=4.1.0",
"sourcemap>=0.2.1",
# Code formatting and linting
"black>=25.1.0",
"isort>=6.0.1",
"ruff>=0.12.7",
# Other dev tools
"pyyaml>=6.0.2",
"djlint>=1.36.4",
"prek>=0.3.1",
"pyrefly>=0.27.0",
"sqlfluff>=3.4.2",
"pydantic-to-typescript>=2.0.0",
"import-linter>=2.3",
"flameprof>=0.4",
# Code verification tools
"coverage>=7.10.7",
# requests 2.32.5 has a spurious RequestsDependencyWarning when chardet
# 6.0+ is installed (chardet<6 hardcoded in __init__.py). The fix
# (psf/requests#7220, merged 2026-02-22) bumps the limit to chardet<7
# but no PyPI release exists yet. Remove this pin once one ships.
# Surfaced when removing the worker system changed e2e server startup
# from concurrently (mixed streams) to direct uvicorn (proper stderr
# separation), making the warning visible.
"chardet<6",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.pytest.ini_options]
addopts = "-q --no-header"
[tool.hatch.build.targets.wheel]
packages = ["app"]
[tool.pyrefly]
search_path = ["."]
python_version = "3.12"
project-excludes = [
"**/.venv/**",
"**/venv/**",
"**/__pycache__/**",
"**/.git/**",
"**/.pytest_cache/**",
"**/node_modules/**",
"**/dist/**",
".vulture_whitelist.py",
]
[tool.ruff]
target-version = "py312"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"UP", # pyupgrade - removes obsolete code patterns
"B", # flake8-bugbear - finds common bugs
"SIM", # flake8-simplify - suggests simpler code
"TCH", # flake8-type-checking - finds unused type checking imports
"TID", # flake8-tidy-imports - import-related rules
"T", # flake8-print - ban print statements
"RUF", # Ruff-specific rules
"ANN", # flake8-annotations - return type annotations
]
ignore = [
"E501", # Ignore line length violations
"B008", # Allow function calls in argument defaults (needed for FastAPI Depends)
"B904", # Allow raise without from (deliberate exception transformations)
"RUF012", # Allow mutable class attributes (Pydantic model defaults)
"B024", # Allow abstract classes without abstract methods
"B027", # Allow empty methods in abstract classes without @abstractmethod
"SIM105", # Allow try-except-pass patterns
]
[tool.ruff.lint.per-file-ignores]
"{scripts,tests}/*" = ["T201"] # Allow print statements in scripts and tests
"tools/*" = ["T201"] # Allow print statements in tools
[tool.importlinter]
root_packages = ["app", "tests"]
include_external_packages = true
exclude_type_checking_imports = true
[[tool.importlinter.contracts]]
name = "Routes should not directly import Supabase"
type = "forbidden"
source_modules = ["app.routes"]
forbidden_modules = ["app.core.supabase", "supabase"]
allow_indirect_imports = true
[[tool.importlinter.contracts]]
name = "Services should not directly import Supabase"
type = "forbidden"
source_modules = ["app.services"]
forbidden_modules = ["app.core.supabase", "supabase"]
allow_indirect_imports = true
[[tool.importlinter.contracts]]
name = "Routes should not directly import Repositories"
type = "forbidden"
source_modules = ["app.routes"]
forbidden_modules = ["app.repositories"]
allow_indirect_imports = true
[[tool.importlinter.contracts]]
name = "Services should not directly import Repositories"
type = "forbidden"
source_modules = ["app.services"]
forbidden_modules = ["app.repositories"]
allow_indirect_imports = true
[[tool.importlinter.contracts]]
name = "Routes cannot access repository dependency functions"
type = "forbidden"
source_modules = ["app.routes"]
forbidden_modules = ["app.core.repository_dependencies"]
allow_indirect_imports = false
[[tool.importlinter.contracts]]
name = "Services cannot access repository dependency functions"
type = "forbidden"
source_modules = ["app.services"]
forbidden_modules = ["app.core.repository_dependencies"]
allow_indirect_imports = false
[[tool.importlinter.contracts]]
name = "Routes should not directly import Services - must use service_dependencies"
type = "forbidden"
source_modules = ["app.routes"]
forbidden_modules = ["app.services"]
allow_indirect_imports = true
# Complete container isolation - ONLY app.core can access container
[[tool.importlinter.contracts]]
name = "Direct container access is banned - use FastAPI dependency injection instead"
type = "forbidden"
source_modules = [
"app.routes",
"app.services",
"app.repositories",
"app.models"
]
forbidden_modules = ["app.core.container"]
allow_indirect_imports = true
[[tool.importlinter.contracts]]
name = "E2E tests must use polling utilities instead of time.sleep - use tests.e2e.polling.wait_for_db_record() or wait_for_db_records_count() for database polling (polls every 100ms). Direct time.sleep() calls lead to flaky tests and unnecessary delays."
type = "forbidden"
source_modules = ["tests.e2e"]
forbidden_modules = ["time"]
allow_indirect_imports = false
ignore_imports = [
"tests.e2e.polling -> time",
]