1{
2 lib,
3 aiohttp,
4 buildPythonPackage,
5 fetchPypi,
6 google-auth,
7 google-cloud-testutils,
8 google-crc32c,
9 mock,
10 pytest-asyncio,
11 pytestCheckHook,
12 pythonOlder,
13 requests,
14}:
15
16buildPythonPackage rec {
17 pname = "google-resumable-media";
18 version = "2.7.0";
19 format = "setuptools";
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchPypi {
24 inherit pname version;
25 hash = "sha256-Xxj1+pg29LCDFiBkocLJjBcjm/2pylCtlwzPkF8+Yls=";
26 };
27
28 propagatedBuildInputs = [
29 google-auth
30 google-crc32c
31 ];
32
33 passthru.optional-dependencies = {
34 requests = [ requests ];
35 aiohttp = [ aiohttp ];
36 };
37
38 nativeCheckInputs = [
39 google-cloud-testutils
40 mock
41 pytest-asyncio
42 pytestCheckHook
43 ] ++ passthru.optional-dependencies.requests;
44
45 preCheck = ''
46 # prevent shadowing imports
47 rm -r google
48 # fixture 'authorized_transport' not found
49 rm tests/system/requests/test_upload.py
50 # requires network
51 rm tests/system/requests/test_download.py
52 '';
53
54 pythonImportsCheck = [
55 "google._async_resumable_media"
56 "google.resumable_media"
57 ];
58
59 meta = with lib; {
60 description = "Utilities for Google Media Downloads and Resumable Uploads";
61 homepage = "https://github.com/GoogleCloudPlatform/google-resumable-media-python";
62 changelog = "https://github.com/googleapis/google-resumable-media-python/blob/v${version}/CHANGELOG.md";
63 license = licenses.asl20;
64 maintainers = with maintainers; [ ];
65 };
66}