Skip to content

Commit

Permalink
Disable preview features in black pre-commit config
Browse files Browse the repository at this point in the history
  • Loading branch information
adammcdonagh authored Jan 25, 2024
1 parent d07360a commit 6f25a32
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ repos:
- id: black
stages: [manual]
args:
- --preview
- --check
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
Expand Down
6 changes: 4 additions & 2 deletions src/opentaskpy/cli/task_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def main() -> None:
"""Parse args and call TaskRun class."""
parser = argparse.ArgumentParser(
formatter_class=argparse.RawTextHelpFormatter,
epilog=dedent("""\
epilog=dedent(
"""\
Environment Variables:
There are several environment variables that can be used to impact the behaviour:
Expand All @@ -42,7 +43,8 @@ def main() -> None:
e.g. OTF_OVERRIDE_TRANSFER_DESTINATION_0_PROTOCOL_CREDENTIALS_USERNAME
"""),
"""
),
)

parser.add_argument(
Expand Down
18 changes: 12 additions & 6 deletions src/opentaskpy/remotehandlers/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@ def connect(self, hostname: str, ssh_client: SSHClient | None = None) -> None:
with stdout as stdout_fh:
self.logger.log(
11,
f"[{self.spec['hostname']}] Remote uname:"
f" {stdout_fh.read().decode('UTF-8')}",
(
f"[{self.spec['hostname']}] Remote uname:"
f" {stdout_fh.read().decode('UTF-8')}"
),
)

sftp = ssh_client.open_sftp()
Expand Down Expand Up @@ -196,8 +198,10 @@ def list_files(

self.logger.log(
12,
f"[{self.spec['hostname']}] Searching in {directory} for files with"
f" pattern {file_pattern}",
(
f"[{self.spec['hostname']}] Searching in {directory} for files with"
f" pattern {file_pattern}"
),
)
remote_files: dict = {}
# Check the remote directory exists
Expand Down Expand Up @@ -779,8 +783,10 @@ def do_logwatch(self) -> int:
if re.search(self.spec["logWatch"]["contentRegex"], line.strip()):
self.logger.log(
12,
f"[{self.spec['hostname']}] Found matching line in log:"
f" {line.strip()} on line: {i+1}",
(
f"[{self.spec['hostname']}] Found matching line in log:"
f" {line.strip()} on line: {i+1}"
),
)
return 0

Expand Down
2 changes: 1 addition & 1 deletion src/opentaskpy/taskhandlers/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def run(self, kill_event: threading.Event | None = None) -> bool:
"Skipping task"
f" {order_id} ({batch_task['task_id']}) as"
f" dependency {dependency} has not completed"
)
),
)
all_dependencies_complete = False
continue
Expand Down
6 changes: 3 additions & 3 deletions tests/test_config_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,9 @@ def test_override_task_specific_attribute(write_dummy_variables_file, tmpdir):
# Override things
os.environ["OTF_OVERRIDE_TRANSFER_SOURCE_HOSTNAME"] = "non_existent_host"
os.environ["OTF_OVERRIDE_TRANSFER_DESTINATION_0_HOSTNAME"] = "non_existent_host2"
os.environ["OTF_OVERRIDE_TRANSFER_DESTINATION_0_PROTOCOL_CREDENTIALS_USERNAME"] = (
"my_username"
)
os.environ[
"OTF_OVERRIDE_TRANSFER_DESTINATION_0_PROTOCOL_CREDENTIALS_USERNAME"
] = "my_username"

# Load the task definition
config_loader = ConfigLoader(tmpdir)
Expand Down

0 comments on commit 6f25a32

Please sign in to comment.