mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-07 23:53:51 +02:00
parent
44c9d33044
commit
55988ebb2a
4 changed files with 108 additions and 31 deletions
87
srcpkgs/backblaze-b2/patches/python-3.11.patch
Normal file
87
srcpkgs/backblaze-b2/patches/python-3.11.patch
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
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']
|
13
srcpkgs/backblaze-b2/patches/setuptools_scm_version.patch
Normal file
13
srcpkgs/backblaze-b2/patches/setuptools_scm_version.patch
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
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
|
|
@ -1,12 +0,0 @@
|
||||||
--- a/b2/console_tool.py
|
|
||||||
+++ b/b2/console_tool.py
|
|
||||||
@@ -28,7 +28,8 @@ from b2sdk.account_info.sqlite_account_i
|
|
||||||
B2_ACCOUNT_INFO_ENV_VAR, B2_ACCOUNT_INFO_DEFAULT_FILE
|
|
||||||
)
|
|
||||||
from b2sdk.progress import make_progress_listener
|
|
||||||
-from b2sdk.raw_api import MetadataDirectiveMode, SRC_LAST_MODIFIED_MILLIS
|
|
||||||
+from b2sdk.raw_api import MetadataDirectiveMode
|
|
||||||
+from b2sdk.http_constants import SRC_LAST_MODIFIED_MILLIS
|
|
||||||
from b2sdk.version import VERSION as b2sdk_version
|
|
||||||
from b2sdk.v1 import (
|
|
||||||
parse_sync_folder,
|
|
|
@ -1,32 +1,21 @@
|
||||||
# Template file for 'backblaze-b2'
|
# Template file for 'backblaze-b2'
|
||||||
pkgname=backblaze-b2
|
pkgname=backblaze-b2
|
||||||
version=2.1.0
|
version=3.6.0
|
||||||
revision=3
|
revision=1
|
||||||
build_style=python3-module
|
build_style=python3-module
|
||||||
hostmakedepends="python3-setuptools"
|
hostmakedepends="python3-setuptools_scm"
|
||||||
depends="python3-logfury python3-Arrow python3-requests python3-six
|
depends="python3-Arrow python3-b2sdk python3-docutils
|
||||||
python3-tqdm python-b2sdk python3-phx-class-registry"
|
python3-phx-class-registry python3-rst2ansi python3-tabulate"
|
||||||
checkdepends="python3-pytest $depends python3-pyflakes python3-mock
|
|
||||||
python3-dateutil"
|
|
||||||
short_desc="Command Line Interface for Backblaze's B2 storage service"
|
short_desc="Command Line Interface for Backblaze's B2 storage service"
|
||||||
maintainer="Andrea Brancaleoni <abc@pompel.me>"
|
maintainer="Andrea Brancaleoni <abc@pompel.me>"
|
||||||
license="MIT"
|
license="MIT"
|
||||||
homepage="https://github.com/Backblaze/B2_Command_Line_Tool"
|
homepage="https://github.com/Backblaze/B2_Command_Line_Tool"
|
||||||
distfiles="${PYPI_SITE}/b/b2/b2-${version}.tar.gz"
|
distfiles="${PYPI_SITE}/b/b2/b2-${version}.tar.gz"
|
||||||
checksum=fdae4aa7c88c7981ae68784600cc820ab8fd591a2ca6dc7af5e6b4d1549c2080
|
checksum=a879e751348b635ca772a2231be20c2e835abaf830534e2ab2f1fb75967c0252
|
||||||
replaces="python-b2>=0"
|
replaces="python-b2>=0"
|
||||||
provides="python-b2-${version}_${revision}"
|
make_check=no # tests require unpackaged dependencies
|
||||||
|
|
||||||
post_patch() {
|
|
||||||
# this files is necessary for do_check
|
|
||||||
# the files is copied directly from its GitHub's repository
|
|
||||||
cp "$FILESDIR/test_b2_command_line.py" "$wrksrc"
|
|
||||||
}
|
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
# Remove test directory polluting site-packages
|
|
||||||
rm -rf ${DESTDIR}/usr/lib/python*/site-packages/test
|
|
||||||
|
|
||||||
# Avoid conflict with Boost's b2 tool
|
# Avoid conflict with Boost's b2 tool
|
||||||
mv ${DESTDIR}/usr/bin/b2 ${DESTDIR}/usr/bin/backblaze-b2
|
mv ${DESTDIR}/usr/bin/b2 ${DESTDIR}/usr/bin/backblaze-b2
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue