1{
2 lib,
3 stdenv,
4 aiohttp,
5 blinker,
6 buildPythonPackage,
7 certifi,
8 ecs-logging,
9 fetchFromGitHub,
10 httpx,
11 jinja2,
12 jsonschema,
13 logbook,
14 mock,
15 pytest-asyncio,
16 pytest-bdd,
17 pytest-localserver,
18 pytest-mock,
19 pytest-random-order,
20 pytestCheckHook,
21 pythonOlder,
22 pythonRelaxDepsHook,
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.22.0";
37 pyproject = true;
38
39 disabled = pythonOlder "3.8";
40
41 src = fetchFromGitHub {
42 owner = "elastic";
43 repo = "apm-agent-python";
44 rev = "refs/tags/v${version}";
45 hash = "sha256-VuVx+QUiV4M/ebyv2uF/YZwfvcaPDJAEi55fXfoIttU=";
46 };
47
48 pythonRelaxDeps = [ "wrapt" ];
49
50 build-system = [ setuptools ];
51
52 nativeBuildInputs = [ pythonRelaxDepsHook ];
53
54 dependencies = [
55 aiohttp
56 blinker
57 certifi
58 sanic
59 starlette
60 tornado
61 urllib3
62 wrapt
63 ];
64
65 nativeCheckInputs = [
66 ecs-logging
67 httpx
68 jinja2
69 jsonschema
70 logbook
71 mock
72 pytest-asyncio
73 pytest-bdd
74 pytest-localserver
75 pytest-mock
76 pytest-random-order
77 pytestCheckHook
78 sanic-testing
79 structlog
80 webob
81 ];
82
83 disabledTests = [ "elasticapm_client" ];
84
85 disabledTestPaths =
86 [
87 # Exclude tornado tests
88 "tests/contrib/asyncio/tornado/tornado_tests.py"
89 ]
90 ++ lib.optionals stdenv.isDarwin [
91 # Flaky tests on Darwin
92 "tests/utils/threading_tests.py"
93 ];
94
95 pythonImportsCheck = [ "elasticapm" ];
96
97 meta = with lib; {
98 description = "Python agent for the Elastic APM";
99 homepage = "https://github.com/elastic/apm-agent-python";
100 changelog = "https://github.com/elastic/apm-agent-python/releases/tag/v${version}";
101 license = with licenses; [ bsd3 ];
102 maintainers = with maintainers; [ fab ];
103 mainProgram = "elasticapm-run";
104 };
105}