1{ lib
2, buildPythonPackage
3, fetchPypi
4, google-api-core
5, google-cloud-testutils
6, grpc-google-iam-v1
7, grpcio
8, grpcio-status
9, libcst
10, proto-plus
11, protobuf
12, pytest-asyncio
13, pytestCheckHook
14, pythonOlder
15}:
16
17buildPythonPackage rec {
18 pname = "google-cloud-pubsub";
19 version = "2.18.4";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-Muth/UwdxshC9ZTWnZr6gFROOzJ6pkChZOtvsCAery0=";
27 };
28
29 propagatedBuildInputs = [
30 google-api-core
31 grpc-google-iam-v1
32 grpcio
33 grpcio-status
34 libcst
35 proto-plus
36 protobuf
37 ] ++ google-api-core.optional-dependencies.grpc;
38
39 passthru.optional-dependencies = {
40 libcst = [
41 libcst
42 ];
43 };
44
45 nativeCheckInputs = [
46 google-cloud-testutils
47 pytestCheckHook
48 pytest-asyncio
49 ];
50
51 preCheck = ''
52 # prevent google directory from shadowing google imports
53 rm -r google
54 '';
55
56 disabledTestPaths = [
57 # Tests in pubsub_v1 attempt to contact pubsub.googleapis.com
58 "tests/unit/pubsub_v1"
59 ];
60
61 pythonImportsCheck = [
62 "google.cloud.pubsub"
63 ];
64
65 meta = with lib; {
66 description = "Google Cloud Pub/Sub API client library";
67 homepage = "https://github.com/googleapis/python-pubsub";
68 changelog = "https://github.com/googleapis/python-pubsub/blob/v${version}/CHANGELOG.md";
69 license = licenses.asl20;
70 maintainers = with maintainers; [ ];
71 };
72}