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