Skip to content

Commit 2de1107

Browse files
author
Vasu Jaganath
committed
remove args in rest api, removing args 3/n
1 parent 98e64c6 commit 2de1107

File tree

3 files changed

+29
-32
lines changed

3 files changed

+29
-32
lines changed

src/sophios/apis/rest/api.py

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pathlib import Path
2-
import argparse
2+
# import argparse
33
import copy
44
import yaml
55

@@ -41,31 +41,31 @@ def remove_dot_dollar(tree: Cwl) -> Cwl:
4141
return tree_no_dd
4242

4343

44-
def run_workflow(compiler_info: CompilerInfo, args: argparse.Namespace) -> int:
45-
"""
46-
Get the Sophios yaml tree from incoming JSON
47-
Args:
48-
req (JSON): A raw JSON content of incoming JSON object
49-
Returns:
50-
Cwl: A Cwl document with . and $ removed from $namespaces and $schemas
51-
"""
52-
# ========= WRITE OUT =======================
53-
basepath = 'autogenerated'
54-
input_output.write_to_disk(compiler_info.rose, Path(basepath), relative_run_path=True)
55-
# ======== TEST RUN =========================
56-
# verify container_engine install and config
57-
verify_container_engine_config(args.container_engine, args.ignore_docker_install)
58-
run_args_dict = {}
59-
run_args_dict['container_engine'] = args.container_engine
60-
run_args_dict['cwl_runner'] = args.cwl_runner
61-
run_args_dict['copy_output_files'] = str(args.copy_output_files)
62-
rose_tree = compiler_info.rose
63-
retval = run_local.run_local(run_args_dict, False, passthrough_args=[],
64-
workflow_name=rose_tree.data.name, basepath=basepath)
65-
retval_local = 1
66-
if retval:
67-
retval_local = retval
68-
return retval_local
44+
# def run_workflow(compiler_info: CompilerInfo, args: argparse.Namespace) -> int:
45+
# """
46+
# Get the Sophios yaml tree from incoming JSON
47+
# Args:
48+
# req (JSON): A raw JSON content of incoming JSON object
49+
# Returns:
50+
# Cwl: A Cwl document with . and $ removed from $namespaces and $schemas
51+
# """
52+
# # ========= WRITE OUT =======================
53+
# basepath = 'autogenerated'
54+
# input_output.write_to_disk(compiler_info.rose, Path(basepath), relative_run_path=True)
55+
# # ======== TEST RUN =========================
56+
# # verify container_engine install and config
57+
# verify_container_engine_config(args.container_engine, args.ignore_docker_install)
58+
# run_args_dict = {}
59+
# run_args_dict['container_engine'] = args.container_engine
60+
# run_args_dict['cwl_runner'] = args.cwl_runner
61+
# run_args_dict['copy_output_files'] = str(args.copy_output_files)
62+
# rose_tree = compiler_info.rose
63+
# retval = run_local.run_local(run_args_dict, False, passthrough_args=[],
64+
# workflow_name=rose_tree.data.name, basepath=basepath)
65+
# retval_local = 1
66+
# if retval:
67+
# retval_local = retval
68+
# return retval_local
6969

7070

7171
app = FastAPI()

src/sophios/compiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ def compile_workflow_once(yaml_tree_ast: YamlTree,
320320
# Use auto-discovery mechanism (with run tag)
321321
tool_i = tools[stepid_runtag]
322322
else:
323-
msg = f"Error! Neither {stepid.stem} nor {
324-
stepid_runtag.stem} found!, check your 'search_paths_cwl' in global_config.json"
323+
msg = f"Error! Neither {stepid.stem} nor {stepid_runtag.stem} found!"
324+
msg += "check your 'search_paths_cwl' in global_config.json"
325325
raise Exception(msg)
326326
# Programmatically modify tool_i here
327327
graph_dummy = graph # Just use anything here to satisfy mypy

tests/test_rest_core.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from pathlib import Path
44
import asyncio
55
import subprocess as sub
6-
import sys
76
import traceback
87
import yaml
98

@@ -91,9 +90,7 @@ def run_cwl_local(workflow_name: str, cwl_runner: str, docker_cmd: str, use_subp
9190
print(f'See error_{workflow_name}.txt for detailed technical information.')
9291
# Do not display a nasty stack trace to the user; hide it in a file.
9392
with open(f'error_{workflow_name}.txt', mode='w', encoding='utf-8') as f:
94-
# https://mypy.readthedocs.io/en/stable/common_issues.html#python-version-and-system-platform-checks
95-
if sys.version_info >= (3, 10):
96-
traceback.print_exception(type(e), value=e, tb=None, file=f)
93+
traceback.print_exception(type(e), value=e, tb=None, file=f)
9794
print(e) # we are always running this on CI
9895
return retval
9996

0 commit comments

Comments
 (0)