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