2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
2023-10-09 19:29:22 +00:00
|
|
|
, stdenv
|
2021-05-20 23:08:51 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2023-10-09 19:29:22 +00:00
|
|
|
, glibcLocales
|
2021-05-20 23:08:51 +00:00
|
|
|
, importlib-metadata
|
|
|
|
, logfury
|
2022-08-12 12:06:08 +00:00
|
|
|
, pyfakefs
|
2021-05-20 23:08:51 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-lazy-fixture
|
|
|
|
, pytest-mock
|
|
|
|
, pythonOlder
|
|
|
|
, requests
|
2024-01-13 08:15:51 +00:00
|
|
|
, setuptools
|
2021-05-20 23:08:51 +00:00
|
|
|
, setuptools-scm
|
|
|
|
, tqdm
|
2023-10-09 19:29:22 +00:00
|
|
|
, typing-extensions
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "b2sdk";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "1.29.1";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-Talw1P0JnPdU+dDgC8J2TJSOV/LshgQyBbPYEqzKpfA=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
nativeBuildInputs = [
|
2024-01-13 08:15:51 +00:00
|
|
|
setuptools
|
2021-05-20 23:08:51 +00:00
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
logfury
|
|
|
|
requests
|
2024-01-13 08:15:51 +00:00
|
|
|
tqdm
|
2021-05-20 23:08:51 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
2023-10-09 19:29:22 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.12") [
|
|
|
|
typing-extensions
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-05-20 23:08:51 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-lazy-fixture
|
|
|
|
pytest-mock
|
2022-08-12 12:06:08 +00:00
|
|
|
pyfakefs
|
2023-10-09 19:29:22 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
glibcLocales
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace 'setuptools_scm<6.0' 'setuptools_scm'
|
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# requires aws s3 auth
|
|
|
|
"test/integration/test_download.py"
|
2023-02-09 11:40:11 +00:00
|
|
|
"test/integration/test_upload.py"
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Test requires an API key
|
|
|
|
"test_raw_api"
|
|
|
|
"test_files_headers"
|
2021-08-10 14:31:46 +00:00
|
|
|
"test_large_file"
|
2024-01-02 11:29:13 +00:00
|
|
|
"test_file_info_b2_attributes"
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"b2sdk"
|
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-05-20 23:08:51 +00:00
|
|
|
description = "Client library and utilities for access to B2 Cloud Storage (backblaze)";
|
2020-09-25 04:45:31 +00:00
|
|
|
homepage = "https://github.com/Backblaze/b2-sdk-python";
|
2023-10-09 19:29:22 +00:00
|
|
|
changelog = "https://github.com/Backblaze/b2-sdk-python/blob/v${version}/CHANGELOG.md";
|
2020-09-25 04:45:31 +00:00
|
|
|
license = licenses.mit;
|
2022-03-05 16:20:37 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
}
|