Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
162 lines (138 loc) · 4.9 KB
/
Copy pathpyproject.toml
File metadata and controls
162 lines (138 loc) · 4.9 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
[project]
name = "service-processes"
readme = "README.md"
requires-python = ">=3.14"
dynamic = ["version"]
#===============================================================================
# Dependencies
dependencies = [
"alembic~=1.20",
"asyncpg~=0.31",
"boto3~=1.40",
"fastapi[standard]~=0.141",
"httptools~=0.8",
"httpx~=0.28",
"jsonschema~=4.26",
"opentelemetry-exporter-otlp~=1.44",
"opentelemetry-instrumentation-botocore~=0.65b0",
"opentelemetry-instrumentation-fastapi~=0.65b0",
"opentelemetry-instrumentation-httpx~=0.65b0",
"opentelemetry-instrumentation-sqlalchemy~=0.65b0",
"opentelemetry-sdk~=1.44",
"pydantic-settings~=2.15",
"sqlalchemy[asyncio]~=2.1",
"uvloop~=0.22",
]
[dependency-groups]
dev = [
"pre-commit~=4.6",
"pytest~=9.1",
"pytest-asyncio~=1.4",
"pytest-cov~=7.1",
"pytest-xdist~=3.8",
"ruff~=0.16",
"ty~=0.0",
]
#===============================================================================
# uv configuration
[tool.uv]
package = false # Do not install as a package
# uv still builds the project metadata (because of the dynamic version), which fails with the
# setuptools auto discovery as there are multiple top-level packages (app, migrations).
[tool.setuptools]
packages = []
#===============================================================================
# FastAPI configuration
[tool.fastapi]
entrypoint = "app.main:app"
#===============================================================================
# Ruff configuration
[tool.ruff]
src = ["app"]
# Same as Black.
line-length = 100
indent-width = 4
# Assume Python 3.14
target-version = "py314"
#------------------------------------------------------------------------------
# Linting configuration
[tool.ruff.lint]
exclude = []
select = ["ALL"]
ignore = [
"ANN401", # Ignore Any typehint
"ANN002", # Ignore typehint for *args
"ANN003", # Ignore typehint for **kwargs
"D", # Ignore pydocstyle
"EM", # Ignore flake8-errmsg
"FBT001", # Ignore boolean-type-hint-positional-argument
"FBT002", # Ignore boolean-default-value-positional-argument
"PTH123", # Ignore builtin-open
"TD", # Ignore flake8-todos
"FIX", # Ignore fixme comments
"ERA001", # TODO remove this for production, ignore commented code
"COM812", # flak8-commas missing-trailing-comma is ignored to avoid conflict with formatter which enforces trailing commas
"TRY003", # Ignore long messages in exceptions
"CPY001", # Ignore missing copyright notice in python files
# Pydantic schemas uses type annotations at runtime to generate the openapi
# and do the validation. Putting the type annotation in a TYPE_CHECKING
# block creates weird hard to debug code.
# Same for fastAPI dependencies which also use type annotations at runtime.
"TC003", # Ignore type annotation not in TYPE_CHECKING block
"TC002", # Ignore type annotation not in TYPE_CHECKING block for third party import
"TC001", # Ignore type annotation not in TYPE_CHECKING block for first party import
]
# Allow fix for all enabled rules (when `--fix`) is provided.
unfixable = []
fixable = ["ALL"]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
#------------------------------------------------------------------------------
# ruff ignore per files
[tool.ruff.lint.per-file-ignores]
"migrations/**" = ["INP001"] # Ignore missing __init__.py files
"docker/**" = ["INP001"] # Ignore missing __init__.py files
"app/tests/**" = [
"S101", # Ignore usage of assert statements in tests
"ANN201", # Ignore missing return type hints in tests
"PLR2004", # Ignore magic number in tests
"PLR0913", # Ignore too many arguments in function in tests
]
#------------------------------------------------------------------------------
# Isort configuration
[tool.ruff.lint.isort]
section-order = [
"future",
"standard-library",
"third-party",
"fastapi",
"test",
"first-party",
"local-folder",
]
[tool.ruff.lint.isort.sections]
test = ["pytest"]
fastapi = ["fastapi", "pydantic"]
#===============================================================================
# ty configuration
[tool.ty.environment]
[tool.ty.src]
exclude = []
# The local Airflow DAGs run in the Airflow container (docker-compose.yml), airflow is not a
# dependency of the service
[[tool.ty.overrides]]
include = ["docker/airflow/dags/**"]
[tool.ty.overrides.rules]
import-not-found = "ignore"
#===============================================================================
# Pytest configuration
[tool.pytest]
pythonpath = ["app"]
python_files = ["test_*.py"]
addopts = []
#==============================================================================
# Coverage configuration
[tool.coverage.run]
omit = ["*/tests/*", "version.py", "otel.py"]
[tool.coverage.report]
exclude_lines = ["if TYPE_CHECKING:", "pragma: no cover"]