1{ 2 lib, 3 buildPythonPackage, 4 fetchPypi, 5 google-auth, 6 google-cloud-core, 7 google-cloud-iam, 8 google-cloud-kms, 9 google-cloud-testutils, 10 google-resumable-media, 11 mock, 12 protobuf, 13 pytestCheckHook, 14 pythonOlder, 15 pythonRelaxDepsHook, 16 requests, 17 setuptools, 18}: 19 20buildPythonPackage rec { 21 pname = "google-cloud-storage"; 22 version = "2.16.0"; 23 pyproject = true; 24 25 disabled = pythonOlder "3.7"; 26 27 src = fetchPypi { 28 inherit pname version; 29 hash = "sha256-3aSF+lA3EKgo0BJGvRbOnbCCPcUbvKdCzpamgX1YZp8="; 30 }; 31 32 nativeBuildInputs = [ 33 pythonRelaxDepsHook 34 setuptools 35 ]; 36 37 pythonRelaxDeps = [ "google-auth" ]; 38 39 propagatedBuildInputs = [ 40 google-auth 41 google-cloud-core 42 google-resumable-media 43 requests 44 ]; 45 46 passthru.optional-dependencies = { 47 protobuf = [ protobuf ]; 48 }; 49 50 nativeCheckInputs = [ 51 google-cloud-iam 52 google-cloud-kms 53 google-cloud-testutils 54 mock 55 pytestCheckHook 56 ]; 57 58 # Disable tests which require credentials and network access 59 disabledTests = [ 60 "create" 61 "download" 62 "get" 63 "post" 64 "upload" 65 "test_build_api_url" 66 "test_ctor_mtls" 67 "test_hmac_key_crud" 68 "test_list_buckets" 69 "test_open" 70 "test_anonymous_client_access_to_public_bucket" 71 "test_ctor_w_custom_endpoint_use_auth" 72 "test_ctor_w_api_endpoint_override" 73 ]; 74 75 disabledTestPaths = [ 76 "tests/unit/test_bucket.py" 77 "tests/system/test_blob.py" 78 "tests/system/test_bucket.py" 79 "tests/system/test_fileio.py" 80 "tests/system/test_kms_integration.py" 81 "tests/unit/test_transfer_manager.py" 82 ]; 83 84 preCheck = '' 85 # prevent google directory from shadowing google imports 86 rm -r google 87 88 # requires docker and network 89 rm tests/conformance/test_conformance.py 90 ''; 91 92 pythonImportsCheck = [ "google.cloud.storage" ]; 93 94 meta = with lib; { 95 description = "Google Cloud Storage API client library"; 96 homepage = "https://github.com/googleapis/python-storage"; 97 changelog = "https://github.com/googleapis/python-storage/blob/v${version}/CHANGELOG.md"; 98 license = licenses.asl20; 99 maintainers = with maintainers; [ ]; 100 }; 101}