nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 aiohttp,
4 buildPythonPackage,
5 certifi,
6 fetchFromGitHub,
7 fetchpatch,
8 mock,
9 opentelemetry-api,
10 opentelemetry-sdk,
11 orjson,
12 pytest-asyncio,
13 pytest-cov-stub,
14 pytest-httpserver,
15 pytestCheckHook,
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 src = fetchFromGitHub {
29 owner = "elastic";
30 repo = "elastic-transport-python";
31 tag = "v${version}";
32 hash = "sha256-LWSvE88wEwMxRi6IZsMkIRP8UTRfImC9QZnuka1oiso=";
33 };
34
35 # FIXME: backport fix for pytest-asyncio 1.2.0, as updating this entire ecosystem is painful
36 patches = [
37 (fetchpatch {
38 url = "https://github.com/elastic/elastic-transport-python/commit/d749d0be54821e81979888ff34b1451354548863.patch";
39 hash = "sha256-FrabqeLn3Sr1sg/lWWYsMPd0CZS/6BZYLnaK66T93BQ=";
40 })
41 ];
42
43 build-system = [ setuptools ];
44
45 dependencies = [
46 urllib3
47 certifi
48 ];
49
50 nativeCheckInputs = [
51 aiohttp
52 mock
53 opentelemetry-api
54 opentelemetry-sdk
55 orjson
56 pytest-asyncio
57 pytest-cov-stub
58 pytest-httpserver
59 pytestCheckHook
60 requests
61 respx
62 trustme
63 ];
64
65 pythonImportsCheck = [ "elastic_transport" ];
66
67 pytestFlags = [
68 "-Wignore::DeprecationWarning"
69 ];
70
71 disabledTests = [
72 # Tests require network access
73 "fingerprint"
74 "ssl"
75 "test_custom_headers"
76 "test_custom_user_agent"
77 "test_default_headers"
78 "test_head"
79 "tls"
80 "test_simple_request"
81 "test_node"
82 "test_debug_logging"
83 "test_debug_logging_uncompressed_body"
84 "test_debug_logging_no_body"
85 "test_httpbin"
86 "test_sniffed_nodes_added_to_pool"
87 "test_async_transport_httpbin"
88 ];
89
90 meta = {
91 description = "Transport classes and utilities shared among Python Elastic client libraries";
92 homepage = "https://github.com/elastic/elastic-transport-python";
93 changelog = "https://github.com/elastic/elastic-transport-python/releases/tag/${src.tag}";
94 license = lib.licenses.asl20;
95 maintainers = with lib.maintainers; [ fab ];
96 };
97}