1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
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.19.0";
23 pyproject = true;
24
25 disabled = pythonOlder "3.6";
26
27 src = fetchPypi {
28 inherit pname version;
29 hash = "sha256-zxt8JpQEeIbSrxEooDrpnjkRCKCIBPh8/TWXDknJzRA=";
30 };
31
32 nativeBuildInputs = [ setuptools ];
33
34 propagatedBuildInputs = [
35 googleapis-common-protos
36 google-auth
37 protobuf
38 proto-plus
39 requests
40 ];
41
42 passthru.optional-dependencies = {
43 grpc = [
44 grpcio
45 grpcio-status
46 ];
47 grpcgcp = [ grpcio-gcp ];
48 grpcio-gcp = [ grpcio-gcp ];
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 = [ "google.api_core" ];
78
79 meta = with lib; {
80 description = "Core Library for Google Client Libraries";
81 longDescription = ''
82 This library is not meant to stand-alone. Instead it defines common
83 helpers used by all Google API clients.
84 '';
85 homepage = "https://github.com/googleapis/python-api-core";
86 changelog = "https://github.com/googleapis/python-api-core/blob/v${version}/CHANGELOG.md";
87 license = licenses.asl20;
88 maintainers = [ ];
89 };
90}