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