1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
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 pytest-asyncio,
15 pythonOlder,
16 requests,
17 setuptools,
18}:
19
20buildPythonPackage rec {
21 pname = "google-cloud-storage";
22 version = "3.3.0";
23 pyproject = true;
24
25 src = fetchFromGitHub {
26 owner = "googleapis";
27 repo = "python-storage";
28 tag = "v${version}";
29 hash = "sha256-I0wC/BV8fJr3JW1nyq2TPJZlZaT4+h2lJBdGTttSzRo=";
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 pytest-asyncio
54 ];
55
56 enabledTestPaths = [
57 "tests/unit/"
58 "tests/system/"
59 ];
60
61 disabledTests = [
62 # Disable tests which require credentials and network access
63 "create"
64 "download"
65 "get"
66 "post"
67 "test_anonymous_client_access_to_public_bucket"
68 "test_build_api_url"
69 "test_ctor_mtls"
70 "test_ctor_w_api_endpoint_override"
71 "test_ctor_w_custom_endpoint_use_auth"
72 "test_hmac_key_crud"
73 "test_list_buckets"
74 "test_open"
75 "test_restore_bucket"
76 "test_set_api_request_attr"
77 "upload"
78 ];
79
80 disabledTestPaths = [
81 "tests/unit/test_bucket.py"
82 "tests/system/test_blob.py"
83 "tests/system/test_bucket.py"
84 "tests/system/test_fileio.py"
85 "tests/system/test_kms_integration.py"
86 "tests/unit/test_transfer_manager.py"
87 ];
88
89 preCheck = ''
90 # prevent google directory from shadowing google imports
91 rm -r google
92
93 # requires docker and network
94 rm tests/conformance/test_conformance.py
95 '';
96
97 pythonImportsCheck = [ "google.cloud.storage" ];
98
99 meta = {
100 description = "Google Cloud Storage API client library";
101 homepage = "https://github.com/googleapis/python-storage";
102 changelog = "https://github.com/googleapis/python-storage/blob/v${version}/CHANGELOG.md";
103 license = lib.licenses.asl20;
104 maintainers = with lib.maintainers; [ sarahec ];
105 };
106}