1{ lib
2, aiohttp
3, buildPythonPackage
4, certifi
5, fetchFromGitHub
6, mock
7, pytest-asyncio
8, pytest-httpserver
9, pytestCheckHook
10, pythonOlder
11, requests
12, trustme
13, urllib3
14}:
15
16buildPythonPackage rec {
17 pname = "elastic-transport";
18 version = "8.4.1";
19 format = "setuptools";
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchFromGitHub {
24 owner = "elastic";
25 repo = "elastic-transport-python";
26 rev = "refs/tags/v${version}";
27 hash = "sha256-hrI8GJaI3K/3B0Vng0WvoabDP2Y8/60/tHNKo/Xq6JM=";
28 };
29
30 postPatch = ''
31 substituteInPlace setup.cfg \
32 --replace " --cov-report=term-missing --cov=elastic_transport" ""
33 '';
34
35 propagatedBuildInputs = [
36 urllib3
37 certifi
38 ];
39
40 nativeCheckInputs = [
41 aiohttp
42 mock
43 pytest-asyncio
44 pytest-httpserver
45 pytestCheckHook
46 requests
47 trustme
48 ];
49
50 pythonImportsCheck = [
51 "elastic_transport"
52 ];
53
54 disabledTests = [
55 # Tests require network access
56 "fingerprint"
57 "ssl"
58 "test_custom_headers"
59 "test_custom_user_agent"
60 "test_default_headers"
61 "test_head"
62 "tls"
63 "test_simple_request"
64 "test_node"
65 "test_debug_logging"
66 "test_debug_logging_uncompressed_body"
67 "test_debug_logging_no_body"
68 "test_httpbin"
69 "test_sniffed_nodes_added_to_pool"
70 ];
71
72 meta = with lib; {
73 description = "Transport classes and utilities shared among Python Elastic client libraries";
74 homepage = "https://github.com/elasticsearch/elastic-transport-python";
75 changelog = "https://github.com/elastic/elastic-transport-python/releases/tag/v${version}";
76 license = licenses.asl20;
77 maintainers = with maintainers; [ fab ];
78 };
79}