Skip to content

Commit 8013ac3

Browse files
authored
Merge pull request #802 from hpcflow/bump/black
Bump/black
2 parents b37d4bc + 5e6bf81 commit 8013ac3

30 files changed

+1155
-1451
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ repos:
2020
CHANGELOG-dev.md
2121
)$
2222
always_run: false # required to respect exclude
23-
- repo: https://github.com/psf/black
24-
rev: 22.3.0
23+
- repo: https://github.com/psf/black-pre-commit-mirror
24+
rev: 25.1.0
2525
hooks:
2626
- id: black
2727
args: [--line-length=90]

hpcflow/sdk/app.py

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ def __call__(
178178
variables: dict[str, str] | None = None,
179179
status: bool = True,
180180
add_submission: bool = False,
181-
) -> _Workflow | _Submission | None:
182-
...
181+
) -> _Workflow | _Submission | None: ...
183182

184183
class _MakeDemoWorkflow(Protocol):
185184
"""Type of :py:meth:`BaseApp.make_demo_workflow`"""
@@ -198,8 +197,7 @@ def __call__(
198197
variables: dict[str, str] | None = None,
199198
status: bool = True,
200199
add_submission: bool = False,
201-
) -> _Workflow | _Submission | None:
202-
...
200+
) -> _Workflow | _Submission | None: ...
203201

204202
class _MakeAndSubmitWorkflow(Protocol):
205203
"""Type of :py:meth:`BaseApp.make_and_submit_workflow`"""
@@ -225,8 +223,7 @@ def __call__(
225223
tasks: list[int] | None = None,
226224
cancel: bool = False,
227225
status: bool = True,
228-
) -> tuple[_Workflow, Mapping[int, Sequence[int]]] | _Workflow:
229-
...
226+
) -> tuple[_Workflow, Mapping[int, Sequence[int]]] | _Workflow: ...
230227

231228
class _MakeAndSubmitDemoWorkflow(Protocol):
232229
"""Type of :py:meth:`BaseApp.make_and_submit_demo_workflow`"""
@@ -251,8 +248,7 @@ def __call__(
251248
tasks: list[int] | None = None,
252249
cancel: bool = False,
253250
status: bool = True,
254-
) -> tuple[_Workflow, Mapping[int, Sequence[int]]] | _Workflow:
255-
...
251+
) -> tuple[_Workflow, Mapping[int, Sequence[int]]] | _Workflow: ...
256252

257253
class _SubmitWorkflow(Protocol):
258254
"""Type of :py:meth:`BaseApp.submit_workflow`"""
@@ -265,8 +261,7 @@ def __call__(
265261
wait: bool = False,
266262
return_idx: bool = False,
267263
tasks: list[int] | None = None,
268-
) -> Mapping[int, Sequence[int]] | None:
269-
...
264+
) -> Mapping[int, Sequence[int]] | None: ...
270265

271266
class _GetKnownSubmissions(Protocol):
272267
"""Type of :py:meth:`BaseApp.get_known_submissions`"""
@@ -278,8 +273,7 @@ def __call__(
278273
no_update: bool = False,
279274
as_json: bool = False,
280275
status: Status | None = None,
281-
) -> Sequence[KnownSubmissionItem]:
282-
...
276+
) -> Sequence[KnownSubmissionItem]: ...
283277

284278
class _Show(Protocol):
285279
"""Type of :py:meth:`BaseApp.show`"""
@@ -289,8 +283,7 @@ def __call__(
289283
max_recent: int = 3,
290284
full: bool = False,
291285
no_update: bool = False,
292-
) -> None:
293-
...
286+
) -> None: ...
294287

295288
class _Cancel(Protocol):
296289
"""Type of :py:meth:`BaseApp.cancel`"""
@@ -300,14 +293,12 @@ def __call__(
300293
workflow_ref: int | str | Path,
301294
ref_is_path: str | None = None,
302295
status: bool = False,
303-
) -> None:
304-
...
296+
) -> None: ...
305297

306298
class _RunTests(Protocol):
307299
"""Type of :py:meth:`BaseApp.run_tests and run_hpcflow_tests`"""
308300

309-
def __call__(self, *args: str) -> int:
310-
...
301+
def __call__(self, *args: str) -> int: ...
311302

312303

