Merge pull request #253275 from natsukium/b2sdk/update

python310Packages.b2sdk: 1.19.0 -> 1.24.0; backblaze-b2: 3.7.0 -> 3.9.0
This commit is contained in:
Kevin Cox 2023-09-05 10:30:06 -04:00 committed by GitHub
commit 42097be59c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 15 deletions

View File

@ -1,7 +1,8 @@
{ lib
, arrow
, stdenv
, buildPythonPackage
, fetchPypi
, glibcLocales
, importlib-metadata
, logfury
, pyfakefs
@ -12,18 +13,19 @@
, requests
, setuptools-scm
, tqdm
, typing-extensions
}:
buildPythonPackage rec {
pname = "b2sdk";
version = "1.19.0";
version = "1.24.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-aJpSt+dXjw4S33dBiMkaR6wxzwLru+jseuPKFj2R36Y=";
hash = "sha256-6zSjCt+J6530f1GMc/omP1zXKQKU1SDLLvslMWoqMcU=";
};
nativeBuildInputs = [
@ -31,12 +33,13 @@ buildPythonPackage rec {
];
propagatedBuildInputs = [
arrow
logfury
requests
tqdm
] ++ lib.optionals (pythonOlder "3.8") [
importlib-metadata
] ++ lib.optionals (pythonOlder "3.12") [
typing-extensions
];
nativeCheckInputs = [
@ -44,13 +47,13 @@ buildPythonPackage rec {
pytest-lazy-fixture
pytest-mock
pyfakefs
] ++ lib.optionals stdenv.isLinux [
glibcLocales
];
postPatch = ''
substituteInPlace setup.py \
--replace 'setuptools_scm<6.0' 'setuptools_scm'
substituteInPlace requirements.txt \
--replace 'arrow>=0.8.0,<1.0.0' 'arrow'
'';
disabledTestPaths = [
@ -73,6 +76,7 @@ buildPythonPackage rec {
meta = with lib; {
description = "Client library and utilities for access to B2 Cloud Storage (backblaze)";
homepage = "https://github.com/Backblaze/b2-sdk-python";
changelog = "https://github.com/Backblaze/b2-sdk-python/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ ];
};

View File

@ -1,13 +1,14 @@
{ lib, python3Packages, fetchPypi }:
{ lib, python3Packages, fetchPypi, installShellFiles }:
python3Packages.buildPythonApplication rec {
pname = "backblaze-b2";
version = "3.7.0";
version = "3.9.0";
format = "setuptools";
src = fetchPypi {
inherit version;
pname = "b2";
sha256 = "sha256-sW6gaZWUh3WX+0+qHRlQ4gZzKU4bL8ePPNKWo9rdF84=";
hash = "sha256-Z9LQapWl0zblcAyMOfKhn5/O1H6+tmgiPQfAB241jqU=";
};
postPatch = ''
@ -19,22 +20,27 @@ python3Packages.buildPythonApplication rec {
--replace 'setuptools_scm<6.0' 'setuptools_scm'
'';
nativeBuildInputs = with python3Packages; [
setuptools-scm
nativeBuildInputs = [
installShellFiles
python3Packages.setuptools-scm
];
propagatedBuildInputs = with python3Packages; [
argcomplete
arrow
b2sdk
phx-class-registry
setuptools
docutils
rst2ansi
tabulate
tqdm
];
nativeCheckInputs = with python3Packages; [
backoff
more-itertools
pexpect
pytestCheckHook
];
@ -46,25 +52,31 @@ python3Packages.buildPythonApplication rec {
# require network
"test_files_headers"
"test_integration"
# fixed by https://github.com/Backblaze/B2_Command_Line_Tool/pull/915
"TestRmConsoleTool"
];
disabledTestPaths = [
# requires network
"test/integration/test_b2_command_line.py"
# it's hard to make it work on nix
"test/integration/test_autocomplete.py"
];
postInstall = ''
mv "$out/bin/b2" "$out/bin/backblaze-b2"
sed 's/b2/backblaze-b2/' -i contrib/bash_completion/b2
mkdir -p "$out/share/bash-completion/completions"
cp contrib/bash_completion/b2 "$out/share/bash-completion/completions/backblaze-b2"
installShellCompletion --cmd backblaze-b2 \
--bash <(${python3Packages.argcomplete}/bin/register-python-argcomplete backblaze-b2) \
--zsh <(${python3Packages.argcomplete}/bin/register-python-argcomplete backblaze-b2)
'';
meta = with lib; {
description = "Command-line tool for accessing the Backblaze B2 storage service";
homepage = "https://github.com/Backblaze/B2_Command_Line_Tool";
changelog = "https://github.com/Backblaze/B2_Command_Line_Tool/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ hrdinka kevincox tomhoule ];
};