forked from DataDog/dd-trace-py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
268 lines (249 loc) · 6.97 KB
/
pyproject.toml
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
[build-system]
requires = ["setuptools_scm[toml]>=4", "cython", "cmake>=3.24.2,<3.28; python_version>='3.7'"]
build-backend = "setuptools.build_meta"
[project]
name = "ddtrace"
dynamic = ["version"]
description = "Datadog APM client library"
readme = "README.md"
license = { text = "LICENSE.BSD3" }
requires-python = ">=3.7"
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.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"attrs>=20",
"bytecode>=0.15.0; python_version>='3.12'",
"bytecode>=0.14.0; python_version~='3.11.0'",
"bytecode>=0.13.0; python_version<'3.11'",
"cattrs",
"ddsketch>=3.0.0",
"envier~=0.5",
"importlib_metadata<=6.5.0; python_version<'3.8'",
"opentelemetry-api>=1",
"protobuf>=3",
"setuptools; python_version>='3.12'",
"six>=1.12.0",
"typing_extensions",
"xmltodict>=0.12",
"sqlparse>=0.2.2",
]
[project.optional-dependencies]
opentracing = [
"opentracing>=2.0.0",
]
openai = [
"tiktoken",
]
[project.scripts]
ddtrace-run = "ddtrace.commands.ddtrace_run:main"
[project.entry-points.opentelemetry_context]
ddcontextvars_context = "ddtrace.opentelemetry._context:DDRuntimeContext"
[project.entry-points.pytest11]
ddtrace = "ddtrace.contrib.pytest.plugin"
"ddtrace.pytest_bdd" = "ddtrace.contrib.pytest_bdd.plugin"
"ddtrace.pytest_benchmark" = "ddtrace.contrib.pytest_benchmark.plugin"
[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/"
[tool.setuptools_scm]
version_scheme = "release-branch-semver" # Must be "release-branch-semver" for now in main, see https://github.com/DataDog/dd-trace-py/issues/8801
write_to = "ddtrace/_version.py"
[tool.cython-lint]
max-line-length = 120
exclude = '''
(
.venv*
| \.riot
| ddtrace/profiling/
)
'''
[tool.black]
line-length = 120
target_version = ['py37', 'py38', 'py39', 'py310', 'py311', 'py312']
include = '''\.py[ix]?$'''
exclude = '''
(
.venv*
| \.riot/
| ddtrace/appsec/_ddwaf.pyx$
| ddtrace/internal/_encoding.pyx$
| ddtrace/internal/_rand.pyx$
| ddtrace/internal/_tagset.pyx$
| ddtrace/profiling/collector/_traceback.pyx$
| ddtrace/profiling/collector/_task.pyx$
| ddtrace/profiling/_threading.pyx$
| ddtrace/profiling/collector/stack.pyx$
| ddtrace/profiling/exporter/pprof_.*_pb2.py$
| ddtrace/profiling/exporter/pprof.pyx$
| ddtrace/internal/datadog/profiling/ddup/_ddup.pyx$
| ddtrace/vendor/
| ddtrace/appsec/_iast/_taint_tracking/_vendor/
| ddtrace/_version.py
| \.eggs
| \.git
| \.hg
| \.mypy_cache
| \.nox
| \.tox
| \.venv
| _build/
| buck-out/
| build/
| dist/
)
'''
[tool.pyright]
exclude = [
"**/__pycache__",
".git",
".ddriot",
".ddtox",
".riot",
".tox",
".venv",
]
[tool.slotscheck]
exclude-modules = '''
(
^ddtrace.(contrib|vendor)
| ^tests.(contrib|vendor)
# avoid sitecustomize modules as they start services
| ddtrace.bootstrap.sitecustomize
| ddtrace.profiling.bootstrap.sitecustomize
| ddtrace.profiling.auto
# also ignore preload module to avoid exception after moving ddtrace.tracing module
| ddtrace.bootstrap.preload
# protobuf file fails to import
| ddtrace.profiling.exporter.pprof_3_pb2
| ddtrace.profiling.exporter.pprof_312_pb2
| ddtrace.profiling.exporter.pprof_319_pb2
| ddtrace.profiling.exporter.pprof_421_pb2
# TODO: resolve slot inheritance issues with profiling
| ddtrace.profiling.collector
| ddtrace,appsec,iast,_taint_tracking.vendor
| ddtrace.appsec._ddwaf.ddwaf_types
| ddtrace.appsec._iast._taint_tracking
| ddtrace.appsec._iast._ast.aspects
| ddtrace.appsec._iast._taint_utils
| ddtrace.appsec._iast.taint_sinks.sql_injection
# DSM specific contribs
| ddtrace.internal.datastreams.kafka
# libdd_wrapper is a common native dependency, not a module
| ddtrace.internal.datadog.profiling.libdd_wrapper
# _ddup and _stack_v2 miss a runtime dependency in slotscheck, but ddup and stack_v2 are fine
| ddtrace.internal.datadog.profiling.ddup._ddup
| ddtrace.internal.datadog.profiling.stack_v2._stack_v2
)
'''
[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/processor/stats.py",
"ddtrace/internal/rate_limiter.py",
"ddtrace/internal/serverless/mini_agent.py",
"ddtrace/internal/uwsgi.py",
"ddtrace/sourcecode/_utils.py",
]
[tool.cibuildwheel]
build = ["cp27-*", "cp35-*", "cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*"]
test-command = ["python {project}/tests/smoke_test.py"]
# Skip trying to test arm64 builds on Intel Macs
test-skip = "*-macosx_universal2:arm64"
[tool.cibuildwheel.macos.environment]
# Workaround for Macos 11.0 versioning issue, a.k.a.
# `platform.mac_ver()` reports incorrect MacOS version at 11.0
# See: https://stackoverflow.com/a/65402241
SYSTEM_VERSION_COMPAT = "0"
[tool.ruff]
exclude = [
".riot",
".ddriot",
".venv*",
".git",
"__pycache__",
".eggs",
"*.egg",
"build",
"ddtrace/__init__.py",
"ddtrace/vendor/*",
"ddtrace/appsec/_iast/_taint_tracking/_vendor/*",
"ddtrace/profiling/exporter/pprof_*pb2.py",
"tests/profiling/simple_program_gevent.py",
"tests/contrib/grpc/hello_pb2.py",
"tests/contrib/django_celery/app/*",
"tests/appsec/iast/fixtures/ast/str/non_utf8_content.py",
"tests/appsec/iast/fixtures/aspects/str/non_utf8_content.py",
]
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
select = [
"A",
"D",
"E",
"F",
"G",
"I",
"W",
]
[tool.ruff.pydocstyle]
convention = "pep257"
[tool.ruff.isort]
force-single-line = true
lines-after-imports = 2
force-sort-within-sections = true
known-first-party = [ "ddtrace" ]
relative-imports-order = "furthest-to-closest"
[tool.ruff.per-file-ignores]
# Exclude typing stubs as vertical line spacing incompatibility with black
# See: https://github.com/astral-sh/ruff/pull/6501
"*.pyi" = ["I001"]