-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathpyproject.toml
More file actions
120 lines (109 loc) · 4.23 KB
/
pyproject.toml
File metadata and controls
120 lines (109 loc) · 4.23 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
# Used for local development, not to be published.
[project]
name = "opentelemetry-python-genai"
version = "0.0.0" # This is not used.
requires-python = ">=3.10"
dependencies = [
"opentelemetry-api",
"opentelemetry-sdk",
"opentelemetry-semantic-conventions",
"opentelemetry-instrumentation",
"opentelemetry-test-utils",
"opentelemetry-test-util-genai",
"opentelemetry-util-genai",
"opentelemetry-instrumentation-anthropic[instruments]",
"opentelemetry-instrumentation-claude-agent-sdk[instruments]",
"opentelemetry-instrumentation-google-genai[instruments]",
"opentelemetry-instrumentation-langchain[instruments]",
"opentelemetry-instrumentation-openai-v2[instruments]",
"opentelemetry-instrumentation-openai-agents-v2[instruments]",
"opentelemetry-instrumentation-weaviate[instruments]",
]
# https://docs.astral.sh/uv/reference/settings/
[tool.uv]
package = false # https://docs.astral.sh/uv/reference/settings/#package
required-version = ">=0.6.0"
# https://docs.astral.sh/uv/reference/settings/#sources
[tool.uv.sources]
opentelemetry-test-util-genai = { workspace = true }
opentelemetry-util-genai = { workspace = true }
opentelemetry-instrumentation-anthropic = { workspace = true }
opentelemetry-instrumentation-claude-agent-sdk = { workspace = true }
opentelemetry-instrumentation-google-genai = { workspace = true }
opentelemetry-instrumentation-langchain = { workspace = true }
opentelemetry-instrumentation-openai-v2 = { workspace = true }
opentelemetry-instrumentation-openai-agents-v2 = { workspace = true }
opentelemetry-instrumentation-weaviate = { workspace = true }
# https://docs.astral.sh/uv/reference/settings/#workspace
[tool.uv.workspace]
members = [
"instrumentation/*",
"util/opentelemetry-test-util-genai",
"util/opentelemetry-util-genai",
]
[tool.ruff]
# https://docs.astral.sh/ruff/configuration/
target-version = "py310"
line-length = 79
extend-exclude = ["*_pb2*.py*"]
output-format = "concise"
[tool.ruff.lint]
# https://docs.astral.sh/ruff/linter/#rule-selection
# pylint: https://github.com/astral-sh/ruff/issues/970
select = [
"I", # isort
"F", # pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
"PLC", # pylint convention
"PLE", # pylint error
"Q", # flake8-quotes
"A", # flake8-builtins
"TID", # flake8-tidy-imports
]
ignore = [
"E501", # line-too-long
]
[tool.ruff.lint.per-file-ignores]
"docs/**/*.*" = ["A001"]
"instrumentation/opentelemetry-instrumentation-google-genai/tests/*" = ["TID252"]
[tool.ruff.lint.isort]
detect-same-package = false # to not consider instrumentation packages as first-party
known-first-party = ["opentelemetry"]
known-third-party = [
"pytest",
]
# https://github.com/microsoft/pyright/blob/main/docs/configuration.md#type-check-rule-overrides
[tool.pyright]
typeCheckingMode = "strict"
reportUnnecessaryTypeIgnoreComment = true
reportMissingTypeStubs = false
pythonVersion = "3.10"
reportPrivateUsage = false # Ignore private attributes added by instrumentation packages.
# Add progressively instrumentation packages here.
include = [
"instrumentation/opentelemetry-instrumentation-anthropic",
"instrumentation/opentelemetry-instrumentation-claude-agent-sdk",
"instrumentation/opentelemetry-instrumentation-langchain",
"instrumentation/opentelemetry-instrumentation-weaviate",
"util/opentelemetry-util-genai",
]
# We should also add type hints to the test suite - It helps on finding bugs.
# We are excluding for now because it's easier, and more important to add to the instrumentation packages.
exclude = [
"instrumentation/opentelemetry-instrumentation-anthropic/tests/**/*.py",
"instrumentation/opentelemetry-instrumentation-anthropic/examples/**/*.py",
"instrumentation/opentelemetry-instrumentation-claude-agent-sdk/tests/**/*.py",
"instrumentation/opentelemetry-instrumentation-claude-agent-sdk/examples/**/*.py",
"instrumentation/opentelemetry-instrumentation-langchain/tests/**/*.py",
"instrumentation/opentelemetry-instrumentation-langchain/examples/**/*.py",
"instrumentation/opentelemetry-instrumentation-weaviate/tests/**/*.py",
"instrumentation/opentelemetry-instrumentation-weaviate/examples/**/*.py",
"util/opentelemetry-util-genai/tests/**/*.py",
]
[dependency-groups]
dev = [
"tox",
"tox-uv>=1",
"pre-commit",
]