backblaze-b2: update to 3.8.0.

This commit is contained in:
Andrea Brancaleoni 2023-04-02 06:04:46 +09:00
parent b1c5faf765
commit d2741d4d0a
3 changed files with 3 additions and 103 deletions

View file

@ -1,87 +0,0 @@
From 1eac94954530a1dca2c498de7bf9f92ee12479b1 Mon Sep 17 00:00:00 2001
From: kkalinowski-reef <114084217+kkalinowski-reef@users.noreply.github.com>
Date: Tue, 15 Nov 2022 01:11:34 +0100
Subject: [PATCH] Fetching command class from parsed arguments instead of
registry (#836)
* Fetching command class from parsed arguments instead of registry
* Enabled 3.11 tests in both nox and github workflows
---
.github/workflows/ci.yml | 2 +-
CHANGELOG.md | 1 +
b2/console_tool.py | 11 ++++++-----
noxfile.py | 8 +++++++-
4 files changed, 15 insertions(+), 7 deletions(-)
[Void note (ahesford): CHANGLEOG.md diff conflicts and was dropped.]
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5d64cdb5..84932867 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -80,7 +80,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
- python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7"]
+ python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7", "3.11"]
exclude:
- os: "macos-latest"
python-version: "pypy-3.7"
diff --git a/b2/console_tool.py b/b2/console_tool.py
index 1115cc79..760be547 100644
--- a/b2/console_tool.py
+++ b/b2/console_tool.py
@@ -500,11 +500,8 @@ def name_and_alias(cls):
@classmethod
def register_subcommand(cls, command_class):
assert cls.subcommands_registry is not None, 'Initialize the registry class'
- name, alias = command_class.name_and_alias()
+ name, _ = command_class.name_and_alias()
decorator = cls.subcommands_registry.register(key=name)(command_class)
- # Register alias if present
- if alias is not None:
- cls.subcommands_registry[alias] = command_class
return decorator
@classmethod
@@ -531,6 +528,8 @@ def get_parser(cls, subparsers=None, parents=None, for_docs=False):
aliases=[alias] if alias is not None and not for_docs else (),
for_docs=for_docs,
)
+ # Register class that will handle this particular command, for both name and alias.
+ parser.set_defaults(command_class=cls)
cls._setup_parser(parser)
@@ -655,7 +654,9 @@ def name_and_alias(cls):
return NAME, None
def run(self, args):
- return self.subcommands_registry.get_class(args.command)
+ # Commands could be named via name or alias, so we fetch
+ # the command from args assigned during parser preparation.
+ return args.command_class
@B2.register_subcommand
diff --git a/noxfile.py b/noxfile.py
index aaa2bac3..25cf8de1 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -24,7 +24,13 @@
NO_STATICX = os.environ.get('NO_STATICX') is not None
NOX_PYTHONS = os.environ.get('NOX_PYTHONS')
-PYTHON_VERSIONS = ['3.7', '3.8', '3.9', '3.10'] if NOX_PYTHONS is None else NOX_PYTHONS.split(',')
+PYTHON_VERSIONS = [
+ '3.7',
+ '3.8',
+ '3.9',
+ '3.10',
+ '3.11',
+] if NOX_PYTHONS is None else NOX_PYTHONS.split(',')
PYTHON_DEFAULT_VERSION = PYTHON_VERSIONS[-1]
PY_PATHS = ['b2', 'test', 'noxfile.py', 'setup.py']

View file

@ -1,13 +0,0 @@
Setup works just fine with the version of setuptools_scm in Void.
--- a/setup.py
+++ b/setup.py
@@ -111,7 +111,7 @@
# for example:
# $ pip install -e .[dev,test]
extras_require={'doc': read_requirements('doc')},
- setup_requires=['setuptools_scm<6.0'],
+ setup_requires=['setuptools_scm'],
use_scm_version=True,
# If there are data files included in your packages that need to be

View file

@ -1,9 +1,9 @@
# Template file for 'backblaze-b2'
pkgname=backblaze-b2
version=3.6.0
version=3.8.0
revision=1
build_style=python3-module
hostmakedepends="python3-setuptools_scm"
hostmakedepends="python3-setuptools_scm python3-pip"
depends="python3-Arrow python3-b2sdk python3-docutils
python3-phx-class-registry python3-rst2ansi python3-tabulate"
short_desc="Command Line Interface for Backblaze's B2 storage service"
@ -11,7 +11,7 @@ maintainer="Andrea Brancaleoni <abc@pompel.me>"
license="MIT"
homepage="https://github.com/Backblaze/B2_Command_Line_Tool"
distfiles="${PYPI_SITE}/b/b2/b2-${version}.tar.gz"
checksum=a879e751348b635ca772a2231be20c2e835abaf830534e2ab2f1fb75967c0252
checksum=c590f89438307b80d136f15889b34b03b09eaa65be0e1b1846492286ed57de45
replaces="python-b2>=0"
make_check=no # tests require unpackaged dependencies