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