Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug with instance run command #214

Merged
merged 2 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
- 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)
- exposed the stream type option, and ability to capture both stdout and stderr when stream=True (0.3.1)
- dropping support for Singularity 2.x (0.3.0)
Expand Down
11 changes: 0 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
"""

Copyright (C) 2017-2021 Vanessa Sochat.

This Source Code Form is subject to the terms of the
Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

"""


import os

from setuptools import find_packages, setup
Expand Down
10 changes: 0 additions & 10 deletions spython/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
"""

Copyright (C) 2017-2022 Vanessa Sochat.

This Source Code Form is subject to the terms of the
Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

"""

from spython.version import __version__
3 changes: 1 addition & 2 deletions spython/client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/usr/bin/env python

# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


import argparse
import os
import sys
Expand Down
2 changes: 1 addition & 1 deletion spython/client/recipe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/client/shell.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/client/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
3 changes: 2 additions & 1 deletion spython/image.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


import hashlib
import os

Expand Down
2 changes: 1 addition & 1 deletion spython/instance/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
6 changes: 2 additions & 4 deletions spython/instance/cmd/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand All @@ -18,16 +18,14 @@ def generate_instance_commands():
from spython.main.base.generate import RobotNamer
from spython.main.base.logger import println
from spython.main.instances import list_instances
from spython.utils import run_command as run_cmd

from .logs import _logs, error_logs, output_logs
from .start import start
from .stop import stop

Instance.RobotNamer = RobotNamer()
Instance._init_command = init_command
Instance.run_command = run_cmd
Instance._run_command = run_command
Instance.run_command = run_command
Instance._list = list_instances # list command is used to get metadata
Instance._println = println
Instance.start = start # intended to be called on init, not by user
Expand Down
2 changes: 1 addition & 1 deletion spython/instance/cmd/logs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2019-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/instance/cmd/start.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/instance/cmd/stop.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/logger/compatibility.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
3 changes: 2 additions & 1 deletion spython/logger/message.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


import os
import sys

Expand Down
3 changes: 1 addition & 2 deletions spython/logger/spinner.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


import sys
import threading
import time
Expand Down
2 changes: 1 addition & 1 deletion spython/main/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/apps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/base/command.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
3 changes: 1 addition & 2 deletions spython/main/build.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


import os
import re

Expand Down
3 changes: 1 addition & 2 deletions spython/main/execute.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


import os
import shutil

Expand Down
3 changes: 1 addition & 2 deletions spython/main/export.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


import os

from spython.logger import bot
Expand Down
2 changes: 1 addition & 1 deletion spython/main/help.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
3 changes: 2 additions & 1 deletion spython/main/inspect.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


import json as jsonp

from spython.logger import bot
Expand Down
3 changes: 1 addition & 2 deletions spython/main/instances.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


import json

from spython.logger import bot
Expand Down
3 changes: 1 addition & 2 deletions spython/main/pull.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


import os
import re

Expand Down
3 changes: 1 addition & 2 deletions spython/main/run.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


import json

from spython.logger import bot
Expand Down
3 changes: 2 additions & 1 deletion spython/oci/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


from spython.image import ImageBase
from spython.logger import bot

Expand Down
2 changes: 1 addition & 1 deletion spython/tests/Xtest_oci.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

# Copyright (C) 2020-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/tests/test_base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
3 changes: 2 additions & 1 deletion spython/tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/python

# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


import os
import shutil
from subprocess import CalledProcessError
Expand Down
2 changes: 1 addition & 1 deletion spython/tests/test_conversion.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/tests/test_instances.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/tests/test_parsers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/tests/test_recipe.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

# Copyright (C) 2019-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/tests/test_writers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

# Copyright (C) 2019-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
12 changes: 4 additions & 8 deletions spython/utils/fileio.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
"""
# Copyright (C) 2017-2024 Vanessa Sochat.

# Copyright (C) 2017-2022 Vanessa Sochat.

This Source Code Form is subject to the terms of the
Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

"""
# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

import errno
import json
Expand Down
2 changes: 1 addition & 1 deletion spython/utils/misc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2019-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
4 changes: 2 additions & 2 deletions spython/version.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright (C) 2017-2022 Vanessa Sochat.
# Copyright (C) 2017-2024 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


__version__ = "0.3.11"
__version__ = "0.3.12"
AUTHOR = "Vanessa Sochat"
AUTHOR_EMAIL = "[email protected]"
NAME = "spython"
Expand Down