mirror of
https://github.com/borgbackup/borg.git
synced 2024-10-06 00:37:15 +03:00
Merge pull request #7314 from ThomasWaldmann/newer-black
use latest "black"
This commit is contained in:
commit
4515884af5
2
.github/workflows/black.yaml
vendored
2
.github/workflows/black.yaml
vendored
@ -10,4 +10,4 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: psf/black@22.6.0
|
||||
- uses: psf/black@23.1.0
|
||||
|
@ -1 +1 @@
|
||||
black==22.6.0
|
||||
black==23.1.0
|
||||
|
@ -1054,7 +1054,7 @@ def chunk_decref(id, stats, part=False):
|
||||
pi = ProgressIndicatorPercent(
|
||||
total=len(items_ids), msg="Decrementing references %3.0f%%", msgid="archive.delete"
|
||||
)
|
||||
for (i, (items_id, data)) in enumerate(zip(items_ids, self.repository.get_many(items_ids))):
|
||||
for i, (items_id, data) in enumerate(zip(items_ids, self.repository.get_many(items_ids))):
|
||||
if progress:
|
||||
pi.show(i)
|
||||
_, data = self.repo_objs.parse(items_id, data)
|
||||
|
@ -217,7 +217,6 @@ def chunkit(chunker_name, *args, **kwargs):
|
||||
return 0
|
||||
|
||||
def build_parser_benchmarks(self, subparsers, common_parser, mid_common_parser):
|
||||
|
||||
from ._common import process_epilog
|
||||
|
||||
benchmark_epilog = process_epilog("These commands do various benchmarks.")
|
||||
|
@ -66,7 +66,6 @@ def do_check(self, args, repository):
|
||||
return EXIT_SUCCESS
|
||||
|
||||
def build_parser_check(self, subparsers, common_parser, mid_common_parser):
|
||||
|
||||
from ._common import process_epilog
|
||||
from ._common import define_archive_filters_group
|
||||
|
||||
|
@ -22,7 +22,6 @@ def do_compact(self, args, repository):
|
||||
return EXIT_SUCCESS
|
||||
|
||||
def build_parser_compact(self, subparsers, common_parser, mid_common_parser):
|
||||
|
||||
from ._common import process_epilog
|
||||
|
||||
compact_epilog = process_epilog(
|
||||
|
@ -150,7 +150,6 @@ def list_config(config):
|
||||
cache.close()
|
||||
|
||||
def build_parser_config(self, subparsers, common_parser, mid_common_parser):
|
||||
|
||||
from ._common import process_epilog
|
||||
|
||||
config_epilog = process_epilog(
|
||||
|
@ -330,7 +330,6 @@ def do_debug_convert_profile(self, args):
|
||||
return EXIT_SUCCESS
|
||||
|
||||
def build_parser_debug(self, subparsers, common_parser, mid_common_parser):
|
||||
|
||||
debug_epilog = process_epilog(
|
||||
"""
|
||||
These commands are not intended for normal use and potentially very
|
||||
|
@ -58,7 +58,6 @@ def print_text_output(diff, path):
|
||||
return self.exit_code
|
||||
|
||||
def build_parser_diff(self, subparsers, common_parser, mid_common_parser):
|
||||
|
||||
from ._common import process_epilog
|
||||
from ._common import define_exclusion_group
|
||||
|
||||
|
@ -109,7 +109,6 @@ def do_extract(self, args, repository, manifest, archive):
|
||||
return self.exit_code
|
||||
|
||||
def build_parser_extract(self, subparsers, common_parser, mid_common_parser):
|
||||
|
||||
from ._common import process_epilog
|
||||
from ._common import define_exclusion_group
|
||||
|
||||
|
@ -132,7 +132,6 @@ def do_key_import(self, args, repository):
|
||||
return EXIT_SUCCESS
|
||||
|
||||
def build_parser_keys(self, subparsers, common_parser, mid_common_parser):
|
||||
|
||||
from ._common import process_epilog
|
||||
|
||||
subparser = subparsers.add_parser(
|
||||
|
@ -51,7 +51,6 @@ def do_break_lock(self, args, repository):
|
||||
return self.exit_code
|
||||
|
||||
def build_parser_locks(self, subparsers, common_parser, mid_common_parser):
|
||||
|
||||
from ._common import process_epilog
|
||||
|
||||
break_lock_epilog = process_epilog(
|
||||
|
@ -170,7 +170,6 @@ def checkpoint_func():
|
||||
return self.exit_code
|
||||
|
||||
def build_parser_prune(self, subparsers, common_parser, mid_common_parser):
|
||||
|
||||
from ._common import process_epilog
|
||||
from ._common import define_archive_filters_group
|
||||
|
||||
|
@ -90,7 +90,6 @@ def do_rdelete(self, args, repository):
|
||||
return self.exit_code
|
||||
|
||||
def build_parser_rdelete(self, subparsers, common_parser, mid_common_parser):
|
||||
|
||||
from ._common import process_epilog
|
||||
|
||||
rdelete_epilog = process_epilog(
|
||||
|
@ -331,7 +331,6 @@ def _import_tar(self, args, repository, manifest, key, cache, tarstream):
|
||||
log_multi(str(archive), str(archive.stats), logger=logging.getLogger("borg.output.stats"))
|
||||
|
||||
def build_parser_tar(self, subparsers, common_parser, mid_common_parser):
|
||||
|
||||
from ._common import process_epilog
|
||||
|
||||
export_tar_epilog = process_epilog(
|
||||
|
@ -142,7 +142,6 @@ def do_transfer(self, args, *, repository, manifest, cache, other_repository=Non
|
||||
return EXIT_SUCCESS
|
||||
|
||||
def build_parser_transfer(self, subparsers, common_parser, mid_common_parser):
|
||||
|
||||
from ._common import process_epilog
|
||||
from ._common import define_archive_filters_group
|
||||
|
||||
|
@ -151,7 +151,7 @@ def match(self, path):
|
||||
return self.is_include_cmd[value]
|
||||
|
||||
# this is the slow way, if we have many patterns in self._items:
|
||||
for (pattern, cmd) in self._items:
|
||||
for pattern, cmd in self._items:
|
||||
if pattern.match(path, normalize=False):
|
||||
self.recurse_dir = pattern.recurse_dir
|
||||
return self.is_include_cmd[cmd]
|
||||
|
@ -26,7 +26,6 @@ def have_gnutar():
|
||||
|
||||
|
||||
class ArchiverTestCase(ArchiverTestCaseBase):
|
||||
|
||||
requires_gnutar = pytest.mark.skipif(not have_gnutar(), reason="GNU tar must be installed for this test.")
|
||||
requires_gzip = pytest.mark.skipif(not shutil.which("gzip"), reason="gzip must be installed for this test.")
|
||||
|
||||
|
@ -113,7 +113,6 @@ def test_help(benchmark, cmd):
|
||||
|
||||
@pytest.mark.parametrize("type, key, value", [(Item, "size", 1000), (Item, "mode", 0x777), (Item, "deleted", False)])
|
||||
def test_propdict_attributes(benchmark, type, key, value):
|
||||
|
||||
propdict = type()
|
||||
|
||||
def getattr_setattr(item, key, value):
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
def cf(chunks):
|
||||
"""chunk filter"""
|
||||
|
||||
# this is to simplify testing: either return the data piece (bytes) or the hole length (int).
|
||||
def _cf(chunk):
|
||||
if chunk.meta["allocation"] == CH_DATA:
|
||||
|
@ -601,7 +601,6 @@ def test_max_load_factor(self):
|
||||
|
||||
class IndexCorruptionTestCase(BaseTestCase):
|
||||
def test_bug_4829(self):
|
||||
|
||||
from struct import pack
|
||||
|
||||
def HH(x, y, z):
|
||||
|
Loading…
Reference in New Issue
Block a user