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