nixpkgs/pkgs/development/tools/backblaze-b2/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

84 lines
2.1 KiB
Nix
Raw Normal View History

{ 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";
version = "3.9.0";
format = "setuptools";
2016-02-03 23:45:01 +00:00
src = fetchPypi {
inherit version;
pname = "b2";
hash = "sha256-Z9LQapWl0zblcAyMOfKhn5/O1H6+tmgiPQfAB241jqU=";
2016-02-03 23:45:01 +00:00
};
postPatch = ''
2023-02-09 05:44:48 +00:00
substituteInPlace requirements.txt \
--replace 'phx-class-registry==4.0.5' 'phx-class-registry'
substituteInPlace requirements.txt \
2022-08-14 16:47:13 +00:00
--replace 'tabulate==0.8.10' 'tabulate'
substituteInPlace setup.py \
--replace 'setuptools_scm<6.0' 'setuptools_scm'
'';
nativeBuildInputs = [
installShellFiles
python3Packages.setuptools-scm
];
2020-09-25 20:29:52 +00:00
propagatedBuildInputs = with python3Packages; [
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
docutils
rst2ansi
2022-08-14 16:47:13 +00:00
tabulate
tqdm
];
nativeCheckInputs = with python3Packages; [
2022-08-14 16:47:13 +00:00
backoff
2022-09-20 06:19:04 +00:00
more-itertools
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 = [
# require network
2020-11-24 21:36:26 +00:00
"test_files_headers"
"test_integration"
# 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"
# it's hard to make it work on nix
"test/integration/test_autocomplete.py"
2020-11-24 21:36:26 +00:00
];
2016-03-06 17:14:25 +00:00
postInstall = ''
mv "$out/bin/b2" "$out/bin/backblaze-b2"
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; {
description = "Command-line tool for accessing the Backblaze B2 storage service";
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;
maintainers = with maintainers; [ hrdinka kevincox tomhoule ];
2016-02-03 23:45:01 +00:00
};
}