Skip to content

Commit 14a020c

Browse files
feature: add stream_type to RUN command like in EXEC (#225)
* feature: add stream_type to RUN command like in EXEC
1 parent 2b22233 commit 14a020c

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The client here will eventually be released as "spython" (and eventually to
1717
singularity on pypi), and the versions here will coincide with these releases.
1818

1919
## [master](https://github.com/singularityhub/singularity-cli/tree/master)
20+
- add stream_type to 'run' command like in 'exec' (0.3.14)
2021
- do not modify user provided instance name when generating new instance (0.3.13)
2122
- bug with instance.run_command (0.3.12)
2223
- added check to enbsure stderr exists upon a non-zero return code when streaming (0.3.11)

spython/main/run.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def run(
2626
return_result=False,
2727
quiet=False,
2828
background=False,
29+
stream_type="stdout",
2930
):
3031
"""
3132
run will run the container, with or withour arguments (which
@@ -49,6 +50,7 @@ def run(
4950
return_result: if True, return entire json object with return code
5051
and message result (default is False)
5152
quiet: print the command to the user
53+
stream_type: Sets which output stream from the singularity command should be return. Values are 'stdout', 'stderr', 'both'.
5254
"""
5355
from spython.utils import check_install
5456

@@ -107,7 +109,7 @@ def run(
107109
elif not stream:
108110
result = self._run_command(cmd, sudo=sudo, return_result=return_result)
109111
else:
110-
return stream_command(cmd, sudo=sudo)
112+
return stream_command(cmd, sudo=sudo, output_type=stream_type)
111113

112114
# If the user wants the raw result object
113115
if return_result:

spython/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
66

77

8-
__version__ = "0.3.13"
8+
__version__ = "0.3.14"
99
AUTHOR = "Vanessa Sochat"
1010
AUTHOR_EMAIL = "[email protected]"
1111
NAME = "spython"

0 commit comments

Comments
 (0)