From 1c0dc3f904d8dc8d759ff3678f5435091cca0c2f Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Mon, 13 May 2019 23:39:10 +0200 Subject: [PATCH] Run isort over the source --- borgmatic/borg/check.py | 1 - borgmatic/borg/create.py | 1 - borgmatic/borg/execute.py | 1 - borgmatic/borg/extract.py | 3 +-- borgmatic/borg/info.py | 1 - borgmatic/borg/list.py | 1 - borgmatic/borg/prune.py | 1 - borgmatic/commands/borgmatic.py | 27 +++++++++---------- borgmatic/commands/convert_config.py | 3 +-- borgmatic/commands/generate_config.py | 3 +-- borgmatic/commands/hook.py | 1 - borgmatic/commands/validate_config.py | 4 +-- borgmatic/config/generate.py | 1 - borgmatic/config/legacy.py | 1 - borgmatic/config/load.py | 1 - borgmatic/config/validate.py | 1 - borgmatic/verbosity.py | 1 - setup.py | 3 +-- tests/integration/commands/test_borgmatic.py | 2 +- .../commands/test_convert_config.py | 2 +- tests/integration/config/test_generate.py | 4 +-- tests/integration/config/test_legacy.py | 5 ++-- tests/integration/config/test_validate.py | 2 +- tests/unit/borg/test_check.py | 5 ++-- tests/unit/borg/test_create.py | 1 + tests/unit/borg/test_execute.py | 1 + tests/unit/borg/test_extract.py | 1 + tests/unit/borg/test_info.py | 2 +- tests/unit/borg/test_init.py | 2 +- tests/unit/borg/test_list.py | 2 +- tests/unit/borg/test_prune.py | 1 + tests/unit/config/test_convert.py | 5 ++-- tests/unit/config/test_legacy.py | 2 +- 33 files changed, 38 insertions(+), 54 deletions(-) diff --git a/borgmatic/borg/check.py b/borgmatic/borg/check.py index 7051138..93e4287 100644 --- a/borgmatic/borg/check.py +++ b/borgmatic/borg/check.py @@ -5,7 +5,6 @@ import subprocess from borgmatic.borg import extract from borgmatic.logger import get_logger - DEFAULT_CHECKS = ('repository', 'archives') DEFAULT_PREFIX = '{hostname}-' diff --git a/borgmatic/borg/create.py b/borgmatic/borg/create.py index ccd9e3f..3cb8859 100644 --- a/borgmatic/borg/create.py +++ b/borgmatic/borg/create.py @@ -7,7 +7,6 @@ import tempfile from borgmatic.borg.execute import execute_command from borgmatic.logger import get_logger - logger = get_logger(__name__) diff --git a/borgmatic/borg/execute.py b/borgmatic/borg/execute.py index 890af38..80040be 100644 --- a/borgmatic/borg/execute.py +++ b/borgmatic/borg/execute.py @@ -2,7 +2,6 @@ import subprocess from borgmatic.logger import get_logger - logger = get_logger(__name__) diff --git a/borgmatic/borg/extract.py b/borgmatic/borg/extract.py index 7d0b2a8..0a9f69d 100644 --- a/borgmatic/borg/extract.py +++ b/borgmatic/borg/extract.py @@ -1,10 +1,9 @@ import logging -import sys import subprocess +import sys from borgmatic.logger import get_logger - logger = get_logger(__name__) diff --git a/borgmatic/borg/info.py b/borgmatic/borg/info.py index 8711747..6b6df42 100644 --- a/borgmatic/borg/info.py +++ b/borgmatic/borg/info.py @@ -3,7 +3,6 @@ import logging from borgmatic.borg.execute import execute_command from borgmatic.logger import get_logger - logger = get_logger(__name__) diff --git a/borgmatic/borg/list.py b/borgmatic/borg/list.py index bd18ded..cc66a5b 100644 --- a/borgmatic/borg/list.py +++ b/borgmatic/borg/list.py @@ -3,7 +3,6 @@ import logging from borgmatic.borg.execute import execute_command from borgmatic.logger import get_logger - logger = get_logger(__name__) diff --git a/borgmatic/borg/prune.py b/borgmatic/borg/prune.py index ef4f8b8..f211b3c 100644 --- a/borgmatic/borg/prune.py +++ b/borgmatic/borg/prune.py @@ -3,7 +3,6 @@ import subprocess from borgmatic.logger import get_logger - logger = get_logger(__name__) diff --git a/borgmatic/commands/borgmatic.py b/borgmatic/commands/borgmatic.py index fe12443..318899e 100644 --- a/borgmatic/commands/borgmatic.py +++ b/borgmatic/commands/borgmatic.py @@ -1,31 +1,28 @@ -from argparse import ArgumentParser import collections -import colorama import json import logging import os -from subprocess import CalledProcessError import sys +from argparse import ArgumentParser +from subprocess import CalledProcessError +import colorama import pkg_resources -from borgmatic.borg import ( - check as borg_check, - create as borg_create, - environment as borg_environment, - prune as borg_prune, - extract as borg_extract, - list as borg_list, - info as borg_info, - init as borg_init, -) +from borgmatic.borg import check as borg_check +from borgmatic.borg import create as borg_create +from borgmatic.borg import environment as borg_environment +from borgmatic.borg import extract as borg_extract +from borgmatic.borg import info as borg_info +from borgmatic.borg import init as borg_init +from borgmatic.borg import list as borg_list +from borgmatic.borg import prune as borg_prune from borgmatic.commands import hook from borgmatic.config import checks, collect, convert, validate -from borgmatic.logger import should_do_markup, get_logger +from borgmatic.logger import get_logger, should_do_markup from borgmatic.signals import configure_signals from borgmatic.verbosity import verbosity_to_log_level - logger = get_logger(__name__) LEGACY_CONFIG_PATH = '/etc/borgmatic/config' diff --git a/borgmatic/commands/convert_config.py b/borgmatic/commands/convert_config.py index 5a0bca1..69568d9 100644 --- a/borgmatic/commands/convert_config.py +++ b/borgmatic/commands/convert_config.py @@ -1,13 +1,12 @@ -from argparse import ArgumentParser import os import sys import textwrap +from argparse import ArgumentParser from ruamel import yaml from borgmatic.config import convert, generate, legacy, validate - DEFAULT_SOURCE_CONFIG_FILENAME = '/etc/borgmatic/config' DEFAULT_SOURCE_EXCLUDES_FILENAME = '/etc/borgmatic/excludes' DEFAULT_DESTINATION_CONFIG_FILENAME = '/etc/borgmatic/config.yaml' diff --git a/borgmatic/commands/generate_config.py b/borgmatic/commands/generate_config.py index 6e08fcc..f338f30 100644 --- a/borgmatic/commands/generate_config.py +++ b/borgmatic/commands/generate_config.py @@ -1,9 +1,8 @@ -from argparse import ArgumentParser import sys +from argparse import ArgumentParser from borgmatic.config import generate, validate - DEFAULT_DESTINATION_CONFIG_FILENAME = '/etc/borgmatic/config.yaml' diff --git a/borgmatic/commands/hook.py b/borgmatic/commands/hook.py index 0e915c8..3e28441 100644 --- a/borgmatic/commands/hook.py +++ b/borgmatic/commands/hook.py @@ -2,7 +2,6 @@ import subprocess from borgmatic.logger import get_logger - logger = get_logger(__name__) diff --git a/borgmatic/commands/validate_config.py b/borgmatic/commands/validate_config.py index 606b793..6ad446b 100644 --- a/borgmatic/commands/validate_config.py +++ b/borgmatic/commands/validate_config.py @@ -1,6 +1,6 @@ -from argparse import ArgumentParser -import sys import logging +import sys +from argparse import ArgumentParser from borgmatic.config import collect, validate from borgmatic.logger import get_logger diff --git a/borgmatic/config/generate.py b/borgmatic/config/generate.py index 509fcc4..0f34364 100644 --- a/borgmatic/config/generate.py +++ b/borgmatic/config/generate.py @@ -2,7 +2,6 @@ import os from ruamel import yaml - INDENT = 4 diff --git a/borgmatic/config/legacy.py b/borgmatic/config/legacy.py index 34c0e36..9135278 100644 --- a/borgmatic/config/legacy.py +++ b/borgmatic/config/legacy.py @@ -1,7 +1,6 @@ from collections import OrderedDict, namedtuple from configparser import RawConfigParser - Section_format = namedtuple('Section_format', ('name', 'options')) Config_option = namedtuple('Config_option', ('name', 'value_type', 'required')) diff --git a/borgmatic/config/load.py b/borgmatic/config/load.py index a3df4c4..8339dfb 100644 --- a/borgmatic/config/load.py +++ b/borgmatic/config/load.py @@ -4,7 +4,6 @@ import ruamel.yaml from borgmatic.logger import get_logger - logger = get_logger(__name__) diff --git a/borgmatic/config/validate.py b/borgmatic/config/validate.py index 64b96f5..8c92c47 100644 --- a/borgmatic/config/validate.py +++ b/borgmatic/config/validate.py @@ -8,7 +8,6 @@ import ruamel.yaml from borgmatic.config import load from borgmatic.logger import get_logger - logger = get_logger(__name__) diff --git a/borgmatic/verbosity.py b/borgmatic/verbosity.py index 8444a0b..300f644 100644 --- a/borgmatic/verbosity.py +++ b/borgmatic/verbosity.py @@ -1,6 +1,5 @@ import logging - VERBOSITY_WARNING = 0 VERBOSITY_SOME = 1 VERBOSITY_LOTS = 2 diff --git a/setup.py b/setup.py index c799d71..d2ca1f9 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ -from setuptools import setup, find_packages - +from setuptools import find_packages, setup VERSION = '1.3.4.dev0' diff --git a/tests/integration/commands/test_borgmatic.py b/tests/integration/commands/test_borgmatic.py index 704dc7c..9232a9b 100644 --- a/tests/integration/commands/test_borgmatic.py +++ b/tests/integration/commands/test_borgmatic.py @@ -1,7 +1,7 @@ import subprocess -from flexmock import flexmock import pytest +from flexmock import flexmock from borgmatic.commands import borgmatic as module diff --git a/tests/integration/commands/test_convert_config.py b/tests/integration/commands/test_convert_config.py index a846a30..db22710 100644 --- a/tests/integration/commands/test_convert_config.py +++ b/tests/integration/commands/test_convert_config.py @@ -1,7 +1,7 @@ import os -from flexmock import flexmock import pytest +from flexmock import flexmock from borgmatic.commands import convert_config as module diff --git a/tests/integration/config/test_generate.py b/tests/integration/config/test_generate.py index 5cd93bb..cf399cb 100644 --- a/tests/integration/config/test_generate.py +++ b/tests/integration/config/test_generate.py @@ -1,9 +1,9 @@ -from io import StringIO import os import sys +from io import StringIO -from flexmock import flexmock import pytest +from flexmock import flexmock from borgmatic.config import generate as module diff --git a/tests/integration/config/test_legacy.py b/tests/integration/config/test_legacy.py index f9373d0..870da88 100644 --- a/tests/integration/config/test_legacy.py +++ b/tests/integration/config/test_legacy.py @@ -1,7 +1,6 @@ -from io import StringIO - -from collections import OrderedDict import string +from collections import OrderedDict +from io import StringIO from borgmatic.config import legacy as module diff --git a/tests/integration/config/test_validate.py b/tests/integration/config/test_validate.py index 2182d2e..706743b 100644 --- a/tests/integration/config/test_validate.py +++ b/tests/integration/config/test_validate.py @@ -2,8 +2,8 @@ import io import string import sys -from flexmock import flexmock import pytest +from flexmock import flexmock from borgmatic.config import validate as module diff --git a/tests/unit/borg/test_check.py b/tests/unit/borg/test_check.py index 95b32c3..2424165 100644 --- a/tests/unit/borg/test_check.py +++ b/tests/unit/borg/test_check.py @@ -1,11 +1,12 @@ -from subprocess import STDOUT import logging import sys +from subprocess import STDOUT -from flexmock import flexmock import pytest +from flexmock import flexmock from borgmatic.borg import check as module + from ..test_verbosity import insert_logging_mock diff --git a/tests/unit/borg/test_create.py b/tests/unit/borg/test_create.py index 18914fa..ed50eed 100644 --- a/tests/unit/borg/test_create.py +++ b/tests/unit/borg/test_create.py @@ -3,6 +3,7 @@ import logging from flexmock import flexmock from borgmatic.borg import create as module + from ..test_verbosity import insert_logging_mock diff --git a/tests/unit/borg/test_execute.py b/tests/unit/borg/test_execute.py index 6bb2938..a7bc45b 100644 --- a/tests/unit/borg/test_execute.py +++ b/tests/unit/borg/test_execute.py @@ -1,4 +1,5 @@ from flexmock import flexmock + from borgmatic.borg import execute as module diff --git a/tests/unit/borg/test_extract.py b/tests/unit/borg/test_extract.py index 75b4935..da187ff 100644 --- a/tests/unit/borg/test_extract.py +++ b/tests/unit/borg/test_extract.py @@ -4,6 +4,7 @@ import sys from flexmock import flexmock from borgmatic.borg import extract as module + from ..test_verbosity import insert_logging_mock diff --git a/tests/unit/borg/test_info.py b/tests/unit/borg/test_info.py index a3abc61..bf11e92 100644 --- a/tests/unit/borg/test_info.py +++ b/tests/unit/borg/test_info.py @@ -3,8 +3,8 @@ import logging from flexmock import flexmock from borgmatic.borg import info as module -from ..test_verbosity import insert_logging_mock +from ..test_verbosity import insert_logging_mock INFO_COMMAND = ('borg', 'info', 'repo') diff --git a/tests/unit/borg/test_init.py b/tests/unit/borg/test_init.py index d420d86..da70683 100644 --- a/tests/unit/borg/test_init.py +++ b/tests/unit/borg/test_init.py @@ -3,8 +3,8 @@ import logging from flexmock import flexmock from borgmatic.borg import init as module -from ..test_verbosity import insert_logging_mock +from ..test_verbosity import insert_logging_mock INFO_REPOSITORY_EXISTS_RESPONSE_CODE = 0 INFO_REPOSITORY_NOT_FOUND_RESPONSE_CODE = 2 diff --git a/tests/unit/borg/test_list.py b/tests/unit/borg/test_list.py index ea354b3..fedc92b 100644 --- a/tests/unit/borg/test_list.py +++ b/tests/unit/borg/test_list.py @@ -3,8 +3,8 @@ import logging from flexmock import flexmock from borgmatic.borg import list as module -from ..test_verbosity import insert_logging_mock +from ..test_verbosity import insert_logging_mock LIST_COMMAND = ('borg', 'list', 'repo') diff --git a/tests/unit/borg/test_prune.py b/tests/unit/borg/test_prune.py index 6f82d28..5e426f0 100644 --- a/tests/unit/borg/test_prune.py +++ b/tests/unit/borg/test_prune.py @@ -4,6 +4,7 @@ from collections import OrderedDict from flexmock import flexmock from borgmatic.borg import prune as module + from ..test_verbosity import insert_logging_mock diff --git a/tests/unit/config/test_convert.py b/tests/unit/config/test_convert.py index 73c3099..cdf1d44 100644 --- a/tests/unit/config/test_convert.py +++ b/tests/unit/config/test_convert.py @@ -1,12 +1,11 @@ -from collections import defaultdict, OrderedDict, namedtuple import os +from collections import OrderedDict, defaultdict, namedtuple -from flexmock import flexmock import pytest +from flexmock import flexmock from borgmatic.config import convert as module - Parsed_config = namedtuple('Parsed_config', ('location', 'storage', 'retention', 'consistency')) diff --git a/tests/unit/config/test_legacy.py b/tests/unit/config/test_legacy.py index e2b213a..230aa74 100644 --- a/tests/unit/config/test_legacy.py +++ b/tests/unit/config/test_legacy.py @@ -1,7 +1,7 @@ from collections import OrderedDict -from flexmock import flexmock import pytest +from flexmock import flexmock from borgmatic.config import legacy as module