1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 google-auth,
6 googleapis-common-protos,
7 grpcio,
8 grpcio-gcp,
9 grpcio-status,
10 mock,
11 proto-plus,
12 protobuf,
13 pytest-asyncio,
14 pytestCheckHook,
15 pythonOlder,
16 requests,
17 setuptools,
18}:
19
20buildPythonPackage rec {
21 pname = "google-api-core";
22 version = "2.25.1";
23 pyproject = true;
24
25 src = fetchFromGitHub {
26 owner = "googleapis";
27 repo = "python-api-core";
28 tag = "v${version}";
29 hash = "sha256-lh4t03upQQxY2KGwucXfEeNvqVVXlZ6hjR/e47imetk=";
30 };
31
32 build-system = [ setuptools ];
33
34 dependencies = [
35 googleapis-common-protos
36 google-auth
37 protobuf
38 proto-plus
39 requests
40 ];
41
42 optional-dependencies = {
43 async_rest = [ google-auth ] ++ google-auth.optional-dependencies.aiohttp;
44 grpc = [
45 grpcio
46 grpcio-status
47 ];
48 grpcgcp = [ grpcio-gcp ];
49 grpcio-gcp = [ grpcio-gcp ];
50 };
51
52 nativeCheckInputs = [
53 mock
54 pytest-asyncio
55 pytestCheckHook
56 ];
57
58 # prevent google directory from shadowing google imports
59 preCheck = ''
60 rm -r google
61 '';
62
63 disabledTests = [
64 # Those grpc_helpers tests are failing
65 "test_wrap_unary_errors"
66 "test_wrap_stream_errors_raised"
67 "test_wrap_stream_errors_read"
68 "test_wrap_stream_errors_aiter"
69 "test_wrap_stream_errors_write"
70 "test_wrap_unary_errors"
71 "test___next___w_rpc_error"
72 "test_wrap_stream_errors_invocation"
73 "test_wrap_stream_errors_iterator_initialization"
74 "test_wrap_stream_errors_during_iteration"
75 "test_exception_with_error_code"
76 ];
77
78 pythonImportsCheck = [ "google.api_core" ];
79
80 meta = {
81 description = "Core Library for Google Client Libraries";
82 longDescription = ''
83 This library is not meant to stand-alone. Instead it defines common
84 helpers used by all Google API clients.
85 '';
86 homepage = "https://github.com/googleapis/python-api-core";
87 changelog = "https://github.com/googleapis/python-api-core/blob/${src.tag}/CHANGELOG.md";
88 license = lib.licenses.asl20;
89 maintainers = with lib.maintainers; [
90 sarahec
91 ];
92 };
93}