1{
2 lib,
3 aiohttp,
4 buildPythonPackage,
5 certifi,
6 fetchFromGitHub,
7 mock,
8 opentelemetry-api,
9 opentelemetry-sdk,
10 orjson,
11 pytest-asyncio,
12 pytest-cov-stub,
13 pytest-httpserver,
14 pytestCheckHook,
15 pythonOlder,
16 requests,
17 respx,
18 setuptools,
19 trustme,
20 urllib3,
21}:
22
23buildPythonPackage rec {
24 pname = "elastic-transport";
25 version = "8.17.1";
26 pyproject = true;
27
28 disabled = pythonOlder "3.7";
29
30 src = fetchFromGitHub {
31 owner = "elastic";
32 repo = "elastic-transport-python";
33 tag = "v${version}";
34 hash = "sha256-LWSvE88wEwMxRi6IZsMkIRP8UTRfImC9QZnuka1oiso=";
35 };
36
37 build-system = [ setuptools ];
38
39 dependencies = [
40 urllib3
41 certifi
42 ];
43
44 nativeCheckInputs = [
45 aiohttp
46 mock
47 opentelemetry-api
48 opentelemetry-sdk
49 orjson
50 pytest-asyncio
51 pytest-cov-stub
52 pytest-httpserver
53 pytestCheckHook
54 requests
55 respx
56 trustme
57 ];
58
59 pythonImportsCheck = [ "elastic_transport" ];
60
61 pytestFlags = [
62 "-Wignore::DeprecationWarning"
63 ];
64
65 disabledTests = [
66 # Tests require network access
67 "fingerprint"
68 "ssl"
69 "test_custom_headers"
70 "test_custom_user_agent"
71 "test_default_headers"
72 "test_head"
73 "tls"
74 "test_simple_request"
75 "test_node"
76 "test_debug_logging"
77 "test_debug_logging_uncompressed_body"
78 "test_debug_logging_no_body"
79 "test_httpbin"
80 "test_sniffed_nodes_added_to_pool"
81 "test_async_transport_httpbin"
82 ];
83
84 meta = with lib; {
85 description = "Transport classes and utilities shared among Python Elastic client libraries";
86 homepage = "https://github.com/elastic/elastic-transport-python";
87 changelog = "https://github.com/elastic/elastic-transport-python/releases/tag/${src.tag}";
88 license = licenses.asl20;
89 maintainers = with maintainers; [ fab ];
90 };
91}