Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
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.31.1"; 24 pyproject = true; 25 26 disabled = pythonOlder "3.7"; 27 28 src = fetchPypi { 29 pname = "google_cloud_pubsub"; 30 inherit version; 31 hash = "sha256-9CFPaS2kNa/N+0HnfPqWIjjbluSkumRjeqpxBELZxTI="; 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 ] 47 ++ google-api-core.optional-dependencies.grpc; 48 49 optional-dependencies = { 50 libcst = [ libcst ]; 51 }; 52 53 nativeCheckInputs = [ 54 google-cloud-testutils 55 pytestCheckHook 56 pytest-asyncio 57 ]; 58 59 preCheck = '' 60 # prevent google directory from shadowing google imports 61 rm -r google 62 ''; 63 64 disabledTestPaths = [ 65 # Tests in pubsub_v1 attempt to contact pubsub.googleapis.com 66 "tests/unit/pubsub_v1" 67 ]; 68 69 pythonImportsCheck = [ "google.cloud.pubsub" ]; 70 71 meta = with lib; { 72 description = "Google Cloud Pub/Sub API client library"; 73 homepage = "https://github.com/googleapis/python-pubsub"; 74 changelog = "https://github.com/googleapis/python-pubsub/blob/v${version}/CHANGELOG.md"; 75 license = licenses.asl20; 76 maintainers = [ ]; 77 mainProgram = "fixup_pubsub_v1_keywords.py"; 78 }; 79}