Skip to content

Commit

Permalink
Autocompletion - update python helper scripts to pull in cwl-ica module
Browse files Browse the repository at this point in the history
  • Loading branch information
alexiswl committed Jan 29, 2024
1 parent b3da1c6 commit dce52da
Show file tree
Hide file tree
Showing 23 changed files with 817 additions and 371 deletions.
522 changes: 365 additions & 157 deletions autocompletion/bash/cwl-ica.bash

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions autocompletion/helpers/_cwl-ica_list_all_expression_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
List the unregistered expression paths
"""

from utils.repo import get_expression_yaml_path
from utils.repo import get_expressions_dir
from utils.miscell import read_yaml
# Externals
from pathlib import Path
from os import getcwd
from os.path import relpath

# CWL ICA
from cwl_ica.utils.repo import get_expression_yaml_path
from cwl_ica.utils.repo import get_expressions_dir
from cwl_ica.utils.miscell import read_yaml

# Get the current word value
if not "${CURRENT_WORD}" == "":
current_word_value = "${CURRENT_WORD}"
Expand Down
7 changes: 4 additions & 3 deletions autocompletion/helpers/_cwl-ica_list_all_schema_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
List the unregistered schema paths
"""

from utils.repo import get_schema_yaml_path
from utils.repo import get_schemas_dir
from utils.miscell import read_yaml
# Externals
from pathlib import Path
from os import getcwd
from os.path import relpath

# CWL ICA
from cwl_ica.utils.repo import get_schemas_dir

# Get the current word value
if not "${CURRENT_WORD-}" == "":
current_word_value = "${CURRENT_WORD}"
Expand Down
7 changes: 4 additions & 3 deletions autocompletion/helpers/_cwl-ica_list_all_tool_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
List the unregistered tool paths
"""

from utils.repo import get_tool_yaml_path
from utils.repo import get_tools_dir
from utils.miscell import read_yaml
# Externals
from pathlib import Path
from os import getcwd
from os.path import relpath

# CWL ICA
from cwl_ica.utils.repo import get_tools_dir

# Get the current word value
if not "${CURRENT_WORD}" == "":
current_word_value = "${CURRENT_WORD}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
List all the typescript expression paths
"""

from utils.repo import get_expression_yaml_path
from utils.repo import get_cwl_ica_repo_path
from utils.miscell import read_yaml
# Externals
from pathlib import Path
from os import getcwd
from os.path import relpath

# CWL ICA
from cwl_ica.utils.repo import get_cwl_ica_repo_path

# Get the current word value
if not "${CURRENT_WORD}" == "":
current_word_value = "${CURRENT_WORD}"
Expand Down
7 changes: 4 additions & 3 deletions autocompletion/helpers/_cwl-ica_list_all_workflow_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
List the unregistered workflow paths
"""

from utils.repo import get_workflow_yaml_path
from utils.repo import get_workflows_dir
from utils.miscell import read_yaml
# Externals
from pathlib import Path
from os import getcwd
from os.path import relpath

# CWL ICA
from cwl_ica.utils.repo import get_workflows_dir

# Get the current word value
if not "${CURRENT_WORD}" == "":
current_word_value = "${CURRENT_WORD}"
Expand Down
4 changes: 2 additions & 2 deletions autocompletion/helpers/_cwl-ica_list_category_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"""
List all of the category names in the categories.yaml file
"""
from utils.repo import get_category_yaml_path
from utils.miscell import read_yaml
from cwl_ica.utils.repo import get_category_yaml_path
from cwl_ica.utils.miscell import read_yaml

# Import yaml and print each project name
for category in read_yaml(get_category_yaml_path())["categories"]:
Expand Down
4 changes: 2 additions & 2 deletions autocompletion/helpers/_cwl-ica_list_project_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"""
List all of the project names in the project.yaml file
"""
from utils.repo import get_project_yaml_path
from utils.miscell import read_yaml
from cwl_ica.utils.repo import get_project_yaml_path
from cwl_ica.utils.miscell import read_yaml

# Import yaml and print each project name
for project in read_yaml(get_project_yaml_path())["projects"]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
List the registered expression paths
"""

