Skip to content

Commit

Permalink
Merge pull request #60 from kyleam/use-run-command
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleam committed May 28, 2019
2 parents 436219a + 571c203 commit 3be0805
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions datalad_container/containers_run.py
Expand Up @@ -15,6 +15,7 @@

from datalad.interface.results import get_status_dict
from datalad.interface.run import Run
from datalad.interface.run import run_command
from datalad.interface.run import get_command_pwds
from datalad.interface.run import normalize_command
from datalad_container.find_container import find_container
Expand Down Expand Up @@ -122,21 +123,17 @@ def __call__(cmd, container_name=None, dataset=None,
# just prepend and pray
cmd = container['path'] + ' ' + cmd

# with amend inputs to also include the container image
inputs = (inputs or []) + [image_path]

with patch.dict('os.environ',
{CONTAINER_NAME_ENVVAR: container['name']}):
# fire!
for r in Run.__call__(
for r in run_command(
cmd=cmd,
dataset=dataset or (ds if ds.path == pwd else None),
inputs=inputs,
extra_inputs=[image_path],
outputs=outputs,
message=message,
expand=expand,
explicit=explicit,
sidecar=sidecar,
on_failure="ignore",
return_type='generator'):
sidecar=sidecar):
yield r
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -59,7 +59,7 @@ def findsome(subdir, extensions):
packages=[pkg for pkg in find_packages('.') if pkg.startswith('datalad')],
# datalad command suite specs from here
install_requires=[
'datalad>=0.10.0',
'datalad>=0.11.5',
'requests>=1.2', # to talk to Singularity-hub
],
extras_require={
Expand Down

0 comments on commit 3be0805

Please sign in to comment.