depot/third_party/nixpkgs/pkgs/development/python-modules/b2sdk/default.nix
Default email a425ba4985 Project import generated by Copybara.
GitOrigin-RevId: 5b091d4fbe3b7b7493c3b46fe0842e4b30ea24b3
2021-12-30 14:39:12 +01:00

69 lines
1.2 KiB
Nix

{ lib
, arrow
, buildPythonPackage
, fetchPypi
, importlib-metadata
, isPy27
, logfury
, pytestCheckHook
, pytest-lazy-fixture
, pytest-mock
, pythonOlder
, requests
, setuptools-scm
, tqdm
}:
buildPythonPackage rec {
pname = "b2sdk";
version = "1.14.0";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
sha256 = "900da60f9e569e02405b85db35541a79e1cac776ace5d054498b107982ea443c";
};
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"
"test_large_file"
];
pythonImportsCheck = [
"b2sdk"
];
meta = with lib; {
description = "Client library and utilities for access to B2 Cloud Storage (backblaze)";
homepage = "https://github.com/Backblaze/b2-sdk-python";
license = licenses.mit;
};
}