1{ lib
2, arrow
3, buildPythonPackage
4, fetchPypi
5, importlib-metadata
6, isPy27
7, logfury
8, pytestCheckHook
9, pytest-lazy-fixture
10, pytest-mock
11, pythonOlder
12, requests
13, setuptools-scm
14, tqdm
15}:
16
17buildPythonPackage rec {
18 pname = "b2sdk";
19 version = "1.13.0";
20 disabled = isPy27;
21
22 src = fetchPypi {
23 inherit pname version;
24 sha256 = "sha256-Q9B85c+WhazDeXsMR2S0aId32xLY8BAuYRj4QD21x1k=";
25 };
26
27 nativeBuildInputs = [
28 setuptools-scm
29 ];
30
31 propagatedBuildInputs = [
32 arrow
33 logfury
34 requests
35 tqdm
36 ] ++ lib.optionals (pythonOlder "3.8") [
37 importlib-metadata
38 ];
39
40 checkInputs = [
41 pytestCheckHook
42 pytest-lazy-fixture
43 pytest-mock
44 ];
45
46 postPatch = ''
47 substituteInPlace setup.py \
48 --replace 'setuptools_scm<6.0' 'setuptools_scm'
49 substituteInPlace requirements.txt \
50 --replace 'arrow>=0.8.0,<1.0.0' 'arrow'
51 '';
52
53 disabledTests = [
54 # Test requires an API key
55 "test_raw_api"
56 "test_files_headers"
57 "test_large_file"
58 ];
59
60 pythonImportsCheck = [
61 "b2sdk"
62 ];
63
64 meta = with lib; {
65 description = "Client library and utilities for access to B2 Cloud Storage (backblaze)";
66 homepage = "https://github.com/Backblaze/b2-sdk-python";
67 license = licenses.mit;
68 };
69}