Skip to content

Commit 3a885ab

Browse files
tjgalvinTim Galvin
andauthored
Expose the output_type option when streaming, and allow both stdout/stderr to be captured (#209)
* allow both output stdout stderr to be emitted. Expose option to allow capture * updated changelog, version bump, error message * added a basic stream test * linting and pin black to 23.3.0 Signed-off-by: vsoch <[email protected]> Co-authored-by: tgalvin <[email protected]> Co-authored-by: Tim Galvin <[email protected]>
1 parent a220599 commit 3a885ab

27 files changed

+34
-55
lines changed

.github/dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
pre-commit
2-
black
2+
black==23.3.0
33
isort
44
flake8

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+
- exposed the stream type option, and ability to capture both stdout and stderr when stream=True (0.3.1)
2021
- dropping support for Singularity 2.x (0.3.0)
2122
- add comment out of STOPSIGNAL (0.2.14)
2223
- sudo `-E` flag should not be provided by default (0.2.13)

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ def get_requirements(lookup=None):
7575

7676

7777
if __name__ == "__main__":
78-
7978
INSTALL_REQUIRES = get_requirements(lookup)
8079
TESTS_REQUIRES = get_requirements(lookup)
8180

spython/client/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414

1515
def get_parser():
16-
1716
parser = argparse.ArgumentParser(
1817
description="Singularity Client",
1918
formatter_class=argparse.RawTextHelpFormatter,
@@ -147,7 +146,6 @@ def version():
147146

148147

149148
def main():
150-
151149
parser = get_parser()
152150

153151
def print_help(return_code=0):

spython/client/recipe.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def main(args, options, parser):
7474
force = True
7575

7676
if args.json:
77-
7877
if outfile is not None:
7978
if not os.path.exists(outfile):
8079
if force:
@@ -85,7 +84,6 @@ def main(args, options, parser):
8584
print(json.dumps(recipeParser.recipe.json(), indent=4))
8685

8786
else:
88-
8987
# Do the conversion
9088
recipeWriter = writer(recipeParser.recipe)
9189
result = recipeWriter.convert(runscript=entrypoint, force=force)

spython/instance/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ def _update_metadata(self, kwargs=None):
9393

9494
# Add acceptable arguments
9595
for arg in ["pid", "name", "ip_address", "log_err_path", "log_out_path", "img"]:
96-
9796
# Skip over non-iterables:
9897
if arg in kwargs:
9998
setattr(self, arg, kwargs[arg])

spython/instance/cmd/start.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def start(
4949

5050
# If an image isn't provided, we have an initialized instance
5151
if image is None:
52-
5352
# Not having this means it was called as a command, without an image
5453
if not hasattr(self, "_image"):
5554
bot.exit("Please provide an image, or create an Instance first.")

spython/main/base/command.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def generate_bind_list(self, bindlist=None):
6666
bindlist = bindlist.split(" ")
6767

6868
for bind in bindlist:
69-
7069
# Still cannot be None
7170
if bind:
7271
bot.debug("Adding bind %s" % bind)
@@ -113,7 +112,6 @@ def run_command(
113112
environ=None,
114113
background=False,
115114
):
116-
117115
"""
118116
Run_command is a wrapper for the global run_command, checking first
119117
for sudo and exiting on error if needed. The message is returned as

spython/main/base/generate.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212

1313
class RobotNamer:
14-
1514
_descriptors = [
1615
"chunky",
1716
"buttery",

spython/main/build.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def build(
3131
sudo_options=None,
3232
singularity_options=None,
3333
):
34-
3534
"""build a singularity image, optionally for an isolated build
3635
(requires sudo). If you specify to stream, expect the image name
3736
and an iterator to be returned.

0 commit comments

Comments
 (0)