1{ lib
2, buildPythonPackage
3, fetchPypi
4, pytestCheckHook
5, google-auth
6, google-cloud-iam
7, google-cloud-core
8, google-cloud-kms
9, google-cloud-testutils
10, google-resumable-media
11, mock
12, pythonOlder
13}:
14
15buildPythonPackage rec {
16 pname = "google-cloud-storage";
17 version = "2.5.0";
18 format = "setuptools";
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchPypi {
23 inherit pname version;
24 hash = "sha256-OC80uR3iIS48LntA7AedJ+4uPbuumbdbG82MYwY84jU=";
25 };
26
27 propagatedBuildInputs = [
28 google-auth
29 google-cloud-core
30 google-resumable-media
31 ];
32
33 checkInputs = [
34 google-cloud-iam
35 google-cloud-kms
36 google-cloud-testutils
37 mock
38 pytestCheckHook
39 ];
40
41 # disable tests which require credentials and network access
42 disabledTests = [
43 "create"
44 "download"
45 "get"
46 "post"
47 "upload"
48 "test_build_api_url"
49 "test_ctor_mtls"
50 "test_hmac_key_crud"
51 "test_list_buckets"
52 "test_open"
53 "test_anonymous_client_access_to_public_bucket"
54 ];
55
56 disabledTestPaths = [
57 "tests/unit/test_bucket.py"
58 "tests/system/test_blob.py"
59 "tests/system/test_bucket.py"
60 "tests/system/test_fileio.py"
61 "tests/system/test_kms_integration.py"
62 ];
63
64 preCheck = ''
65 # prevent google directory from shadowing google imports
66 rm -r google
67
68 # requires docker and network
69 rm tests/conformance/test_conformance.py
70 '';
71
72 pythonImportsCheck = [ "google.cloud.storage" ];
73
74 meta = with lib; {
75 description = "Google Cloud Storage API client library";
76 homepage = "https://github.com/googleapis/python-storage";
77 license = licenses.asl20;
78 maintainers = with maintainers; [ SuperSandro2000 ];
79 };
80}