forked from pydantic/logfire
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
241 lines (222 loc) · 8.32 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "logfire"
version = "0.33.0"
description = "The best Python observability tool! 🪵🔥"
authors = [
{ name = "Pydantic Team", email = "engineering@pydantic.dev" },
{ name = "Samuel Colvin", email = "samuel@pydantic.dev" },
{ name = "Hasan Ramezani", email = "hasan@pydantic.dev" },
{ name = "Adrian Garcia Badaracco", email = "adrian@pydantic.dev" },
{ name = "David Montague", email = "david@pydantic.dev" },
{ name = "Marcelo Trylesinski", email = "marcelo@pydantic.dev" },
{ name = "David Hewitt", email = "david.hewitt@pydantic.dev" },
{ name = "Alex Hall", email = "alex@pydantic.dev" },
]
license = "MIT"
readme = "README.md"
classifiers = [
'Development Status :: 4 - Beta',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'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',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Operating System :: Unix',
'Operating System :: POSIX :: Linux',
'Environment :: Console',
'Environment :: MacOS X',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Internet',
]
dependencies = [
"opentelemetry-sdk >= 1.21.0",
"opentelemetry-exporter-otlp-proto-http >= 1.21.0",
"opentelemetry-instrumentation >= 0.41b0",
"rich >= 13.4.2",
"protobuf >= 4.23.4",
"typing-extensions >= 4.1.0",
"tomli >= 2.0.1; python_version < '3.11'",
"executing>=2.0.1",
]
[project.optional-dependencies]
system-metrics = ["opentelemetry-instrumentation-system-metrics >= 0.42b0"]
aiohttp = ["opentelemetry-instrumentation-aiohttp-client >= 0.42b0"]
celery = ["opentelemetry-instrumentation-celery >= 0.42b0"]
django = ["opentelemetry-instrumentation-django >= 0.42b0"]
fastapi = ["opentelemetry-instrumentation-fastapi >= 0.42b0"]
flask = ["opentelemetry-instrumentation-flask >= 0.42b0"]
httpx = ["opentelemetry-instrumentation-httpx >= 0.42b0"]
starlette = ["opentelemetry-instrumentation-starlette >= 0.42b0"]
sqlalchemy = ["opentelemetry-instrumentation-sqlalchemy >= 0.42b0"]
asyncpg = ["opentelemetry-instrumentation-asyncpg >= 0.42b0"]
psycopg = ["opentelemetry-instrumentation-psycopg >= 0.42b0", "packaging"]
psycopg2 = ["opentelemetry-instrumentation-psycopg2 >= 0.42b0", "packaging"]
pymongo = ["opentelemetry-instrumentation-pymongo >= 0.42b0"]
redis = ["opentelemetry-instrumentation-redis >= 0.42b0"]
requests = ["opentelemetry-instrumentation-requests >= 0.42b0"]
[project.scripts]
logfire = "logfire.cli:main"
[project.entry-points."pydantic"]
logfire-plugin = "logfire.integrations.pydantic:plugin"
[project.entry-points."pytest11"]
logfire = "logfire.testing"
[tool.rye]
managed = true
dev-dependencies = [
"anyio",
"httpx",
"starlette",
"fastapi",
"Flask",
"django",
"dirty-equals",
"pytest",
"pytest-django",
"pytest-pretty",
"pydantic",
"requests",
"sqlalchemy",
"pandas",
"attrs",
"openai",
"opentelemetry-instrumentation-aiohttp-client",
"opentelemetry-instrumentation-asgi",
"opentelemetry-instrumentation-wsgi",
"opentelemetry-instrumentation-fastapi",
"opentelemetry-instrumentation-starlette",
"opentelemetry-instrumentation-flask",
"opentelemetry-instrumentation-django",
"opentelemetry-instrumentation-httpx",
"opentelemetry-instrumentation-requests",
"opentelemetry-instrumentation-sqlalchemy",
"opentelemetry-instrumentation-system-metrics",
"opentelemetry-instrumentation-asyncpg",
"opentelemetry-instrumentation-psycopg",
"opentelemetry-instrumentation-psycopg2",
"gitpython",
"eval-type-backport",
"requests-mock",
"inline-snapshot",
"structlog",
"loguru",
"ruff",
"pyright>=1.1.360",
"pre-commit>=3.5.0",
"mkdocs>=1.5.0",
"mkdocs-material>=9.5.17",
"mkdocs-glightbox>=0.3.7",
"mkdocstrings-python>=1.8.0",
"coverage[toml]>=7.5.0",
"psycopg[binary]",
"psycopg2-binary",
"asyncpg",
"cloudpickle>=3.0.0",
"anthropic",
]
[tool.rye.scripts]
typecheck = "pyright"
docs = "mkdocs build"
# no strict so you can build the docs without insiders packages
docs-serve = "mkdocs serve --no-strict"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["logfire"]
[tool.hatch.build.targets.sdist]
include = ["/README.md", "/Makefile", "/logfire", "/tests"]
# https://beta.ruff.rs/docs/configuration/
[tool.ruff]
line-length = 120
[tool.ruff.lint]
extend-select = [
"Q",
"RUF100",
"C90",
"UP",
"I",
"D",
"DTZ005", # https://docs.astral.sh/ruff/rules/call-datetime-now-without-tzinfo/
] # add "T" to disallow prints
flake8-quotes = { inline-quotes = "single", multiline-quotes = "double" }
isort = { combine-as-imports = true, known-first-party = ["logfire"] }
mccabe = { max-complexity = 14 }
ignore = [
"D107", # ignore missing docstring in __init__ methods
"D100", # ignore missing docstring in module
"D104", # ignore missing docstring in public package
"D105", # ignore missing docstring in magic methods
"C901", # ignore too complex functions, doesn't seem to be worth it
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["D"]
"docs/**/*.py" = ["D"]
[tool.ruff.format]
docstring-code-format = true
quote-style = "single"
[tool.pyright]
typeCheckingMode = "strict"
reportUnnecessaryTypeIgnoreComment = true
reportMissingTypeStubs = false
exclude = ["docs/**/*.py", "site/**/*.py", ".venv", "venv*"]
venvPath = ".venv"
[tool.pytest.ini_options]
xfail_strict = true
filterwarnings = [
"error",
# fastapi uses deprecated pydantic functions
"ignore:`FieldValidationInfo` is deprecated.*:DeprecationWarning:pydantic_core:",
"ignore:`general_(before|after|wrap|plain)_validator_function` is deprecated.*:DeprecationWarning:fastapi:",
"ignore:`general_(before|after|wrap|plain)_validator_function` is deprecated.*:DeprecationWarning:pydantic_core:",
# google packages are using deprecated APIs
"ignore::DeprecationWarning:pkg_resources*:",
"ignore::DeprecationWarning:google*:",
"ignore:.* google._upb._message.*:DeprecationWarning",
# OTEL uses some deprecated APIs
"ignore:pkg_resources:DeprecationWarning:opentelemetry.instrumentation.dependencies*:",
# To be able to test numpy.matrix
"ignore:the matrix subclass is not the recommended way.*:PendingDeprecationWarning",
# See test_filter_warnings in test_testing.py
'ignore:(?s).*google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.*scheduler\.shutdown.*IndexError. tuple index out of range:pytest.PytestUnhandledThreadExceptionWarning',
'ignore:(?s).*aiosqlite/core\.py.*get_loop\(future\).call_soon_threadsafe.*RuntimeError. Event loop is closed:pytest.PytestUnhandledThreadExceptionWarning',
# This problem is fixed in https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2013, but not the warning.
"ignore:The '__version__' attribute is deprecated and will be removed in Flask 3.1:DeprecationWarning",
# ignore DeprecationWarning from httpx - Marcelo knows why this is happening
"ignore:The 'app' shortcut is now deprecated.*:DeprecationWarning:httpx*:",
]
DJANGO_SETTINGS_MODULE = "tests.otel_integrations.django_test_project.django_test_site.settings"
# https://coverage.readthedocs.io/en/latest/config.html#run
[tool.coverage.run]
branch = true
# Use this to get the tests that are covering the code. This is disabled by default because it can be slow.
# dynamic_context = "test_function"
# https://coverage.readthedocs.io/en/latest/config.html#report
[tool.coverage.report]
skip_covered = true
show_missing = true
ignore_errors = true
precision = 2
exclude_lines = [
'def __repr__',
'pragma: no cover',
'raise NotImplementedError',
'if TYPE_CHECKING:',
'if typing.TYPE_CHECKING:',
'@overload',
'@typing.overload',
'\(Protocol\):$',
'typing.assert_never',
'assert_never',
'if __name__ == .__main__.:',
]