1414 ClassVar ,
1515 Dict ,
1616 Iterable ,
17+ List ,
1718 Optional ,
1819 Self ,
1920 Tuple ,
@@ -138,7 +139,7 @@ class EnvBase(ABC):
138139 spec : EnvSpecBase
139140 within : Optional ["EnvBase" ]
140141 settings : Optional [SoftwareDeploymentSettingsBase ]
141- shell_executable : str
142+ shell_executable : List [ str ]
142143 tempdir : Path
143144 _cache_prefix : Path
144145 _deployment_prefix : Path
@@ -152,7 +153,7 @@ def __init__(
152153 spec : EnvSpecBase ,
153154 within : Optional ["EnvBase" ],
154155 settings : Optional [SoftwareDeploymentSettingsBase ],
155- shell_executable : str ,
156+ shell_executable : List [ str ] ,
156157 tempdir : Path ,
157158 cache_prefix : Path ,
158159 deployment_prefix : Path ,
@@ -161,7 +162,7 @@ def __init__(
161162 self .spec : EnvSpecBase = spec
162163 self .within : Optional ["EnvBase" ] = within
163164 self .settings : Optional [SoftwareDeploymentSettingsBase ] = settings
164- self .shell_executable : str = shell_executable
165+ self .shell_executable = shell_executable
165166 self .tempdir = tempdir
166167 self ._deployment_prefix : Path = deployment_prefix
167168 self ._cache_prefix : Path = cache_prefix
@@ -236,9 +237,10 @@ def run_cmd(self, cmd: str, **kwargs) -> sp.CompletedProcess:
236237
237238 kwargs is passed to subprocess.run, shell=True is always set.
238239 """
240+ assert "shell" not in kwargs , "shell argument has to be set to False"
239241 if self .within is not None :
240242 cmd = self .within .managed_decorate_shellcmd (cmd )
241- return sp .run (cmd , shell = True , executable = self .shell_executable , ** kwargs )
243+ return sp .run (self .shell_executable + [ cmd ] , ** kwargs )
242244
243245 def managed_decorate_shellcmd (self , cmd : str ) -> str :
244246 cmd = self .decorate_shellcmd (cmd )
0 commit comments