1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4
5# build-system
6, setuptools
7
8# dependencies
9, certifi
10, urllib3
11
12# optional-dependencies
13, aiohttp
14, anthropic
15, asyncpg
16, apache-beam
17, bottle
18, celery
19, celery-redbeat
20, chalice
21, clickhouse-driver
22, django
23, falcon
24, fastapi
25, flask
26, blinker
27, markupsafe
28, grpcio
29, protobuf
30, httpx
31, huey
32, huggingface-hub
33, langchain
34, loguru
35, openai
36, tiktoken
37, pure-eval
38, executing
39, asttokens
40, pymongo
41, pyspark
42, quart
43, rq
44, sanic
45, sqlalchemy
46, starlette
47, tornado
48
49# checks
50, ipdb
51, jsonschema
52, pip
53, pyrsistent
54, pysocks
55, pytest-asyncio
56, pytestCheckHook
57, pytest-forked
58, pytest-localserver
59, pytest-xdist
60, pytest-watch
61, responses
62}:
63
64buildPythonPackage rec {
65 pname = "sentry-sdk";
66 version = "2.11.0";
67 pyproject = true;
68
69 src = fetchFromGitHub {
70 owner = "getsentry";
71 repo = "sentry-python";
72 rev = version;
73 hash = "sha256-ajinOND8MC9Z69WPxF65wjOmJfU5CZUzTRWJwLLh/OQ=";
74 };
75
76 postPatch = ''
77 sed -i "/addopts =/d" pytest.ini
78 '';
79
80 build-system = [
81 setuptools
82 ];
83
84 dependencies = [
85 certifi
86 urllib3
87 ];
88
89 optional-dependencies = {
90 aiohttp = [ aiohttp ];
91 anthropic = [ anthropic ];
92 # TODO: arq
93 asyncpg = [ asyncpg ];
94 beam = [ apache-beam ];
95 bottle = [ bottle ];
96 celery = [ celery ];
97 celery-redbeat = [ celery-redbeat ];
98 chalice = [ chalice ];
99 clickhouse-driver = [ clickhouse-driver ];
100 django = [ django ];
101 falcon = [ falcon ];
102 fastapi = [ fastapi ];
103 flask = [
104 blinker
105 flask
106 markupsafe
107 ];
108 grpcio = [
109 grpcio
110 protobuf
111 ];
112 httpx = [ httpx ];
113 huey = [ huey ];
114 huggingface-hub = [ huggingface-hub ];
115 langchain = [ langchain ];
116 loguru = [ loguru ];
117 openai = [
118 openai
119 tiktoken
120 ];
121 # TODO: opentelemetry
122 # TODO: opentelemetry-experimental
123 pure_eval = [
124 asttokens
125 executing
126 pure-eval
127 ];
128 pymongo = [ pymongo ];
129 pyspark = [ pyspark ];
130 quart = [
131 blinker
132 quart
133 ];
134 rq = [ rq ];
135 sanic = [ sanic ];
136 sqlalchemy = [ sqlalchemy ];
137 starlette = [ starlette ];
138 # TODO: starlite
139 tornado = [ tornado ];
140 };
141
142 nativeCheckInputs = [
143 ipdb
144 pyrsistent
145 responses
146 pysocks
147 setuptools
148 executing
149 jsonschema
150 pip
151 pytest-asyncio
152 pytest-forked
153 pytest-localserver
154 pytest-xdist
155 pytest-watch
156 pytestCheckHook
157 ];
158
159 __darwinAllowLocalNetworking = true;
160
161 disabledTests = [
162 # depends on git revision
163 "test_default_release"
164 # tries to pip install old setuptools version
165 "test_error_has_existing_trace_context_performance_disabled"
166 "test_error_has_existing_trace_context_performance_enabled"
167 "test_error_has_new_trace_context_performance_disabled"
168 "test_error_has_new_trace_context_performance_enabled"
169 "test_traces_sampler_gets_correct_values_in_sampling_context"
170 "test_performance_error"
171 "test_performance_no_error"
172 "test_timeout_error"
173 "test_handled_exception"
174 "test_unhandled_exception"
175 # network access
176 "test_create_connection_trace"
177 "test_crumb_capture"
178 "test_getaddrinfo_trace"
179 "test_omit_url_data_if_parsing_fails"
180 "test_span_origin"
181 # AttributeError: type object 'ABCMeta' has no attribute 'setup_once'
182 "test_ensure_integration_enabled_async_no_original_function_enabled"
183 "test_ensure_integration_enabled_no_original_function_enabled"
184 # sess = envelopes[1]
185 # IndexError: list index out of range
186 "test_session_mode_defaults_to_request_mode_in_wsgi_handler"
187 # assert count_item_types["sessions"] == 1
188 # assert 0 == 1
189 "test_auto_session_tracking_with_aggregates"
190 # timing sensitive
191 "test_profile_captured"
192 ];
193
194 pythonImportsCheck = [ "sentry_sdk" ];
195
196 meta = with lib; {
197 description = "Official Python SDK for Sentry.io";
198 homepage = "https://github.com/getsentry/sentry-python";
199 changelog = "https://github.com/getsentry/sentry-python/blob/${src.rev}/CHANGELOG.md";
200 license = licenses.mit;
201 maintainers = with maintainers; [ hexa ];
202 };
203}