New comment by kartikynwa on void-packages repository https://github.com/void-linux/void-packages/pull/40928#issuecomment-1340395214 Comment: @ahesford Needs two more changes: - backblaze-b2 should have python3-tqdm in depends - backblaze-b2 needs this patch: https://github.com/Backblaze/B2_Command_Line_Tool/pull/836/files (only the change to console_tool.py is required)
This is the patch I used ```diff 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'] ```
After these the package works fine. I have tried login, ls, download and upload. All working great. Thanks for your work. BTW do you know why I faced this problem? > complains that it needs to .git folder to get the version number In your PR I see that you changed the hostmakedepends to setuptools_scm which I already tried. Apart from that is changing the source from github to pypi enough? I thought of trying that too but the pypi tarball also did not have a .git folder in it.