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