-
Notifications
You must be signed in to change notification settings - Fork 544
Expand file tree
/
Copy pathpyproject.toml
More file actions
290 lines (270 loc) · 8.7 KB
/
Copy pathpyproject.toml
File metadata and controls
290 lines (270 loc) · 8.7 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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
[build-system]
requires = [
# Cython 3.3 cp315 manylinux wheels SIGSEGV on the current 3.15 interpreter; <3.3 pins 3.2.x.
# TODO(py-315): drop this pin once IMAGE_TAG is on the 2026.08.04-1 images.
"cython<3.3; python_version >= '3.15'",
"cython; python_version < '3.15'",
"cmake>=3.24.2,<3.28",
"setuptools-rust<2",
"patchelf>=0.17.0.0; sys_platform == 'linux'",
]
build-backend = "setuptools.build_meta"
[project]
name = "ddtrace"
version = "4.15.0rc1"
description = "Datadog APM client library"
readme = "README.md"
license = { text = "LICENSE.BSD3" }
# ddtrace has many sub-components which can break when CPython internals
# change over versions, e.g. profiling. So we explicitly mark incompatibility
# with versions we don't support yet.
requires-python = ">=3.9,<3.15"
authors = [
{ name = "Datadog, Inc.", email = "dev@datadoghq.com" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"bytecode>=0.19.0,<1; python_version>='3.15.0'",
"bytecode>=0.17.0,<1; python_version>='3.14.0'",
"bytecode>=0.16.0,<1; python_version>='3.13.0'",
"bytecode>=0.15.1,<1; python_version~='3.12.0'",
"bytecode>=0.14.0,<1; python_version~='3.11.0'",
"bytecode>=0.13.0,<1; python_version<'3.11'",
"ddtrace-internal==0.1.0",
"envier~=0.6.1",
"opentelemetry-api>=1,<2",
# TODO: lift the `!=2.2.0` exclusion once wrapt ships a release that
# reverts/fixes the descriptor regression introduced in
# https://github.com/GrahamDumpleton/wrapt/commit/ae93dd71c378161ff3643c9a1f708f66f97f3b5d
# wrapt 2.2.0's `FunctionWrapper.__get__(None, owner)` calls `tp_descr_get`
# with `Py_None` instead of `NULL`, which breaks class-level access to any
# C method_descriptor we wrap (e.g. `_pickle.Unpickler.load`,
# `asyncpg.protocol.protocol.BaseProtocol.execute`). See incident 53643.
"wrapt>=1,!=2.2.0,<3",
]
[project.optional-dependencies]
opentracing = [
"opentracing>=2,<3",
]
opentelemetry = [
"opentelemetry-exporter-otlp>=1,<2",
]
openfeature = [
"openfeature-sdk>=0.8,<1",
]
[project.scripts]
ddtrace-run = "ddtrace.commands.ddtrace_run:main"
_dd_crashtracker_receiver = "ddtrace.commands._dd_crashtracker_receiver:main"
[project.entry-points.opentelemetry_context]
ddcontextvars_context = "ddtrace.internal.opentelemetry.context:DDRuntimeContext"
[project.entry-points.pytest11]
ddtrace = "ddtrace.testing.internal.pytest.entry_point"
[project.entry-points.'mlflow.request_header_provider']
datadog = "ddtrace.contrib.internal.mlflow.auth_plugin:DatadogHeaderProvider"
[project.entry-points.'ddtrace.products']
"apm-tracing-rc" = "ddtrace.internal.remoteconfig.products.apm_tracing"
"llmobs" = "ddtrace.llmobs._product"
"code-origin-for-spans" = "ddtrace.debugging._products.code_origin.span"
"dynamic-instrumentation" = "ddtrace.debugging._products.dynamic_instrumentation"
"exception-replay" = "ddtrace.debugging._products.exception_replay"
"live-debugger" = "ddtrace.debugging._products.live_debugger"
"error-tracking" = "ddtrace.errortracking.product"
"openfeature" = "ddtrace.internal.openfeature.product"
"remote-configuration" = "ddtrace.internal.remoteconfig.products.client"
"symbol-database" = "ddtrace.internal.symbol_db.product"
"appsec" = "ddtrace.internal.appsec.product"
"aiguard" = "ddtrace.internal.aiguard.product"
"iast" = "ddtrace.internal.iast.product"
"sca" = "ddtrace.internal.sca.product"
"tracer" = "ddtrace._trace.product"
[project.urls]
"Bug Tracker" = "https://github.com/DataDog/dd-trace-py/issues"
Changelog = "https://github.com/DataDog/dd-trace-py/releases"
Documentation = "https://ddtrace.readthedocs.io/en/stable/"
Homepage = "https://github.com/DataDog/dd-trace-py"
"Source Code" = "https://github.com/DataDog/dd-trace-py/"
[dependency-groups]
lint = [
"click==8.1.7",
"cython-lint==0.18.1",
"codespell==2.4.1",
"bandit==1.8.2",
"mypy==1.15.0",
"coverage==7.3.0",
"envier==0.6.1",
"openfeature-sdk~=0.8.0",
"types-docutils==0.19.1.1",
"types-protobuf==3.20.4.5",
"types-PyYAML==6.0.12.2",
"types-setuptools==65.6.0.0",
"ddapm-test-agent==1.43.0",
# The newer Datadog-repackaged grpcio release lacks CPython 3.10 wheels.
"grpcio==1.80.0; python_version<='3.10'",
"grpcio==1.82.1; python_version>='3.11'",
"packaging==23.1",
"pygments==2.16.1",
"riot==0.22.0",
"ruff==0.14.10",
"clang-format==18.1.5",
"cmake-format==0.6.13",
"ruamel.yaml==0.18.6",
"ast-grep-cli==0.39.4",
# Lint extra; 0.19.0 matches the runtime lower bound so uv can resolve
# both extras when requires-python includes 3.15.
"bytecode==0.19.0; python_version >= '3.15'",
"bytecode==0.17.0; python_version < '3.15'",
]
clean = [
"cython",
"cmake>=3.24.2,<3.28",
"setuptools-rust<2",
"setuptools-scm[toml]>=4",
]
[tool.cython-lint]
max-line-length = 120
exclude = '''
(
\.worktrees/
| .venv*
| \.sg
| \.riot
| ddtrace/profiling/
| test_ci_visibility_api_client_skippable_real_world_responses\.py
)
'''
[tool.pyright]
exclude = [
"**/__pycache__",
".git",
".ddriot",
".ddtox",
".riot",
".sg",
".tox",
".venv",
".worktrees",
]
[tool.bandit]
targets = ["ddtrace/"]
# TODO: Remove excludes
exclude_dirs = [
"ddtrace/vendor/",
"ddtrace/appsec/_iast/_taint_tracking/_vendor/",
"ddtrace/commands/ddtrace_run.py",
"ddtrace/ext/git.py",
"ddtrace/ext/test.py",
"ddtrace/internal/datadog/profiling/ddup/test/interface.py",
"ddtrace/internal/module.py",
"ddtrace/internal/rate_limiter.py",
"ddtrace/internal/uwsgi.py",
"ddtrace/sourcecode/_utils.py",
"scripts/ext_cache.py",
"setup.py",
]
[tool.ruff]
# This exclude list applies to both linting and formatting
exclude = [
".riot",
".ddriot",
".venv*",
".git",
".worktrees",
"__pycache__",
".eggs",
"*.egg",
".sg",
"build",
"ddtrace/__init__.py",
"ddtrace/vendor/*",
"ddtrace/appsec/_iast/_taint_tracking/_vendor/*",
"tests/profiling/collector/pprof_*pb2.py",
"tests/contrib/grpc/hello_pb2.py",
"tests/contrib/django_celery/app/*",
"tests/contrib/protobuf/schemas/**/*.py",
"tests/coverage/included_path/py39_line_numbers.py",
"tests/appsec/iast/fixtures/ast/str/non_utf8_content.py",
"tests/appsec/iast/fixtures/aspects/str/non_utf8_content.py",
"tests/lib-injection/dd-lib-python-init-test-protobuf-old/addressbook_pb2.py",
"tests/appsec/iast/aspects/test_template_string_aspect.py", # Python 3.14+ syntax (t-strings)
"benchmarks/bm/iast_fixtures/template_strings.py", # Python 3.14+ syntax (t-strings)
# Version-gated wrapping tests: each uses syntax newer than the project minimum,
# so the min-version ruff parser rejects them and they are excluded from ruff on
# every interpreter (not linted). conftest.py collect_ignores them below their
# target interpreter at test time. Mirrors test_template_string_aspect.py above.
"tests/wrapping/test_match_py310.py", # match/case (3.10+)
"tests/wrapping/test_except_star_py311.py", # except* (3.11+)
"tests/wrapping/test_pep695_py312.py", # PEP 695 generics (3.12+)
"tests/wrapping/test_tstrings_py314.py", # PEP 750 t-strings (3.14+)
]
lint.ignore = [
"A003",
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
"D200",
"D202",
"D204",
"D205",
"D208",
"D210",
"D300",
"D400",
"D401",
"D403",
"D404",
"D413",
"E203",
"E231",
"E721",
"G201",
]
line-length = 120
# Allow experimental/preview checks
lint.preview = true
lint.explicit-preview-rules = true
lint.select = [
"A",
"D",
"E",
"F",
"G",
"I",
"PLW0244", # redefined-slots-in-subclass
"UP006", # non-pep585-annotation (use builtin generics like list instead of typing.List)
"W",
]
lint.unfixable =[
"F401",
]
[tool.ruff.format]
# Formatter-specific settings
# The exclude list from [tool.ruff] is inherited automatically
# Additional formatter options can be added here if needed
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.ruff.lint.isort]
force-single-line = true
lines-after-imports = 2
force-sort-within-sections = true
known-first-party = [ "ddtrace" ]
relative-imports-order = "furthest-to-closest"