mirror of
https://github.com/borgmatic-collective/borgmatic.git
synced 2026-07-22 02:03:01 +02:00
Attempted CI test fixes. Also spelling.
This commit is contained in:
@@ -65,7 +65,7 @@ def add_archive_paths(
|
||||
sequence of ArchivePath instances, add the paths to the directory list as options, sorting and
|
||||
deduplicating the resulting directory list's options.
|
||||
|
||||
After all of this reshuffling, make sure the orignal highlighted option remains highlighted.
|
||||
After all of this reshuffling, make sure the original highlighted option remains highlighted.
|
||||
'''
|
||||
highlighted_option = directory_list.highlighted_option
|
||||
original_options_count = len(directory_list.options)
|
||||
@@ -154,10 +154,10 @@ class Directory_list(textual.widgets.OptionList):
|
||||
|
||||
def on_mount(self):
|
||||
'''
|
||||
When this widget gets mounted in the DOM, subcribe to path loaded events so that we can find
|
||||
out about relevant archive paths as they load. And if this is a root directory list, start
|
||||
loading paths from the archive. If this is a non-root directory list, add any already loaded
|
||||
archive paths to this widget as options.
|
||||
When this widget gets mounted in the DOM, subscribe to path loaded events so that we can
|
||||
find out about relevant archive paths as they load. And if this is a root directory list,
|
||||
start loading paths from the archive. If this is a non-root directory list, add any already
|
||||
loaded archive paths to this widget as options.
|
||||
|
||||
Loading is started *after* subscribing to path loaded signals so that there's not a gap
|
||||
where we might miss out on any paths.
|
||||
|
||||
@@ -25,7 +25,7 @@ class Rich_color_formatter(logging.Formatter):
|
||||
|
||||
def format(self, record):
|
||||
'''
|
||||
Given a log record, format it with Rich-compatibe color markup correponding to its log
|
||||
Given a log record, format it with Rich-compatibe color markup corresponding to its log
|
||||
level.
|
||||
'''
|
||||
borgmatic.logger.add_custom_log_levels()
|
||||
|
||||
@@ -6,8 +6,8 @@ import borgmatic.actions.browse.bindings
|
||||
class Repositories_list(textual.widgets.OptionList):
|
||||
'''
|
||||
A widget for selecting a single Borg repository from among the repositories in a borgmatic
|
||||
configuratin file. The item selection event is handled in a Carousel instance, the parent widget
|
||||
of a Repositories_list.
|
||||
configuration file. The item selection event is handled in a Carousel instance, the parent
|
||||
widget of a Repositories_list.
|
||||
'''
|
||||
|
||||
BINDINGS = borgmatic.actions.browse.bindings.OPTION_LIST_BINDINGS
|
||||
|
||||
@@ -31,7 +31,7 @@ def run_arbitrary_borg(
|
||||
borgmatic.logger.add_custom_log_levels()
|
||||
lock_wait = config.get('lock_wait', None)
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
options = options[1:] if options[0] == '--' else options
|
||||
|
||||
# Borg commands like "key" have a sub-command ("export", etc.) that must follow it.
|
||||
|
||||
@@ -212,7 +212,7 @@ def run_configuration(config_filename, config, config_paths, arguments): # noqa
|
||||
f"Skipping {'/'.join(skip_actions)} action{'s' if len(skip_actions) > 1 else ''} due to configured skip_actions",
|
||||
)
|
||||
|
||||
try: # noqa: PLR1702, PLW0717
|
||||
try: # noqa: PLR1702
|
||||
with (
|
||||
Monitoring_hooks(config_filename, config, arguments, global_arguments),
|
||||
borgmatic.hooks.command.Before_after_hooks(
|
||||
@@ -823,7 +823,7 @@ def collect_highlander_action_summary_logs(configs, arguments, configuration_par
|
||||
'''
|
||||
add_custom_log_levels()
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
if 'bootstrap' in arguments:
|
||||
try:
|
||||
local_borg_version = borg_version.local_borg_version(
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ class JournaldHandler(logging.Handler):
|
||||
def emit(self, record):
|
||||
sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
message_parts = []
|
||||
entry = dict(
|
||||
MESSAGE=record.getMessage(),
|
||||
|
||||
@@ -134,5 +134,8 @@ known-first-party = ["borgmatic"]
|
||||
"T201", # print statement
|
||||
]
|
||||
|
||||
[tool.ruff.lint.pylint]
|
||||
max-statements-in-try = 35
|
||||
|
||||
[tool.codespell]
|
||||
skip = ".git,.tox,build"
|
||||
|
||||
@@ -40,7 +40,7 @@ def test_container_secret():
|
||||
original_working_directory = os.getcwd()
|
||||
os.chdir(temporary_directory)
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
config_path = os.path.join(temporary_directory, 'test.yaml')
|
||||
generate_configuration(config_path, repository_path, secrets_directory=temporary_directory)
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ def test_file_credential():
|
||||
original_working_directory = os.getcwd()
|
||||
os.chdir(temporary_directory)
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
config_path = os.path.join(temporary_directory, 'test.yaml')
|
||||
credential_path = os.path.join(temporary_directory, 'mycredential')
|
||||
generate_configuration(config_path, repository_path, credential_path)
|
||||
|
||||
@@ -39,7 +39,7 @@ def test_keepassxc_password():
|
||||
original_working_directory = os.getcwd()
|
||||
os.chdir(temporary_directory)
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
config_path = os.path.join(temporary_directory, 'test.yaml')
|
||||
generate_configuration(config_path, repository_path)
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ def test_systemd_credential():
|
||||
original_working_directory = os.getcwd()
|
||||
os.chdir(temporary_directory)
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
config_path = os.path.join(temporary_directory, 'test.yaml')
|
||||
generate_configuration(config_path, repository_path)
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ def test_btrfs_create_and_list():
|
||||
temporary_directory = tempfile.mkdtemp()
|
||||
repository_path = os.path.join(temporary_directory, 'test.borg')
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
config_path = os.path.join(temporary_directory, 'test.yaml')
|
||||
generate_configuration(config_path, repository_path)
|
||||
|
||||
|
||||
@@ -443,7 +443,7 @@ def test_database_dump_and_restore():
|
||||
|
||||
original_working_directory = os.getcwd()
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
config_path = os.path.join(temporary_directory, 'test.yaml')
|
||||
config = write_configuration(
|
||||
temporary_directory,
|
||||
@@ -501,7 +501,7 @@ def test_database_dump_and_restore_with_restore_cli_flags():
|
||||
|
||||
original_working_directory = os.getcwd()
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
config_path = os.path.join(temporary_directory, 'test.yaml')
|
||||
config = write_simple_custom_restore_configuration(
|
||||
temporary_directory,
|
||||
@@ -582,7 +582,7 @@ def test_database_dump_and_restore_with_restore_configuration_options():
|
||||
|
||||
original_working_directory = os.getcwd()
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
config_path = os.path.join(temporary_directory, 'test.yaml')
|
||||
config = write_custom_restore_configuration(
|
||||
temporary_directory,
|
||||
@@ -641,7 +641,7 @@ def test_database_dump_and_restore_with_directory_format():
|
||||
|
||||
original_working_directory = os.getcwd()
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
config_path = os.path.join(temporary_directory, 'test.yaml')
|
||||
config = write_configuration(
|
||||
temporary_directory,
|
||||
@@ -737,7 +737,7 @@ def test_database_dump_and_restore_containers():
|
||||
|
||||
os.environ['PATH'] = f'/app/tests/end-to-end/commands:{original_path}'
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
config_path = os.path.join(temporary_directory, 'test.yaml')
|
||||
config = write_container_configuration(
|
||||
temporary_directory,
|
||||
|
||||
@@ -41,7 +41,7 @@ def test_lvm_create_and_list():
|
||||
temporary_directory = tempfile.mkdtemp()
|
||||
repository_path = os.path.join(temporary_directory, 'test.borg')
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
config_path = os.path.join(temporary_directory, 'test.yaml')
|
||||
generate_configuration(config_path, repository_path)
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ def test_zfs_create_and_list():
|
||||
temporary_directory = tempfile.mkdtemp()
|
||||
repository_path = os.path.join(temporary_directory, 'test.borg')
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
config_path = os.path.join(temporary_directory, 'test.yaml')
|
||||
generate_configuration(config_path, repository_path)
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ def test_borgmatic_command(monitoring_hook_configuration, expected_request_count
|
||||
os.mkdir(extract_path)
|
||||
os.chdir(extract_path)
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
config_path = os.path.join(temporary_directory, 'test.yaml')
|
||||
generate_configuration(config_path, repository_path, monitoring_hook_configuration)
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ def test_borgmatic_command(generate_configuration):
|
||||
os.mkdir(extract_path)
|
||||
os.chdir(extract_path)
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
config_path = os.path.join(temporary_directory, 'test.yaml')
|
||||
generate_configuration(config_path, repository_path)
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ def test_borgmatic_command():
|
||||
os.chdir(extract_path)
|
||||
environment = dict(os.environ, PASSPHRASE='test')
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
config_path = os.path.join(temporary_directory, 'test.yaml')
|
||||
generate_configuration(config_path, repository_path)
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ def test_borgmatic_command():
|
||||
os.mkdir(extract_path)
|
||||
os.chdir(extract_path)
|
||||
|
||||
try: # noqa: PLW0717
|
||||
try:
|
||||
config_path = os.path.join(temporary_directory, 'test.yaml')
|
||||
generate_configuration(config_path, repository_path)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user