2023-09-04 15:02:53 +00:00
|
|
|
{ lib, python3Packages, fetchPypi, installShellFiles }:
|
2016-02-03 23:45:01 +00:00
|
|
|
|
2020-09-25 20:29:52 +00:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2017-12-02 13:42:13 +00:00
|
|
|
pname = "backblaze-b2";
|
2023-09-04 15:02:53 +00:00
|
|
|
version = "3.9.0";
|
|
|
|
format = "setuptools";
|
2016-02-03 23:45:01 +00:00
|
|
|
|
2023-05-25 12:52:27 +00:00
|
|
|
src = fetchPypi {
|
2021-05-08 11:53:30 +00:00
|
|
|
inherit version;
|
|
|
|
pname = "b2";
|
2023-09-04 15:02:53 +00:00
|
|
|
hash = "sha256-Z9LQapWl0zblcAyMOfKhn5/O1H6+tmgiPQfAB241jqU=";
|
2016-02-03 23:45:01 +00:00
|
|
|
};
|
|
|
|
|
2021-05-08 11:53:30 +00:00
|
|
|
postPatch = ''
|
2023-02-09 05:44:48 +00:00
|
|
|
substituteInPlace requirements.txt \
|
|
|
|
--replace 'phx-class-registry==4.0.5' 'phx-class-registry'
|
2021-06-21 10:47:02 +00:00
|
|
|
substituteInPlace requirements.txt \
|
2022-08-14 16:47:13 +00:00
|
|
|
--replace 'tabulate==0.8.10' 'tabulate'
|
2021-05-08 11:53:30 +00:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace 'setuptools_scm<6.0' 'setuptools_scm'
|
|
|
|
'';
|
|
|
|
|
2023-09-04 15:02:53 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
python3Packages.setuptools-scm
|
2022-07-20 12:31:25 +00:00
|
|
|
];
|
|
|
|
|
2020-09-25 20:29:52 +00:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
2023-09-04 15:02:53 +00:00
|
|
|
argcomplete
|
|
|
|
arrow
|
2020-09-25 20:29:52 +00:00
|
|
|
b2sdk
|
2020-11-24 21:36:26 +00:00
|
|
|
phx-class-registry
|
2020-09-25 20:29:52 +00:00
|
|
|
setuptools
|
2021-05-08 11:53:30 +00:00
|
|
|
docutils
|
|
|
|
rst2ansi
|
2022-08-14 16:47:13 +00:00
|
|
|
tabulate
|
2023-09-04 15:02:53 +00:00
|
|
|
tqdm
|
2021-05-08 11:53:30 +00:00
|
|
|
];
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = with python3Packages; [
|
2022-08-14 16:47:13 +00:00
|
|
|
backoff
|
2022-09-20 06:19:04 +00:00
|
|
|
more-itertools
|
2023-09-04 15:02:53 +00:00
|
|
|
pexpect
|
2021-10-24 19:20:04 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2016-02-03 23:45:01 +00:00
|
|
|
|
2022-08-14 16:47:13 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
2020-11-24 21:36:26 +00:00
|
|
|
disabledTests = [
|
2022-07-20 12:31:25 +00:00
|
|
|
# require network
|
2020-11-24 21:36:26 +00:00
|
|
|
"test_files_headers"
|
|
|
|
"test_integration"
|
2023-09-04 15:02:53 +00:00
|
|
|
|
|
|
|
# fixed by https://github.com/Backblaze/B2_Command_Line_Tool/pull/915
|
|
|
|
"TestRmConsoleTool"
|
2022-08-14 16:47:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# requires network
|
|
|
|
"test/integration/test_b2_command_line.py"
|
2023-09-04 15:02:53 +00:00
|
|
|
|
|
|
|
# it's hard to make it work on nix
|
|
|
|
"test/integration/test_autocomplete.py"
|
2020-11-24 21:36:26 +00:00
|
|
|
];
|
2018-09-02 06:45:09 +00:00
|
|
|
|
2016-03-06 17:14:25 +00:00
|
|
|
postInstall = ''
|
|
|
|
mv "$out/bin/b2" "$out/bin/backblaze-b2"
|
|
|
|
|
2023-09-04 15:02:53 +00:00
|
|
|
installShellCompletion --cmd backblaze-b2 \
|
|
|
|
--bash <(${python3Packages.argcomplete}/bin/register-python-argcomplete backblaze-b2) \
|
|
|
|
--zsh <(${python3Packages.argcomplete}/bin/register-python-argcomplete backblaze-b2)
|
2016-02-03 23:45:01 +00:00
|
|
|
'';
|
|
|
|
|
2017-12-02 13:42:13 +00:00
|
|
|
meta = with lib; {
|
2016-02-27 17:24:00 +00:00
|
|
|
description = "Command-line tool for accessing the Backblaze B2 storage service";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/Backblaze/B2_Command_Line_Tool";
|
2023-09-04 15:02:27 +00:00
|
|
|
changelog = "https://github.com/Backblaze/B2_Command_Line_Tool/blob/v${version}/CHANGELOG.md";
|
2016-03-06 17:14:25 +00:00
|
|
|
license = licenses.mit;
|
2022-08-14 16:48:25 +00:00
|
|
|
maintainers = with maintainers; [ hrdinka kevincox tomhoule ];
|
2016-02-03 23:45:01 +00:00
|
|
|
};
|
|
|
|
}
|