diff --git a/src/neuro_flow/batch_executor.py b/src/neuro_flow/batch_executor.py index 2fc7b60b..f65d93d3 100644 --- a/src/neuro_flow/batch_executor.py +++ b/src/neuro_flow/batch_executor.py @@ -134,9 +134,9 @@ async def get_running_flow( ref=image.ref, context=image.context_on_storage, dockerfile=dockerfile, - dockerfile_rel=RemotePath(image.dockerfile_rel) - if image.dockerfile_rel - else None, + dockerfile_rel=( + RemotePath(image.dockerfile_rel) if image.dockerfile_rel else None + ), ) return await RunningBatchFlow.create( config_loader=config_loader, diff --git a/src/neuro_flow/context.py b/src/neuro_flow/context.py index d61c34c4..8ad04ef9 100644 --- a/src/neuro_flow/context.py +++ b/src/neuro_flow/context.py @@ -1265,8 +1265,7 @@ def check_module_call_is_local(action_name: str, call_ast: ast.BaseModuleCall) - class SupportsAstMerge(Protocol): @property - def _specified_fields(self) -> AbstractSet[str]: - ... + def _specified_fields(self) -> AbstractSet[str]: ... _MergeTarget = TypeVar("_MergeTarget", bound=SupportsAstMerge) @@ -1304,12 +1303,10 @@ async def merge_asts(child: _MergeTarget, parent: SupportsAstMerge) -> _MergeTar class MixinApplyTarget(Protocol): @property - def mixins(self) -> Optional[Sequence[StrExpr]]: - ... + def mixins(self) -> Optional[Sequence[StrExpr]]: ... @property - def _specified_fields(self) -> AbstractSet[str]: - ... + def _specified_fields(self) -> AbstractSet[str]: ... _MixinApplyTarget = TypeVar("_MixinApplyTarget", bound=MixinApplyTarget) @@ -2053,9 +2050,11 @@ async def get_action( inputs=await setup_inputs_ctx(ctx, prep_task.call, prep_task.action.inputs), default_tags=self._default_tags, bake_id=self._bake_id, - local_info=self._local_info.children_info.get(real_id) - if self._local_info - else None, + local_info=( + self._local_info.children_info.get(real_id) + if self._local_info + else None + ), config_loader=self._cl, defaults=defaults, mixins=mixins, diff --git a/src/neuro_flow/expr.py b/src/neuro_flow/expr.py index ec93e058..0d684af3 100644 --- a/src/neuro_flow/expr.py +++ b/src/neuro_flow/expr.py @@ -76,26 +76,21 @@ @runtime_checkable class ContainerT(Protocol): - def __getattr__(self, attr: str) -> TypeT: - ... + def __getattr__(self, attr: str) -> TypeT: ... @runtime_checkable class MappingT(Protocol): - def __getitem__(self, key: LiteralT) -> TypeT: - ... + def __getitem__(self, key: LiteralT) -> TypeT: ... - def __iter__(self) -> Iterator[LiteralT]: - ... + def __iter__(self) -> Iterator[LiteralT]: ... @runtime_checkable class SequenceT(Protocol): - def __getitem__(self, idx: LiteralT) -> TypeT: - ... + def __getitem__(self, idx: LiteralT) -> TypeT: ... - def __iter__(self) -> Iterator[TypeT]: - ... + def __iter__(self) -> Iterator[TypeT]: ... class RootABC(abc.ABC): @@ -109,8 +104,7 @@ def client(self) -> AsyncContextManager[Client]: @property @abc.abstractmethod - def dry_run(self) -> bool: - ... + def dry_run(self) -> bool: ... class LocalScope(RootABC): diff --git a/src/neuro_flow/storage/api.py b/src/neuro_flow/storage/api.py index 31ed90be..d9b76a32 100644 --- a/src/neuro_flow/storage/api.py +++ b/src/neuro_flow/storage/api.py @@ -561,13 +561,15 @@ async def create_bake( "name": name, "tags": tags, "meta": { - "git_info": { - "sha": meta.git_info.sha, - "branch": meta.git_info.branch, - "tags": meta.git_info.tags, - } - if meta.git_info - else None, + "git_info": ( + { + "sha": meta.git_info.sha, + "branch": meta.git_info.branch, + "tags": meta.git_info.tags, + } + if meta.git_info + else None + ), }, } return await self._raw_client.create( @@ -820,9 +822,9 @@ async def create_bake_image( "yaml_defs": [_id_to_json(yaml_id) for yaml_id in yaml_defs], "ref": ref, "status": status.value, - "context_on_storage": str(context_on_storage) - if context_on_storage - else None, + "context_on_storage": ( + str(context_on_storage) if context_on_storage else None + ), "dockerfile_rel": dockerfile_rel, "builder_job_id": builder_job_id, } diff --git a/src/neuro_flow/utils.py b/src/neuro_flow/utils.py index 0f01c991..1fcfdf0e 100644 --- a/src/neuro_flow/utils.py +++ b/src/neuro_flow/utils.py @@ -112,12 +112,10 @@ async def run_subproc(exe: str, *args: str) -> None: class GlobalOptions(Protocol): @property - def verbosity(self) -> int: - ... + def verbosity(self) -> int: ... @property - def show_traceback(self) -> bool: - ... + def show_traceback(self) -> bool: ... def encode_global_options(options: GlobalOptions) -> List[str]: @@ -133,8 +131,7 @@ def encode_global_options(options: GlobalOptions) -> List[str]: class CommandRunner(Protocol): - async def __call__(self, *args: str) -> None: - ... + async def __call__(self, *args: str) -> None: ... def make_cmd_exec(exe: str, *, global_options: Iterable[str] = ()) -> CommandRunner: diff --git a/tests/unit/test_batch_runner.py b/tests/unit/test_batch_runner.py index 7a6c3c91..7a2c2f5a 100644 --- a/tests/unit/test_batch_runner.py +++ b/tests/unit/test_batch_runner.py @@ -236,9 +236,11 @@ async def _fake_run_cli(*args: str) -> None: "--recursive", "--update", "--no-target-directory", - str(assets / "batch_images/dir") - if ref == "image:main" - else str(assets / "batch_images/subdir"), + ( + str(assets / "batch_images/dir") + if ref == "image:main" + else str(assets / "batch_images/subdir") + ), str(img.context_on_storage), ) for run in runs diff --git a/tests/unit/test_functions.py b/tests/unit/test_functions.py index 0f924e24..b024abec 100644 --- a/tests/unit/test_functions.py +++ b/tests/unit/test_functions.py @@ -199,8 +199,7 @@ def __call__( tags: TagsCtx = frozenset(), dry_run: bool = False, volumes: Optional[VolumesCtx] = None, - ) -> LiveContext: - ... + ) -> LiveContext: ... @pytest.fixture