Skip to content

Commit

Permalink
feature: add stream_type to RUN command like in EXEC (#225)
Browse files Browse the repository at this point in the history
* feature: add stream_type to RUN command like in EXEC
  • Loading branch information
pustoshilov-d authored Sep 15, 2024
1 parent 2b22233 commit 14a020c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The client here will eventually be released as "spython" (and eventually to
singularity on pypi), and the versions here will coincide with these releases.

## [master](https://github.com/singularityhub/singularity-cli/tree/master)
- add stream_type to 'run' command like in 'exec' (0.3.14)
- do not modify user provided instance name when generating new instance (0.3.13)
- bug with instance.run_command (0.3.12)
- added check to enbsure stderr exists upon a non-zero return code when streaming (0.3.11)
Expand Down
4 changes: 3 additions & 1 deletion spython/main/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def run(
return_result=False,
quiet=False,
background=False,
stream_type="stdout",
):
"""
run will run the container, with or withour arguments (which
Expand All @@ -49,6 +50,7 @@ def run(
return_result: if True, return entire json object with return code
and message result (default is False)
quiet: print the command to the user
stream_type: Sets which output stream from the singularity command should be return. Values are 'stdout', 'stderr', 'both'.
"""
from spython.utils import check_install

Expand Down Expand Up @@ -107,7 +109,7 @@ def run(
elif not stream:
result = self._run_command(cmd, sudo=sudo, return_result=return_result)
else:
return stream_command(cmd, sudo=sudo)
return stream_command(cmd, sudo=sudo, output_type=stream_type)

# If the user wants the raw result object
if return_result:
Expand Down
2 changes: 1 addition & 1 deletion spython/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


__version__ = "0.3.13"
__version__ = "0.3.14"
AUTHOR = "Vanessa Sochat"
AUTHOR_EMAIL = "[email protected]"
NAME = "spython"
Expand Down

0 comments on commit 14a020c

Please sign in to comment.