From 0a5fc6829c2dcf60a4db2a73004e09774ce1c8f4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 22:34:27 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- aiida_firecrest/remote_path.py | 1 + aiida_firecrest/scheduler.py | 1 + aiida_firecrest/transport.py | 5 ++++- aiida_firecrest/utils_test.py | 8 +++++--- conftest.py | 1 + tests/conftest.py | 1 + tests/test_calculation.py | 1 + tests/test_computer.py | 1 + tests/test_scheduler.py | 1 + tests/test_transport.py | 1 + 10 files changed, 17 insertions(+), 4 deletions(-) diff --git a/aiida_firecrest/remote_path.py b/aiida_firecrest/remote_path.py index 107b0ce..49e2f6a 100644 --- a/aiida_firecrest/remote_path.py +++ b/aiida_firecrest/remote_path.py @@ -4,6 +4,7 @@ in fact it is awaiting possible inclusion in pyfirecrest: https://github.com/eth-cscs/pyfirecrest/pull/43 """ + from __future__ import annotations from collections.abc import Iterator diff --git a/aiida_firecrest/scheduler.py b/aiida_firecrest/scheduler.py index 9a1f2bc..ebb3e54 100644 --- a/aiida_firecrest/scheduler.py +++ b/aiida_firecrest/scheduler.py @@ -1,4 +1,5 @@ """Scheduler interface.""" + from __future__ import annotations import re diff --git a/aiida_firecrest/transport.py b/aiida_firecrest/transport.py index ae1a35d..575a766 100644 --- a/aiida_firecrest/transport.py +++ b/aiida_firecrest/transport.py @@ -1,4 +1,5 @@ """Transport interface.""" + from __future__ import annotations import fnmatch @@ -26,7 +27,9 @@ class ValidAuthOption(TypedDict, total=False): switch: bool # whether the option is a boolean flag type: type[Any] | ParamType default: Any - non_interactive_default: bool # whether option should provide a default in non-interactive mode + non_interactive_default: ( + bool # whether option should provide a default in non-interactive mode + ) prompt: str # for interactive CLI help: str callback: Callable[..., Any] # for validation diff --git a/aiida_firecrest/utils_test.py b/aiida_firecrest/utils_test.py index f5c2801..1fc4ec7 100644 --- a/aiida_firecrest/utils_test.py +++ b/aiida_firecrest/utils_test.py @@ -1,4 +1,5 @@ """Utilities mainly for testing.""" + from __future__ import annotations from dataclasses import dataclass, field @@ -241,9 +242,10 @@ def compute_jobs_path(self, data: dict[str, Any], response: Response) -> Respons stderr=subprocess.STDOUT, ) else: - with open(script_path.parent / out_file, "w") as out, open( - script_path.parent / error_file, "w" - ) as err: + with ( + open(script_path.parent / out_file, "w") as out, + open(script_path.parent / error_file, "w") as err, + ): subprocess.run( [str(script_path)], cwd=script_path.parent, stdout=out, stderr=err ) diff --git a/conftest.py b/conftest.py index 1b417a3..3f71d60 100644 --- a/conftest.py +++ b/conftest.py @@ -1,4 +1,5 @@ """Pytest configuration that must be at the root level.""" + pytest_plugins = ["aiida.manage.tests.pytest_fixtures"] diff --git a/tests/conftest.py b/tests/conftest.py index 2481be1..1ee55ac 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,6 +2,7 @@ This sets up the Firecrest server to use, and telemetry for API requests. """ + from __future__ import annotations from functools import partial diff --git a/tests/test_calculation.py b/tests/test_calculation.py index d308671..21b108c 100644 --- a/tests/test_calculation.py +++ b/tests/test_calculation.py @@ -1,4 +1,5 @@ """Test for running calculations on a FireCREST computer.""" + from pathlib import Path from aiida import common, engine, manage, orm diff --git a/tests/test_computer.py b/tests/test_computer.py index 69faf82..071d333 100644 --- a/tests/test_computer.py +++ b/tests/test_computer.py @@ -1,6 +1,7 @@ """Tests for setting up an AiiDA computer for Firecrest, and basic functionality of the Firecrest transport and scheduler plugins. """ + from pathlib import Path from aiida import orm diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py index 4126b61..f3a5f1b 100644 --- a/tests/test_scheduler.py +++ b/tests/test_scheduler.py @@ -1,4 +1,5 @@ """Tests isolating only the Scheduler.""" + from aiida.schedulers import SchedulerError from aiida.schedulers.datastructures import CodeRunMode, JobTemplate import pytest diff --git a/tests/test_transport.py b/tests/test_transport.py index e30db7e..0b89d80 100644 --- a/tests/test_transport.py +++ b/tests/test_transport.py @@ -1,4 +1,5 @@ """Tests isolating only the Transport.""" + from pathlib import Path import platform