Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
178 lines (170 loc) · 5.55 KB
/
Copy pathpyproject.toml
File metadata and controls
178 lines (170 loc) · 5.55 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
[build-system]
requires = ["setuptools>=83.0.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "posthog"
version = "8.1.0"
description = "Integrate PostHog into any python application."
authors = [{ name = "PostHog", email = "engineering@posthog.com" }]
maintainers = [{ name = "PostHog", email = "engineering@posthog.com" }]
license = "MIT"
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"requests>=2.7,<3.0",
"distro>=1.5.0",
"typing-extensions>=4.2.0",
]
[project.urls]
Homepage = "https://github.com/posthog/posthog-python"
Repository = "https://github.com/posthog/posthog-python"
[project.optional-dependencies]
langchain = ["langchain>=1.3.9"]
async = ["httpx>=0.27.0,<1.0"]
# Opt-in zstd support for capture-v1 request compression. Kept out of the core
# dependencies so existing installs are unaffected; Python gains stdlib zstd
# only in 3.14 (compression.zstd), so the third-party package is needed until
# then.
zstd = ["zstandard>=0.23.0"]
# Note: the MCP SDK (`mcp`) is intentionally NOT an extra. It's a peer dependency of
# `instrument()` — anyone wrapping a FastMCP/Server already has it — so it's imported
# lazily and version-checked at runtime, not installed by posthog. `PostHogMCP` (custom
# dispatchers) needs nothing beyond posthog.
otel = [
"opentelemetry-sdk>=1.20.0",
"opentelemetry-exporter-otlp-proto-http>=1.20.0",
]
# Metrics autocapture (`metrics={"autocapture": True}`). Library instrumentors
# (requests, Django, psycopg, ...) are separate packages: `opentelemetry-bootstrap
# -a install` adds the ones that match the installed libraries.
# 0.58b0 is the first release with the `process.*` and `cpython.gc.*` names that
# runtime autocapture configures, and 0.60b0 the first in which the httpx
# instrumentor (installed at the same version) excludes URLs.
metrics = [
"opentelemetry-sdk>=1.39.0",
"opentelemetry-exporter-otlp-proto-http>=1.39.0",
"opentelemetry-instrumentation>=0.60b0",
"opentelemetry-instrumentation-system-metrics>=0.60b0",
]
dev = [
"django-stubs",
"griffe",
"griffe2md",
"lxml",
"mypy",
"mypy-baseline",
"types-requests",
"types-setuptools",
"pre-commit",
"pydantic>=2.12.0",
"ruff",
"setuptools",
"packaging",
"wheel",
"twine",
"tomli",
"tomli_w",
]
test = [
"freezegun==1.5.1",
"flask>=2.2",
"celery>=5.3,<6",
"opentelemetry-instrumentation-celery>=0.41b0",
"fastapi>=0.115,<1",
"python-dateutil>=2.9.0.post0",
"tzdata",
"coverage",
"pytest",
"pytest-timeout",
"pytest-asyncio",
"jsonschema>=4.0",
"django>=5.2.15,<6.0",
"djangorestframework>=3.15,<4",
"openai-agents>=0.18",
"anthropic>=0.72",
"langgraph>=1.0",
"langgraph-checkpoint>=4.1.1",
"tiktoken>=0.12.0",
"langchain-core>=1.0",
"langchain>=1.3.9",
"langchain-community>=0.4",
"langchain-openai>=1.1.14",
"langchain-anthropic>=1.0",
"google-genai",
"pydantic>=2.12.0",
"parameterized>=0.8.1",
"claude-agent-sdk",
"mcp>=1.28.1,<2",
"fastmcp>=2.0",
"opentelemetry-sdk>=1.20.0",
"opentelemetry-exporter-otlp-proto-http>=1.20.0",
"opentelemetry-instrumentation>=0.60b0",
"opentelemetry-instrumentation-system-metrics>=0.60b0",
"opentelemetry-instrumentation-requests>=0.60b0",
"opentelemetry-instrumentation-sqlite3>=0.60b0",
"opentelemetry-instrumentation-wsgi>=0.60b0",
"opentelemetry-instrumentation-flask>=0.60b0",
"opentelemetry-instrumentation-httpx>=0.60b0",
"opentelemetry-instrumentation-aiohttp-client>=0.60b0",
"opentelemetry-instrumentation-django>=0.60b0",
"pytest-bdd>=8.1.0",
"zstandard>=0.23.0",
# posthog/test/test_reference_markdown.py checks the reference generator's output.
"griffe",
"griffe2md",
# gevent 25.4.1+ replaces queue.Queue, exercising the compatibility path.
"gevent>=25.4.1; implementation_name == 'cpython'",
]
[tool.setuptools]
packages = [
"posthog",
"posthog.ai",
"posthog.ai.evaluations",
"posthog.ai.langchain",
"posthog.ai.openai",
"posthog.ai.openai_agents",
"posthog.ai.anthropic",
"posthog.ai.gemini",
"posthog.ai.claude_agent_sdk",
"posthog.ai.otel",
"posthog.mcp",
"posthog.tracing",
"posthog.test",
"posthog.test.ai",
"posthog.test.ai.openai_agents",
"posthog.test.ai.claude_agent_sdk",
"posthog.test.ai.otel",
"posthog.test.mcp",
"posthog.test.tracing",
"posthog.integrations",
]
[tool.uv]
exclude-newer = "7 days"
# certifi 2026.10.19 drops the compromised eMudhra root and is newer than the 7-day cooldown.
exclude-newer-package = { certifi = "1 day" }
required-version = ">=0.8.0"
# Declares a uv workspace so tooling (incl. Sampo's release flow) discovers the
# in-repo openfeature-provider-posthog package. The main `posthog` package and
# its build are unaffected (packages list above is explicit).
[tool.uv.workspace]
members = ["openfeature-provider"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
testpaths = ["posthog/test"]
norecursedirs = ["integration_tests"]
[dependency-groups]
dev = [
"claude-agent-sdk>=0.1.50",
]