Skip to content

Commit 6f08e7b

Browse files
committed
removed circular import issue checking for container entrypoint
1 parent d7a9b2a commit 6f08e7b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pydra/compose/shell/task.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
)
2727
from pydra.compose import base
2828
from pydra.compose.base.field import RequirementSet
29-
from pydra.environments.base import Container
3029
from pydra.compose.base.helpers import is_set
3130
from . import field
3231
from .templating import (
@@ -255,7 +254,8 @@ class ShellTask(base.Task[ShellOutputsType]):
255254

256255
def _run(self, job: "Job[ShellTask]", rerun: bool = True) -> None:
257256
"""Run the shell command."""
258-
if self.executable is None and not isinstance(job.environment, Container):
257+
258+
if self.executable is None and not job.environment.has_entrypoint:
259259
raise ValueError(
260260
"executable is not set, and the environment is not a container "
261261
f"({job.environment}) with an entrypoint"

pydra/environments/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class Environment:
2626
TODO: add setup and teardown methods
2727
"""
2828

29+
has_entrypoint = False
30+
2931
def setup(self):
3032
pass
3133

@@ -107,6 +109,8 @@ class Container(Environment):
107109
Extra arguments to be passed to the container
108110
"""
109111

112+
has_entrypoint = True
113+
110114
image: str
111115
tag: str = "latest"
112116
root: str = "/mnt/pydra"

0 commit comments

Comments
 (0)