-
-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathpyproject.toml
More file actions
195 lines (180 loc) · 4.95 KB
/
Copy pathpyproject.toml
File metadata and controls
195 lines (180 loc) · 4.95 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
[project]
name = "snuba"
version = "26.7.0.dev0"
dependencies = [
"blinker>=1.9",
"click>=8.1.7",
"clickhouse-connect>=0.8.0",
"clickhouse-driver>=0.2.10",
"confluent-kafka>=2.7.0",
"datadog>=0.49.1",
"devservices>=1.2.1",
"fastjsonschema>=2.16.2",
"flask>=3.1.0",
"freezegun>=1.5.5",
"google-api-core>=2.19.1",
"google-api-python-client>=2.88.0",
"google-cloud-storage>=2.18.0",
"googleapis-common-protos>=1.63.2",
"granian[pname]>=2.7",
"jsonschema>=4.23.0",
"packaging>=24.1",
"parsimonious>=0.10.0",
"progressbar2>=4.2.0",
"proto-plus>=1.24.0",
"protobuf>=5.29.5",
"pyasn1>=0.6.3",
"python-dateutil>=2.8.2",
"pyjwt[crypto]>=2.8.0",
"python-rapidjson>=1.8",
"pyyaml>=6.0",
"redis>=4.5.4",
"sentry-arroyo>=2.39.2",
"sentry-conventions>=0.13.0",
"sentry-kafka-schemas>=2.1.36",
"sentry-protos>=0.34.0",
"sentry-redis-tools>=0.5.1",
"sentry-relay>=0.9.25",
"sentry-sdk>=2.35.0",
"sentry-usage-accountant>=0.0.11",
"simplejson>=3.17.6",
"snuba-sdk>=3.0.39",
"sql-metadata>=2.11.0",
"sqlparse>=0.5.0",
"structlog>=22.3.0",
"structlog-sentry>=2.0.0",
"urllib3>=2.7.0",
"werkzeug>=3.0.6",
"rust_snuba>=0.0.0",
]
[tool.uv.sources]
rust_snuba = { workspace = true }
[tool.uv.workspace]
members = ["rust_snuba"]
[tool.uv]
environments = ["sys_platform == 'darwin'", "sys_platform == 'linux'"]
required-environments = ["sys_platform == 'darwin'", "sys_platform == 'linux'"]
[[tool.uv.index]]
# We don't allow using public pypi - submit a PR to
# https://github.com/getsentry/pypi to add a dependency.
url = "https://pypi.devinfra.sentry.io/simple"
default = true
[build-system]
requires = ["uv_build"]
build-backend = "uv_build"
[tool.uv.build-backend]
module-root = ""
[project.scripts]
snuba = "snuba.cli:main"
[dependency-groups]
dev = [
"devservices>=1.2.1",
"freezegun>=1.5.5",
"mypy>=1.18.2",
"pre-commit>=4.2.0",
"pytest>=9.0.3",
"pytest-cov>=4.1.0",
"pytest-watch>=4.2.0",
"ruff>=0.14.0",
"sentry-devenv>=1.28.0",
"time-machine>=2.13.0",
"types-google-cloud-ndb>=2.2.0",
"types-protobuf>=5.27.0.20240626",
"types-python-dateutil>=2.8.19.14",
"types-pyyaml>=6.0.12.20240808",
"types-requests>=2.32.0.20240907",
"types-setuptools>=74.1.0.20240907",
"types-simplejson>=3.17.7",
"typing-extensions>=4.12.2",
]
[tool.pytest.ini_options]
python_files = "test*.py"
addopts = "--tb=native -p no:doctest -p no:warnings"
norecursedirs = "bin dist docs htmlcov script hooks node_modules .*"
looponfailroots = ["snuba", "tests"]
markers = [
"clickhouse_db: Use clickhouse",
"redis_db: Use redis",
"ci_only: Only run in CI",
"eap: Use clickhouse with EAP migrations only",
"genmetrics_db: Use clickhouse with generic metrics migrations only",
]
[tool.ruff]
# File filtering is taken care of in pre-commit.
line-length = 100
target-version = "py313"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"W", # pycodestyle warnings
"I", # isort
"B", # flake8-bugbear
"UP", # pyupgrade
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"RET", # flake8-return
]
ignore = [
"E501", # line too long (handled by formatter)
"SIM108", # use ternary instead of if-else (often hurts readability)
"RET504", # unnecessary assignment before return (named results aid debugging)
# PEP 695 native generics/type-aliases are a deliberate migration, not a
# mechanical sweep — risky alongside custom metaclasses. Adopt case by case.
"UP046", # non-pep695-generic-class
"UP047", # non-pep695-generic-function
"UP040", # non-pep695-type-alias
]
[tool.ruff.lint.isort]
known-first-party = ["snuba", "tests"]
[tool.mypy]
python_version = "3.13"
strict = true
ignore_missing_imports = false
files = ["."]
exclude = [
"^rust_snuba/",
"^tests/datasets/",
"^tests/query/",
# docker-only distributed-migration scaffolding; its top-level conftest.py
# collides with the repo-root conftest.py module name under `mypy .`
"^test_distributed_migrations/",
]
[[tool.mypy.overrides]]
module = [
"_strptime",
"clickhouse_connect",
"clickhouse_connect.*",
"clickhouse_driver",
"clickhouse_driver.errors",
"confluent_kafka",
"confluent_kafka.admin",
"datadog",
"deprecation",
"fastjsonschema",
"fastjsonschema.exceptions",
"granian",
"jsonschema",
"jsonschema.exceptions",
"jsonschema2md",
"markdown",
"packaging",
"parsimonious.exceptions",
"parsimonious.grammar",
"parsimonious.nodes",
"progressbar",
"pytest",
"rapidjson",
"redis.*",
"sentry_relay",
"sentry_relay.consts",
"sentry_sdk",
"setuptools",
"urllib3.connectionpool",
"urllib3.exceptions",
"sqlparse",
"googleapiclient",
"googleapiclient.discovery",
"googleapiclient.http",
]
ignore_missing_imports = true