Skip to content

Commit de311f3

Browse files
authored
Merge pull request #198 from singularityhub/add/mkdir-workdir
Add/mkdir workdir
2 parents 2807c03 + 2595d37 commit de311f3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+108
-73
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+
- WORKDIR should create container for Singularity converter (0.0.12)
2021
- support for background process with client run (0.2.11)
2122
- parser bugfixes, arg from Docker not properly parsed (0.2.1)
2223
- version checks removed to support Singularity 3.x and above (0.2.0)

spython/client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99

1010
import argparse
11-
import sys
1211
import os
12+
import sys
1313

1414

1515
def get_parser():

spython/client/recipe.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@
44
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
55
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
66

7-
from spython.main.parse.writers import get_writer
8-
from spython.main.parse.parsers import get_parser
7+
import json
8+
import os
9+
import sys
910

1011
from spython.logger import bot
12+
from spython.main.parse.parsers import get_parser
13+
from spython.main.parse.writers import get_writer
1114
from spython.utils import write_file, write_json
1215

13-
import json
14-
import sys
15-
import os
16-
1716

1817
def main(args, options, parser):
1918
"""This function serves as a wrapper around the DockerParser,

spython/client/shell.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ def prepare_client(image):
2727
"""prepare a client to embed in a shell with recipe parsers and writers."""
2828
# The client will announce itself (backend/database) unless it's get
2929
from spython.main import get_client
30-
from spython.main.parse import parsers
31-
from spython.main.parse import writers
30+
from spython.main.parse import parsers, writers
3231

3332
client = get_client()
3433

spython/image.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import hashlib
88
import os
9+
910
from spython.logger import bot
1011
from spython.utils import split_uri
1112

spython/instance/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
55
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
66

7-
from spython.utils.fileio import read_file
8-
from spython.image import ImageBase
97
import os
108

9+
from spython.image import ImageBase
10+
from spython.utils.fileio import read_file
11+
1112

1213
class Instance(ImageBase):
1314
def __init__(self, image, start=True, name=None, quiet=True, **kwargs):

spython/instance/cmd/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ def generate_instance_commands():
1313
"""
1414
from spython.instance import Instance
1515

16+
# run_command uses run_cmd, but wraps to catch error
17+
from spython.main.base.command import init_command, run_command
18+
from spython.main.base.generate import RobotNamer
1619
from spython.main.base.logger import println
1720
from spython.main.instances import list_instances
1821
from spython.utils import run_command as run_cmd
1922

20-
# run_command uses run_cmd, but wraps to catch error
21-
from spython.main.base.command import init_command, run_command
22-
from spython.main.base.generate import RobotNamer
23+
from .logs import _logs, error_logs, output_logs
2324
from .start import start
2425
from .stop import stop
25-
from .logs import error_logs, output_logs, _logs
2626

2727
Instance.RobotNamer = RobotNamer()
2828
Instance._init_command = init_command

spython/instance/cmd/logs.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
66

77

8-
from spython.utils import get_userhome, get_username
9-
from spython.logger import bot
10-
import platform
118
import os
9+
import platform
10+
11+
from spython.logger import bot
12+
from spython.utils import get_userhome, get_username
1213

1314

1415
def error_logs(self, print_logs=False):

spython/instance/cmd/start.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def start(
3939
singularity [...] instance.start [...] <container path> <instance name>
4040
4141
"""
42-
from spython.utils import run_command, check_install
42+
from spython.utils import check_install, run_command
4343

4444
check_install()
4545

spython/logger/message.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66

77
import os
88
import sys
9-
from .spinner import Spinner
9+
1010
from spython.logger import decodeUtf8String
1111

12+
from .spinner import Spinner
13+
1214
ABORT = -5
1315
CRITICAL = -4
1416
ERROR = -3

0 commit comments

Comments
 (0)