-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
132 lines (118 loc) · 3.98 KB
/
Copy pathpyproject.toml
File metadata and controls
132 lines (118 loc) · 3.98 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
[build-system]
# wrapt is needed at build time because reading the dynamic version imports
# the package, and the package imports wrapt at the top level.
requires = ["setuptools>=62.0", "wheel", "wrapt>=2.4.1"]
build-backend = "setuptools.build_meta"
[project]
name = "wrapture"
dynamic = ["version"]
description = "Monkey patch, test, and trace Python by attaching bindings to call sites, without modifying the code being observed. Built on wrapt."
readme = "README.md"
license = "BSD-2-Clause"
license-files = ["LICENSE"]
authors = [
{name = "Graham Dumpleton", email = "Graham.Dumpleton@gmail.com"}
]
requires-python = ">=3.12"
keywords = ["wrapper", "monkey patching", "tracing", "testing"]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
]
dependencies = [
"packaging>=24.0",
"wrapt>=2.4.1",
]
[project.urls]
Homepage = "https://github.com/GrahamDumpleton/wrapture"
Documentation = "https://wrapture.readthedocs.io"
"Bug Tracker" = "https://github.com/GrahamDumpleton/wrapture/issues/"
# The zero-code injection trigger, in the shape autowrapt consumes:
# AUTOWRAPT_BOOTSTRAP=wrapture names this entry point group, which
# autowrapt hands to wrapt.discover_post_import_hooks() at interpreter
# startup. Each entry maps a trigger module to a callback; hooking os,
# which is always already imported by then, makes the callback fire
# immediately at startup. Inert metadata unless autowrapt is installed
# and the environment variable is set; wrapture itself has no
# dependency on autowrapt and never imports it.
[project.entry-points.wrapture]
os = "wrapture.bootstrap:bootstrap"
[project.optional-dependencies]
dev = [
"mypy",
"pytest",
"ruff",
"setuptools",
]
docs = [
"myst-parser",
"sphinx",
"sphinx-rtd-theme",
]
# The OpenTelemetry export sinks ship in every wheel; this extra adds
# the dependencies they import. The http/protobuf exporter is the
# lighter default; the gRPC exporter is used when installed but not
# pulled in here.
otel = [
"opentelemetry-sdk",
"opentelemetry-exporter-otlp-proto-http",
]
[tool.setuptools]
package-dir = {"" = "src"}
zip-safe = false
packages = ["wrapture", "wrapture.otel", "wrapture.tools"]
[tool.setuptools.package-data]
wrapture = ["py.typed"]
[tool.setuptools.dynamic]
version = {attr = "wrapture.__version__"}
[dependency-groups]
test = [
"pytest",
# The otel extra's packages, so the wrapture.otel subpackage and
# its tests run in every test environment (and, through the dev
# group, typecheck in the default one).
"opentelemetry-sdk",
"opentelemetry-exporter-otlp-proto-http",
]
dev = [
{include-group = "test"},
"mypy",
"ruff",
"setuptools",
]
[tool.pytest.ini_options]
# The docs are on the test paths so the interpreter transcripts in the
# getting started page run as doctests and cannot rot.
testpaths = ["tests", "docs"]
addopts = "--doctest-glob=*.md"
# ELLIPSIS lets a transcript elide values that vary between runs, such
# as the elapsed time on a printer's closing line.
doctest_optionflags = ["ELLIPSIS"]
[tool.mypy]
python_version = "3.12"
strict = true
files = ["src/wrapture", "tests"]
# The gRPC OTLP exporter is used when installed but is deliberately
# not a dependency of the otel extra, so it is absent from the dev
# environment mypy runs in.
[[tool.mypy.overrides]]
module = ["opentelemetry.exporter.otlp.proto.grpc.*"]
ignore_missing_imports = true
[tool.ruff]
line-length = 88
target-version = "py312"
[tool.ruff.lint]
# Version information is defined before the imports in __init__.py.
per-file-ignores = {"src/wrapture/__init__.py" = ["E402"]}
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear
]