nixpkgs/pkgs/development/python-modules/b2sdk/default.nix

67 lines
1.2 KiB
Nix
Raw Permalink Normal View History

{ lib
, arrow
, buildPythonPackage
, fetchPypi
, importlib-metadata
, isPy27
, logfury
, pytestCheckHook
, pytest-lazy-fixture
, pytest-mock
, pythonOlder
, requests
, setuptools-scm
, tqdm
}:
2020-08-17 19:56:07 +00:00
buildPythonPackage rec {
pname = "b2sdk";
2021-06-18 21:47:09 +00:00
version = "1.9.0";
2020-08-17 19:56:07 +00:00
disabled = isPy27;
src = fetchPypi {
inherit pname version;
2021-06-18 21:47:09 +00:00
sha256 = "ff9c27c89f53583fd83c711d0a642d9b3bdbb8682c2e8e2315674b517cb441ec";
2020-08-17 19:56:07 +00:00
};
nativeBuildInputs = [
setuptools-scm
];
propagatedBuildInputs = [
arrow
logfury
requests
tqdm
] ++ lib.optionals (pythonOlder "3.8") [
importlib-metadata
];
checkInputs = [
pytestCheckHook
pytest-lazy-fixture
pytest-mock
];
postPatch = ''
substituteInPlace setup.py \
--replace 'setuptools_scm<6.0' 'setuptools_scm'
substituteInPlace requirements.txt \
--replace 'arrow>=0.8.0,<1.0.0' 'arrow'
'';
disabledTests = [
# Test requires an API key
"test_raw_api"
"test_files_headers"
];
2020-08-17 19:56:07 +00:00
pythonImportsCheck = [ "b2sdk" ];
2020-08-17 19:56:07 +00:00
meta = with lib; {
description = "Client library and utilities for access to B2 Cloud Storage (backblaze)";
2020-08-17 19:56:07 +00:00
homepage = "https://github.com/Backblaze/b2-sdk-python";
license = licenses.mit;
};
}