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.

73 lines
1.7 KiB
Nix
Raw Normal View History

{ lib, python3Packages, fetchPypi }:
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-02-09 05:44:48 +00:00
version = "3.7.0";
2016-02-03 23:45:01 +00:00
src = fetchPypi {
inherit version;
pname = "b2";
2023-02-09 05:44:48 +00:00
sha256 = "sha256-sW6gaZWUh3WX+0+qHRlQ4gZzKU4bL8ePPNKWo9rdF84=";
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 = with python3Packages; [
setuptools-scm
];
2020-09-25 20:29:52 +00:00
propagatedBuildInputs = with python3Packages; [
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
];
nativeCheckInputs = with python3Packages; [
2022-08-14 16:47:13 +00:00
backoff
2022-09-20 06:19:04 +00:00
more-itertools
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"
2022-08-14 16:47:13 +00:00
];
disabledTestPaths = [
# requires network
"test/integration/test_b2_command_line.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"
2020-09-25 20:29:52 +00:00
sed 's/b2/backblaze-b2/' -i contrib/bash_completion/b2
2016-03-06 17:14:25 +00:00
mkdir -p "$out/share/bash-completion/completions"
cp contrib/bash_completion/b2 "$out/share/bash-completion/completions/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
};
}