from utils.repo import get_expression_yaml_path
from utils.repo import get_expressions_dir
from utils.miscell import read_yaml
# Externals
from pathlib import Path
from os import getcwd
from os.path import relpath

# CWL ICA
from cwl_ica.utils.repo import get_expression_yaml_path, read_yaml, get_expressions_dir

expression_paths = [
Path(expression["path"]) / Path(version["path"])
for expression in read_yaml(get_expression_yaml_path())["expressions"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
List the registered schema paths
"""

from utils.repo import get_schema_yaml_path
from utils.repo import get_schemas_dir
from utils.miscell import read_yaml
# Externals
from pathlib import Path
from os import getcwd
from os.path import relpath

# CWL ICA
from cwl_ica.utils.repo import read_yaml, get_schema_yaml_path, get_schemas_dir

schema_paths = [
Path(schema["path"]) / Path(version["path"])
for schema in read_yaml(get_schema_yaml_path())["schemas"]
Expand Down
9 changes: 6 additions & 3 deletions autocompletion/helpers/_cwl-ica_list_registered_tool_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
List the registered tool paths
"""

from utils.repo import get_tool_yaml_path
from utils.repo import get_tools_dir
from utils.miscell import read_yaml
# External imports
from pathlib import Path
from os import getcwd
from os.path import relpath

# CWL ICA
from cwl_ica.utils.repo import get_tool_yaml_path
from cwl_ica.utils.repo import get_tools_dir
from cwl_ica.utils.miscell import read_yaml

tool_paths = [
Path(tool["path"]) / Path(version["path"])
for tool in read_yaml(get_tool_yaml_path())["tools"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
List the registered workflow paths
"""

from utils.repo import get_workflow_yaml_path
from utils.repo import get_workflows_dir
from utils.miscell import read_yaml
# External imports
from pathlib import Path
from os import getcwd
from os.path import relpath

# CWL ICA
from cwl_ica.utils.repo import get_workflow_yaml_path
from cwl_ica.utils.repo import get_workflows_dir
from cwl_ica.utils.miscell import read_yaml

workflow_paths = [
Path(workflow["path"]) / Path(version["path"])
for workflow in read_yaml(get_workflow_yaml_path())["workflows"]
Expand Down
5 changes: 3 additions & 2 deletions autocompletion/helpers/_cwl-ica_list_run_instance_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"""
List all of the run instance ids in the run.yaml file
"""
from utils.repo import get_run_yaml_path
from utils.miscell import read_yaml
# CWL ICA imports
from cwl_ica.utils.repo import get_run_yaml_path
from cwl_ica.utils.miscell import read_yaml

# Import yaml and print each run instance id
for run in read_yaml(get_run_yaml_path())["runs"]:
Expand Down
5 changes: 3 additions & 2 deletions autocompletion/helpers/_cwl-ica_list_tenant_names.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python

from utils.repo import get_tenant_yaml_path
from utils.miscell import read_yaml
# CWL ICA imports
from cwl_ica.utils.repo import get_tenant_yaml_path
from cwl_ica.utils.miscell import read_yaml

for tenant in read_yaml(get_tenant_yaml_path())["tenants"]:
print(tenant["tenant_name"])
5 changes: 3 additions & 2 deletions autocompletion/helpers/_cwl-ica_list_tool_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"""
List all of the category names in the categories.yaml file
"""
from utils.repo import get_tool_yaml_path
from utils.miscell import read_yaml
# CWL ICA imports
from cwl_ica.utils.repo import get_tool_yaml_path
from cwl_ica.utils.miscell import read_yaml

# Import yaml and print each tool name
for tool in read_yaml(get_tool_yaml_path())["tools"]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
List the unregistered expression paths
"""

from utils.repo import get_expression_yaml_path
from utils.repo import get_expressions_dir
from utils.miscell import read_yaml
# External
from pathlib import Path
from os import getcwd
from os.path import relpath

# CWL ICA imports
from cwl_ica.utils.repo import get_expression_yaml_path
from cwl_ica.utils.repo import get_expressions_dir
from cwl_ica.utils.miscell import read_yaml

registered_expression_paths = [
Path(expression["path"]) / Path(version["path"])
for expression in read_yaml(get_expression_yaml_path())["expressions"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
List the unregistered schema paths
"""

from utils.repo import get_schema_yaml_path
from utils.repo import get_schemas_dir
from utils.miscell import read_yaml
# External imports
from pathlib import Path
from os import getcwd
from os.path import relpath

# CWL ICA imports
from cwl_ica.utils.repo import get_schema_yaml_path
from cwl_ica.utils.repo import get_schemas_dir
from cwl_ica.utils.miscell import read_yaml


registered_schema_paths = [
Path(schema["path"]) / Path(version["path"])
for schema in read_yaml(get_schema_yaml_path())["schemas"]
Expand Down
10 changes: 7 additions & 3 deletions autocompletion/helpers/_cwl-ica_list_unregistered_tool_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
List the unregistered tool paths
"""

from utils.repo import get_tool_yaml_path
from utils.repo import get_tools_dir
from utils.miscell import read_yaml
# External imports
from pathlib import Path
from os import getcwd
from os.path import relpath

# CWL ICA imports
from cwl_ica.utils.repo import get_tool_yaml_path
from cwl_ica.utils.repo import get_tools_dir
from cwl_ica.utils.miscell import read_yaml


registered_tool_paths = [
Path(tool["path"]) / Path(version["path"])
for tool in read_yaml(get_tool_yaml_path())["tools"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
List the unregistered workflow paths
"""

from utils.repo import get_workflow_yaml_path
from utils.repo import get_workflows_dir
from utils.miscell import read_yaml
# External imports
from pathlib import Path
from os import getcwd
from os.path import relpath

# CWL ICA imports
from cwl_ica.utils.repo import get_workflow_yaml_path
from cwl_ica.utils.repo import get_workflows_dir
from cwl_ica.utils.miscell import read_yaml


registered_workflow_paths = [
Path(workflow["path"]) / Path(version["path"])
for workflow in read_yaml(get_workflow_yaml_path())["workflows"]
Expand Down
5 changes: 3 additions & 2 deletions autocompletion/helpers/_cwl-ica_list_user_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"""
List all of the category names in the categories.yaml file
"""
from utils.repo import get_user_yaml_path
from utils.miscell import read_yaml
# CWL ICA imports
from cwl_ica.utils.repo import get_user_yaml_path
from cwl_ica.utils.miscell import read_yaml

# Import yaml and print each project name
for user in read_yaml(get_user_yaml_path())["users"]:
Expand Down
5 changes: 3 additions & 2 deletions autocompletion/helpers/_cwl-ica_list_workflow_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"""
List all of the category names in the categories.yaml file
"""
from utils.repo import get_workflow_yaml_path
from utils.miscell import read_yaml
# CWL ICA imports
from cwl_ica.utils.repo import get_workflow_yaml_path
from cwl_ica.utils.miscell import read_yaml

# Import yaml and print each tool name
for workflow in read_yaml(get_workflow_yaml_path())["workflows"]:
Expand Down
6 changes: 2 additions & 4 deletions autocompletion/run-autocompletion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ for template in templates/*.evalyaml; do
docker run \
--volume "$PWD:$PWD" \
--workdir "$PWD" \
ghcr.io/umccr/appspec:0.006 \
appspec \
ghcr.io/alexiswl/app-appspec-p5:v0.007-rc \
completion \
"${template}" \
--name "${name_root}" \
Expand All @@ -78,8 +77,7 @@ for template in templates/*.evalyaml; do
docker run \
--volume "$PWD:$PWD" \
--workdir "$PWD" \
ghcr.io/umccr/appspec:0.006 \
appspec \
ghcr.io/alexiswl/app-appspec-p5:v0.007-rc \
completion \
"${template}" \
--name "${name_root}" \
Expand Down
Loading

0 comments on commit dce52da

Please sign in to comment.