-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
216 lines (195 loc) · 5.72 KB
/
pyproject.toml
File metadata and controls
216 lines (195 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
[tool.poetry]
name = "yourapp"
version = "0.1.2"
description = "FastAPI application with SQLAlchemy, Alembic, and Pydantic"
authors = ["Your Name <your.email@example.com>"]
readme = "README.md"
packages = [{include = "app"}]
[tool.poetry.dependencies]
python = "^3.11"
fastapi = "^0.115.0"
uvicorn = {extras = ["standard"], version = "^0.34.0"}
sqlalchemy = "^2.0.23"
alembic = "^1.13.0"
asyncpg = "^0.29.0"
pydantic = "^2.5.0"
pydantic-settings = "^2.1.0"
python-multipart = "^0.0.9"
python-jose = {extras = ["cryptography"], version = "^3.3.0"}
passlib = "^1.7.4"
# Email functionality
aiosmtplib = "^3.0.1"
jinja2 = "^3.1.2"
# Monitoring & Observability
sentry-sdk = {extras = ["fastapi"], version = "^1.39.0"}
opentelemetry-api = "^1.35.0"
opentelemetry-sdk = "^1.35.0"
opentelemetry-instrumentation-fastapi = "^0.56b0"
opentelemetry-instrumentation-sqlalchemy = "^0.56b0"
opentelemetry-instrumentation-asyncpg = "^0.56b0"
opentelemetry-instrumentation-redis = "^0.56b0"
opentelemetry-exporter-jaeger-thrift = "^1.21.0"
# Caching & Background Tasks
redis = "^5.0.1"
# Additional utilities
structlog = "^23.2.0"
rich = "^13.7.0"
email-validator = "^2.2.0"
greenlet = "^3.2.3"
logfire = {extras = ["fastapi"], version = "^3.21.1"}
sqlmodel = "^0.0.24"
psycopg = {extras = ["binary"], version = "^3.2.9"}
faker = "^37.4.0"
bcrypt = "4.0.1"
phonenumbers = "^9.0.8"
openai-agents = "^0.2.6"
google-genai = "^1.33.0"
pillow = "^11.3.0"
google-adk = "^1.13.0"
[tool.poetry.group.dev.dependencies]
pytest = "^7.4.3"
pytest-asyncio = "^0.21.1"
pytest-cov = "^4.1.0"
httpx = "^0.28.1"
ruff = "^0.1.7"
mypy = "^1.7.1"
pre-commit = "^3.6.0"
aiosqlite = "^0.19.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
target-version = "py311"
line-length = 88
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"D", # pydocstyle
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"RUF", # Ruff-specific rules
# Security
"S", # flake8-bandit (security)
# Code quality
"N", # pep8-naming
"A", # flake8-builtins (avoid shadowing builtins)
"C90", # mccabe (complexity)
"PL", # pylint
"T20", # flake8-print (avoid print statements in production)
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RET", # flake8-return
"TID", # flake8-tidy-imports
"ICN", # flake8-import-conventions
# Performance
"PERF", # perflint
"FURB", # refurb (modernize code)
# Async best practices
"ASYNC", # flake8-async
# Error handling
"EM", # flake8-errmsg (error message formatting)
"TRY", # tryceratops (exception handling)
# Logging
"LOG", # flake8-logging
# Type checking
"FA", # flake8-future-annotations
]
ignore = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in __init__
"B008", # Do not perform function calls in argument defaults (FastAPI Depends pattern)
"B904", # Use `raise ... from err` or `raise ... from None` (can be too strict)
"ARG001", # Unused function argument (common in FastAPI with dependencies)
"E501", # Line too long (let formatter handle this)
# Additional ignores for new rules
"S101", # Use of assert (common in tests and FastAPI)
"S104", # Possible binding to all interfaces
"S311", # Standard pseudo-random generators not suitable for cryptographic purposes
"PLR0913", # Too many arguments to function call
"PLR2004", # Magic value used in comparison
"TRY003", # Avoid specifying long messages outside the exception class
"EM101", # Exception must not use a string literal
"EM102", # Exception must not use an f-string literal
"T201", # print found (useful for development)
"C901", # Function is too complex (can be adjusted per project needs)
"PLR0911", # Too many return statements
"PLR0915", # Too many statements
]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"migrations",
]
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.per-file-ignores]
"tests/*" = ["D"]
"alembic/*" = ["D415", "UP007", "E501", "F841"] # Alembic-specific ignores
[tool.mypy]
python_version = "3.11"
strict = true
warn_return_any = true
warn_unused_configs = true
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_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
"--cov=app",
"--cov-report=term-missing",
"--cov-report=html",
"--cov-report=xml",
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
]
asyncio_mode = "auto"