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 setuptools,
15}:
16
17buildPythonPackage rec {
18 pname = "google-resumable-media";
19 version = "2.7.2";
20 pyproject = true;
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchPypi {
25 pname = "google_resumable_media";
26 inherit version;
27 hash = "sha256-UoCu1GKfK2C4R7DUL5hX/Uk1wRryZnRN8z2AdMrpL+A=";
28 };
29
30 build-system = [ setuptools ];
31
32 dependencies = [
33 google-auth
34 google-crc32c
35 ];
36
37 optional-dependencies = {
38 requests = [ requests ];
39 aiohttp = [ aiohttp ];
40 };
41
42 nativeCheckInputs = [
43 google-cloud-testutils
44 mock
45 pytest-asyncio
46 pytestCheckHook
47 ] ++ optional-dependencies.requests;
48
49 preCheck = ''
50 # prevent shadowing imports
51 rm -r google
52 # fixture 'authorized_transport' not found
53 rm tests/system/requests/test_upload.py
54 # requires network
55 rm tests/system/requests/test_download.py
56 '';
57
58 pythonImportsCheck = [
59 "google._async_resumable_media"
60 "google.resumable_media"
61 ];
62
63 meta = with lib; {
64 description = "Utilities for Google Media Downloads and Resumable Uploads";
65 homepage = "https://github.com/GoogleCloudPlatform/google-resumable-media-python";
66 changelog = "https://github.com/googleapis/google-resumable-media-python/blob/v${version}/CHANGELOG.md";
67 license = licenses.asl20;
68 maintainers = [ ];
69 };
70}