313304
SDK_logger = get_SDK_logger(__name__)
@@ -558,9 +549,9 @@ def __init__(
558549
self._config: Config | None = (
559550
None # assigned on first access to `config` property
560551
)
561-
self._config_files: dict[
562-
str, ConfigFile
563-
] = {} # assigned on config load, keys are string absolute paths
552+
self._config_files: dict[str, ConfigFile] = (
553+
{}
554+
) # assigned on config load, keys are string absolute paths
564555

565556
# Set by `_load_template_components`:
566557
self._template_components: TemplateComponents = {}
@@ -2588,9 +2579,9 @@ def update_known_subs_file(
25882579
# date-times:
25892580
line_date: dict[int, str] = {}
25902581

2591-
removed_IDs: list[
2592-
int
2593-
] = [] # which submissions we completely remove from the file
2582+
removed_IDs: list[int] = (
2583+
[]
2584+
) # which submissions we completely remove from the file
25942585

25952586
new_lines: list[str] = []
25962587
line_IDs: list[int] = []

hpcflow/sdk/config/callbacks.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@ def vars_repl(match_obj: re.Match[str]) -> str:
3333

3434

3535
@overload
36-
def callback_file_paths(config: Config, file_path: PathLike) -> PathLike:
37-
...
36+
def callback_file_paths(config: Config, file_path: PathLike) -> PathLike: ...
3837

3938

4039
@overload
41-
def callback_file_paths(config: Config, file_path: list[PathLike]) -> list[PathLike]:
42-
...
40+
def callback_file_paths(config: Config, file_path: list[PathLike]) -> list[PathLike]: ...
4341

4442

4543
def callback_file_paths(config: Config, file_path: PathLike | list[PathLike]):
@@ -67,18 +65,15 @@ def callback_bool(config: Config, value: str | bool) -> bool:
6765

6866

6967
@overload
70-
def callback_lowercase(config: Config, value: list[str]) -> list[str]:
71-
...
68+
def callback_lowercase(config: Config, value: list[str]) -> list[str]: ...
7269

7370

7471
@overload
75-
def callback_lowercase(config: Config, value: dict[str, T]) -> dict[str, T]:
76-
...
72+
def callback_lowercase(config: Config, value: dict[str, T]) -> dict[str, T]: ...
7773

7874

7975
@overload
80-
def callback_lowercase(config: Config, value: str) -> str:
81-
...
76+
def callback_lowercase(config: Config, value: str) -> str: ...
8277

8378

8479
def callback_lowercase(

hpcflow/sdk/config/config.py

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,7 @@ def __setattr__(self, name: str, value):
541541
else:
542542
super().__setattr__(name, value)
543543

544-
def _disable_callbacks(
545-
self, callbacks: Sequence[str]
546-
) -> tuple[
544+
def _disable_callbacks(self, callbacks: Sequence[str]) -> tuple[
547545
dict[str, tuple[GetterCallback, ...]],
548546
dict[str, tuple[SetterCallback, ...]],
549547
dict[str, tuple[UnsetterCallback, ...]],
@@ -661,14 +659,12 @@ def _all_keys(self) -> list[str]:
661659
@overload
662660
def get_all(
663661
self, *, include_overrides: bool = True, as_str: Literal[True]
664-
) -> Mapping[str, str]:
665-
...
662+
) -> Mapping[str, str]: ...
666663

667664
@overload
668665
def get_all(
669666
self, *, include_overrides: bool = True, as_str: Literal[False] = False
670-
) -> Mapping[str, Any]:
671-
...
667+
) -> Mapping[str, Any]: ...
672668

673669
def get_all(
674670
self, *, include_overrides: bool = True, as_str: bool = False
@@ -740,8 +736,7 @@ def _get(
740736
as_str: Literal[False] = False,
741737
callback=True,
742738
default_value=None,
743-
) -> Any:
744-
...
739+
) -> Any: ...
745740

746741
@overload
747742
def _get(
@@ -753,8 +748,7 @@ def _get(
753748
as_str: Literal[True],
754749
callback=True,
755750
default_value=None,
756-
) -> list[str] | str:
757-
...
751+
) -> list[str] | str: ...
758752

759753
def _get(
760754
self,
@@ -829,8 +823,7 @@ def _parse_JSON(self, name: str, value: str) -> Any:
829823
@overload
830824
def _set(
831825
self, name: str, value: str, *, is_json: Literal[True], callback=True, quiet=False
832-
) -> None:
833-
...
826+
) -> None: ...
834827

835828
@overload
836829
def _set(
@@ -841,8 +834,7 @@ def _set(
841834
is_json: Literal[False] = False,
842835
callback=True,
843836
quiet=False,
844-
) -> None:
845-
...
837+
) -> None: ...
846838

847839
def _set(
848840
self, name: str, value, *, is_json=False, callback=True, quiet=False
@@ -918,14 +910,12 @@ def set(
918910
*,
919911
is_json: Literal[False] = False,
920912
quiet: bool = False,
921-
) -> None:
922-
...
913+
) -> None: ...
923914

924915
@overload
925916
def set(
926917
self, path: str, value: str, *, is_json: Literal[True], quiet: bool = False
927-
) -> None:
928-
...
918+
) -> None: ...
929919

930920
def set(
931921
self, path: str, value: Any, *, is_json: bool = False, quiet: bool = False
@@ -1003,8 +993,7 @@ def get(
1003993
copy: bool = False,
1004994
ret_root_and_parts: Literal[False] = False,
1005995
default: Any | None = None,
1006-
) -> Any:
1007-
...
996+
) -> Any: ...
1008997

1009998
@overload
1010999
def get(
@@ -1015,8 +1004,7 @@ def get(
10151004
copy: bool = False,
10161005
ret_root_and_parts: Literal[True],
10171006
default: Any | None = None,
1018-
) -> tuple[Any, Any, list[str]]:
1019-
...
1007+
) -> tuple[Any, Any, list[str]]: ...
10201008

10211009
def get(
10221010
self,

0 commit comments

Comments
 (0)