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 ]
50 ++ optional-dependencies.requests;
51
52 preCheck = ''
53 # prevent shadowing imports
54 rm -r google
55 # fixture 'authorized_transport' not found
56 rm tests/system/requests/test_upload.py
57 # requires network
58 rm tests/system/requests/test_download.py
59 '';
60
61 pythonImportsCheck = [
62 "google._async_resumable_media"
63 "google.resumable_media"
64 ];
65
66 meta = with lib; {
67 description = "Utilities for Google Media Downloads and Resumable Uploads";
68 homepage = "https://github.com/GoogleCloudPlatform/google-resumable-media-python";
69 changelog = "https://github.com/googleapis/google-resumable-media-python/blob/v${version}/CHANGELOG.md";
70 license = licenses.asl20;
71 maintainers = [ ];
72 };
73}