1{ 2 lib, 3 stdenv, 4 aiohttp, 5 blinker, 6 buildPythonPackage, 7 certifi, 8 ecs-logging, 9 fetchFromGitHub, 10 fetchpatch, 11 httpx, 12 jinja2, 13 jsonschema, 14 logbook, 15 mock, 16 pytest-asyncio, 17 pytest-bdd, 18 pytest-localserver, 19 pytest-mock, 20 pytest-random-order, 21 pytestCheckHook, 22 sanic, 23 sanic-testing, 24 setuptools, 25 starlette, 26 structlog, 27 tornado, 28 urllib3, 29 webob, 30 wrapt, 31}: 32 33buildPythonPackage rec { 34 pname = "elastic-apm"; 35 version = "6.24.0"; 36 pyproject = true; 37 38 src = fetchFromGitHub { 39 owner = "elastic"; 40 repo = "apm-agent-python"; 41 tag = "v${version}"; 42 hash = "sha256-mHDUcIII1gERlGMJvXPe3Hb38wNAylfMQpeLjA1Xbuk="; 43 }; 44 45 build-system = [ setuptools ]; 46 47 dependencies = [ 48 aiohttp 49 blinker 50 certifi 51 sanic 52 starlette 53 tornado 54 urllib3 55 wrapt 56 ]; 57 58 nativeCheckInputs = [ 59 ecs-logging 60 httpx 61 jinja2 62 jsonschema 63 logbook 64 mock 65 pytest-asyncio 66 pytest-bdd 67 pytest-localserver 68 pytest-mock 69 pytest-random-order 70 pytestCheckHook 71 sanic-testing 72 structlog 73 webob 74 ]; 75 76 disabledTests = [ 77 "elasticapm_client" 78 "test_get_name_from_func_partialmethod_unbound" 79 ]; 80 81 disabledTestPaths = [ 82 # Exclude tornado tests 83 "tests/contrib/asyncio/tornado/tornado_tests.py" 84 # Exclude client tests 85 "tests/instrumentation/asyncio_tests/aiohttp_client_tests.py" 86 ] 87 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 88 # Flaky tests on Darwin 89 "tests/utils/threading_tests.py" 90 ]; 91 92 pythonImportsCheck = [ "elasticapm" ]; 93 94 meta = with lib; { 95 description = "Python agent for the Elastic APM"; 96 homepage = "https://github.com/elastic/apm-agent-python"; 97 changelog = "https://github.com/elastic/apm-agent-python/releases/tag/${src.tag}"; 98 license = licenses.bsd3; 99 maintainers = with maintainers; [ fab ]; 100 mainProgram = "elasticapm-run"; 101 }; 102}