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 = "2.18.2";
22 pyproject = true;
23
24 disabled = pythonOlder "3.7";
25
26 src = fetchPypi {
27 pname = "google_cloud_storage";
28 inherit version;
29 hash = "sha256-qves1wza2fJ00pMyZz/KuYcI0OH03OtaU1aq7wavTZk=";
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_set_api_request_attr"
70 "upload"
71 ];
72
73 disabledTestPaths = [
74 "tests/unit/test_bucket.py"
75 "tests/system/test_blob.py"
76 "tests/system/test_bucket.py"
77 "tests/system/test_fileio.py"
78 "tests/system/test_kms_integration.py"
79 "tests/unit/test_transfer_manager.py"
80 ];
81
82 preCheck = ''
83 # prevent google directory from shadowing google imports
84 rm -r google
85
86 # requires docker and network
87 rm tests/conformance/test_conformance.py
88 '';
89
90 pythonImportsCheck = [ "google.cloud.storage" ];
91
92 meta = with lib; {
93 description = "Google Cloud Storage API client library";
94 homepage = "https://github.com/googleapis/python-storage";
95 changelog = "https://github.com/googleapis/python-storage/blob/v${version}/CHANGELOG.md";
96 license = licenses.asl20;
97 maintainers = [ ];
98 };
99}