-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
213 lines (194 loc) · 4.95 KB
/
pyproject.toml
File metadata and controls
213 lines (194 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "pharia-telemetry"
dynamic = ["version"]
description = "Telemetry utilities and shared components for Pharia projects"
readme = "README.md"
license = "MIT"
authors = [{ name = "Aleph Alpha Engineering", email = "engineering@aleph-alpha.com" }]
requires-python = ">=3.10"
keywords = [
"telemetry",
"logging",
"metrics",
"tracing",
"observability",
"opentelemetry",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Logging",
"Topic :: System :: Monitoring",
]
dependencies = [
"opentelemetry-api>=1.29.0",
"opentelemetry-sdk>=1.29.0",
"pydantic>=2.0.0",
]
[dependency-groups]
dev = [
"ruff>=0.9.2",
"mypy>=1.5.0",
"pre-commit>=3.0.0",
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"pytest-asyncio>=0.21.0",
"coverage>=7.0.0",
"structlog>=23.0.0",
"twine>=4.0.0",
]
docs = [
"sphinx>=7.0.0",
"sphinx-rtd-theme>=1.3.0",
"myst-parser>=2.0.0",
]
structlog = [
"structlog>=23.0.0",
]
[project.urls]
Homepage = "https://github.com/aleph-alpha/pharia-telemetry"
Documentation = "https://pharia-telemetry.readthedocs.io"
Repository = "https://github.com/aleph-alpha/pharia-telemetry"
Issues = "https://github.com/aleph-alpha/pharia-telemetry/issues"
Changelog = "https://github.com/aleph-alpha/pharia-telemetry/blob/main/CHANGELOG.md"
[tool.hatch.version]
source = "vcs"
[tool.hatch.version.raw-options]
# Ensure no local version identifiers for PyPI compatibility
local_scheme = "no-local-version"
[tool.hatch.build.hooks.vcs]
version-file = "src/pharia_telemetry/_version.py"
[tool.hatch.build.targets.wheel]
packages = ["src/pharia_telemetry"]
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/tests",
"/docs",
"/README.md",
"/LICENSE",
"/CHANGELOG.md",
]
# Testing configuration
[tool.pytest.ini_options]
minversion = "7.0"
addopts = [
"--strict-markers",
"--strict-config",
"--cov=pharia_telemetry",
"--cov-report=term-missing",
"--cov-report=html",
"--cov-report=xml",
]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"unit: Unit tests",
"integration: Integration tests",
"slow: Slow tests",
]
# Coverage configuration
[tool.coverage.run]
source = ["src/pharia_telemetry"]
omit = [
"*/tests/*",
"*/test_*",
"*/__init__.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
# Ruff configuration
[tool.ruff]
line-length = 88
target-version = "py310"
exclude = [
".eggs",
".git",
".hg",
".mypy_cache",
".tox",
".venv",
"_build",
"buck-out",
"build",
"dist",
"_version.py",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long, handled by black
# Temporarily ignore pyupgrade suggestions to avoid mass refactor
"UP006", # use builtins (dict, list, etc.)
"UP007", # use | for Union
"UP035", # typing.Tuple deprecated
"UP045", # X | None instead of Optional[X]
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # unused imports in __init__.py
[tool.ruff.lint.isort]
known-first-party = ["pharia_telemetry"]
# mypy configuration
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_optional = true
disallow_any_generics = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
no_implicit_reexport = true
strict_equality = true
# Enhanced async checking
warn_no_await = true
# Stricter checking for context managers
warn_unused_awaitable = true
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
disallow_incomplete_defs = false
# Still check async context manager usage in tests
warn_no_await = true
warn_unused_awaitable = true
# Flake8 configuration (in setup.cfg or .flake8 if needed)