Merge pull request #7314 from ThomasWaldmann/newer-black

use latest "black"
This commit is contained in:
TW 2023-02-01 13:02:41 +01:00 committed by GitHub
commit 4515884af5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 5 additions and 20 deletions

View File

@ -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

View File

@ -1 +1 @@
black==22.6.0
black==23.1.0

View File

@ -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)

View File

@ -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.")

View File

@ -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

View File

@ -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(

View File

@ -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(

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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(

View File

@ -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(

View File

@ -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

View File

@ -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(

View File

@ -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(

View File

@ -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

View File

@ -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]

View File

@ -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.")

View File

@ -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):

View File

@ -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:

View File

@ -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):