nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 logfury,
6 annotated-types,
7 hatchling,
8 hatch-vcs,
9 pytest-lazy-fixtures,
10 pytest-mock,
11 pytest-timeout,
12 pytestCheckHook,
13 pythonAtLeast,
14 pythonOlder,
15 requests,
16 responses,
17 tenacity,
18 tqdm,
19 typing-extensions,
20}:
21
22buildPythonPackage rec {
23 pname = "b2sdk";
24 version = "2.10.3";
25 pyproject = true;
26
27 src = fetchFromGitHub {
28 owner = "Backblaze";
29 repo = "b2-sdk-python";
30 tag = "v${version}";
31 hash = "sha256-Gu4MRfjNWuwEFn13U49dEndWA/HNPwrQdX9VEz1ny+M=";
32 };
33
34 build-system = [
35 hatchling
36 hatch-vcs
37 ];
38
39 dependencies = [
40 annotated-types
41 logfury
42 requests
43 ]
44 ++ lib.optionals (pythonOlder "3.12") [ typing-extensions ];
45
46 nativeCheckInputs = [
47 pytest-lazy-fixtures
48 pytest-mock
49 pytest-timeout
50 pytestCheckHook
51 responses
52 tenacity
53 tqdm
54 ];
55
56 enabledTestPaths = [
57 "test/unit"
58 ];
59
60 disabledTests = lib.optionals (pythonAtLeast "3.14") [
61 # - 'could not be accessed (no permissions to read?)',
62 # + 'could not be accessed (broken symlink?)',
63 "test_dir_without_exec_permission"
64 ];
65
66 pythonImportsCheck = [ "b2sdk" ];
67
68 meta = {
69 description = "Client library and utilities for access to B2 Cloud Storage (backblaze)";
70 homepage = "https://github.com/Backblaze/b2-sdk-python";
71 changelog = "https://github.com/Backblaze/b2-sdk-python/blob/${src.tag}/CHANGELOG.md";
72 license = lib.licenses.mit;
73 maintainers = with lib.maintainers; [ pmw ];
74 };
75}