2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
glibcLocales,
|
|
|
|
importlib-metadata,
|
|
|
|
logfury,
|
|
|
|
packaging,
|
|
|
|
pdm-backend,
|
|
|
|
pyfakefs,
|
|
|
|
pytest-lazy-fixture,
|
|
|
|
pytest-mock,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
pythonRelaxDepsHook,
|
|
|
|
requests,
|
|
|
|
tqdm,
|
|
|
|
typing-extensions,
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "b2sdk";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.0.0";
|
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
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Backblaze";
|
|
|
|
repo = "b2-sdk-python";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-0/UC4O19oO8SpboiPIhvkWBA8XHpc279fl377MooK54=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [ pdm-backend ];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeBuildInputs = [ pythonRelaxDepsHook ];
|
|
|
|
|
|
|
|
pythonRemoveDeps = [ "setuptools" ];
|
|
|
|
|
|
|
|
dependencies =
|
|
|
|
[
|
|
|
|
packaging
|
|
|
|
logfury
|
|
|
|
requests
|
|
|
|
]
|
|
|
|
++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]
|
|
|
|
++ lib.optionals (pythonOlder "3.12") [ typing-extensions ];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2024-04-21 15:54:59 +00:00
|
|
|
pyfakefs
|
2021-05-20 23:08:51 +00:00
|
|
|
pytest-lazy-fixture
|
|
|
|
pytest-mock
|
2024-04-21 15:54:59 +00:00
|
|
|
pytestCheckHook
|
|
|
|
tqdm
|
|
|
|
] ++ lib.optionals stdenv.isLinux [ glibcLocales ];
|
2021-04-26 19:14:03 +00:00
|
|
|
|
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
|
|
|
|
2024-04-21 15:54:59 +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
|
|
|
};
|
|
|
|
}
|