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 pythonOlder, 23 sanic, 24 sanic-testing, 25 setuptools, 26 starlette, 27 structlog, 28 tornado, 29 urllib3, 30 webob, 31 wrapt, 32}: 33 34buildPythonPackage rec { 35 pname = "elastic-apm"; 36 version = "6.23.0"; 37 pyproject = true; 38 39 disabled = pythonOlder "3.8"; 40 41 src = fetchFromGitHub { 42 owner = "elastic"; 43 repo = "apm-agent-python"; 44 tag = "v${version}"; 45 hash = "sha256-S1Ebo9AWN+Mf3OFwxNTiR/AZtje3gNiYkZnVqGb7D4c="; 46 }; 47 48 patches = [ 49 (fetchpatch { 50 name = "fix-tests-with-latest-starlette-and-sanic.patch"; 51 url = "https://github.com/elastic/apm-agent-python/commit/80d167f54b6bf1db8b6e7ee52e2ac6803bc64f54.patch"; 52 hash = "sha256-VtA7+SyEZiL3aqpikyYJQ4tmdmsUpIdkSx6RtC1AzqY="; 53 }) 54 ]; 55 56 pythonRelaxDeps = [ "wrapt" ]; 57 58 build-system = [ setuptools ]; 59 60 dependencies = [ 61 aiohttp 62 blinker 63 certifi 64 sanic 65 starlette 66 tornado 67 urllib3 68 wrapt 69 ]; 70 71 nativeCheckInputs = [ 72 ecs-logging 73 httpx 74 jinja2 75 jsonschema 76 logbook 77 mock 78 pytest-asyncio 79 pytest-bdd 80 pytest-localserver 81 pytest-mock 82 pytest-random-order 83 pytestCheckHook 84 sanic-testing 85 structlog 86 webob 87 ]; 88 89 disabledTests = [ "elasticapm_client" ]; 90 91 disabledTestPaths = 92 [ 93 # Exclude tornado tests 94 "tests/contrib/asyncio/tornado/tornado_tests.py" 95 ] 96 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 97 # Flaky tests on Darwin 98 "tests/utils/threading_tests.py" 99 ]; 100 101 pythonImportsCheck = [ "elasticapm" ]; 102 103 meta = with lib; { 104 description = "Python agent for the Elastic APM"; 105 homepage = "https://github.com/elastic/apm-agent-python"; 106 changelog = "https://github.com/elastic/apm-agent-python/releases/tag/v${version}"; 107 license = with licenses; [ bsd3 ]; 108 maintainers = with maintainers; [ fab ]; 109 mainProgram = "elasticapm-run"; 110 }; 111}