Skip to content

Fix typos and wrong pip version range #147

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

Merged
merged 2 commits into from
Aug 24, 2022
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
4 changes: 2 additions & 2 deletions cwl_utils/cwl_expression_refactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __call__(


def arg_parser() -> argparse.ArgumentParser:
"""Build the arrgument parser."""
"""Build the argument parser."""
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏴‍☠️

parser = argparse.ArgumentParser(
description="Tool to refactor CWL documents so that any CWL expression "
"are separate steps as either ExpressionTools or CommandLineTools. Exit code 7 "
Expand Down Expand Up @@ -154,7 +154,7 @@ def run(args: argparse.Namespace) -> int:
for result_item in result
]
yaml.scalarstring.walk_tree(result_json)
# ^ converts multine line strings to nice multiline YAML
# ^ converts multiline strings to nice multiline YAML
with open(output, "w", encoding="utf-8") as output_filehandle:
output_filehandle.write(
"#!/usr/bin/env cwl-runner\n"
Expand Down
10 changes: 5 additions & 5 deletions cwl_utils/cwl_v1_0_expression_refactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def traverse(
skip_command_line1: bool,
skip_command_line2: bool,
) -> Tuple[Union[cwl.CommandLineTool, cwl.ExpressionTool, cwl.Workflow], bool]:
"""Convert the given process and any subprocesess."""
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were typos in the cwl files under the parser package, but there's a note at the top of those files saying they are auto-generated (i.e. better fix the typos at the source, if not already fixed). I noticed these other *expression_refactor files have similar typos, but not sure if these are also auto-generated? Happy to remove them from the PR if needed 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expression refactor files are not autogenerated. So typo fixes are appreciated, thanks!

"""Convert the given process and any subprocesses."""
if not inside and isinstance(process, cwl.CommandLineTool):
process = expand_stream_shortcuts(process)
wf_inputs = []
Expand Down Expand Up @@ -1488,7 +1488,7 @@ def traverse_CommandLineTool(
)
new_clt_step = copy.copy(
step
) # a deepcopy would be convienant, but params2.cwl gives it problems
) # a deepcopy would be convenient, but params2.cwl gives it problems
new_clt_step.id = cast(str, new_clt_step.id).split("#")[-1]
new_clt_step.run = copy.copy(step.run)
new_clt_step.run.id = None
Expand All @@ -1515,7 +1515,7 @@ def traverse_CommandLineTool(
)
else:
raise Exception(
"Unimplemented OutputParamter type: %s",
"Unimplemented OutputParameter type: %s",
type(new_outp),
)
new_clt_step.in_ = copy.deepcopy(step.in_)
Expand Down Expand Up @@ -1595,7 +1595,7 @@ def remove_JSReq(
process: Union[cwl.CommandLineTool, cwl.WorkflowStep, cwl.Workflow],
skip_command_line1: bool,
) -> None:
"""Since the InlineJavascriptRequiment is longer needed, remove it."""
"""Since the InlineJavascriptRequirement is longer needed, remove it."""
if skip_command_line1 and isinstance(process, cwl.CommandLineTool):
return
if process.hints:
Expand Down Expand Up @@ -1958,7 +1958,7 @@ def traverse_step(
def workflow_step_to_InputParameters(
step_ins: List[cwl.WorkflowStepInput], parent: cwl.Workflow, except_in_id: str
) -> List[cwl.InputParameter]:
"""Create InputParametes to match the given WorkflowStep inputs."""
"""Create InputParameters to match the given WorkflowStep inputs."""
params = []
for inp in step_ins:
if not inp.id:
Expand Down
10 changes: 5 additions & 5 deletions cwl_utils/cwl_v1_1_expression_refactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def traverse(
skip_command_line1: bool,
skip_command_line2: bool,
) -> Tuple[Union[cwl.CommandLineTool, cwl.ExpressionTool, cwl.Workflow], bool]:
"""Convert the given process and any subprocesess."""
"""Convert the given process and any subprocesses."""
if not inside and isinstance(process, cwl.CommandLineTool):
process = expand_stream_shortcuts(process)
wf_inputs = []
Expand Down Expand Up @@ -1488,7 +1488,7 @@ def traverse_CommandLineTool(
)
new_clt_step = copy.copy(
step
) # a deepcopy would be convienant, but params2.cwl gives it problems
) # a deepcopy would be convenient, but params2.cwl gives it problems
new_clt_step.id = cast(str, new_clt_step.id).split("#")[-1]
new_clt_step.run = copy.copy(step.run)
new_clt_step.run.id = None
Expand All @@ -1515,7 +1515,7 @@ def traverse_CommandLineTool(
)
else:
raise Exception(
"Unimplemented OutputParamter type: %s",
"Unimplemented OutputParameter type: %s",
type(new_outp),
)
new_clt_step.in_ = copy.deepcopy(step.in_)
Expand Down Expand Up @@ -1595,7 +1595,7 @@ def remove_JSReq(
process: Union[cwl.CommandLineTool, cwl.WorkflowStep, cwl.Workflow],
skip_command_line1: bool,
) -> None:
"""Since the InlineJavascriptRequiment is longer needed, remove it."""
"""Since the InlineJavascriptRequirement is longer needed, remove it."""
if skip_command_line1 and isinstance(process, cwl.CommandLineTool):
return
if process.hints:
Expand Down Expand Up @@ -1958,7 +1958,7 @@ def traverse_step(
def workflow_step_to_WorkflowInputParameters(
step_ins: List[cwl.WorkflowStepInput], parent: cwl.Workflow, except_in_id: str
) -> List[cwl.WorkflowInputParameter]:
"""Create WorkflowInputParametes to match the given WorkflowStep inputs."""
"""Create WorkflowInputParameters to match the given WorkflowStep inputs."""
params = []
for inp in step_ins:
if not inp.id:
Expand Down
10 changes: 5 additions & 5 deletions cwl_utils/cwl_v1_2_expression_refactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def traverse(
skip_command_line1: bool,
skip_command_line2: bool,
) -> Tuple[Union[cwl.CommandLineTool, cwl.ExpressionTool, cwl.Workflow], bool]:
"""Convert the given process and any subprocesess."""
"""Convert the given process and any subprocesses."""
if not inside and isinstance(process, cwl.CommandLineTool):
process = expand_stream_shortcuts(process)
wf_inputs = []
Expand Down Expand Up @@ -1584,7 +1584,7 @@ def traverse_CommandLineTool(
)
new_clt_step = copy.copy(
step
) # a deepcopy would be convienant, but params2.cwl gives it problems
) # a deepcopy would be convenient, but params2.cwl gives it problems
new_clt_step.id = cast(str, new_clt_step.id).split("#")[-1]
new_clt_step.run = copy.copy(step.run)
new_clt_step.run.id = None
Expand All @@ -1611,7 +1611,7 @@ def traverse_CommandLineTool(
)
else:
raise Exception(
"Unimplemented OutputParamter type: %s",
"Unimplemented OutputParameter type: %s",
type(new_outp),
)
new_clt_step.in_ = copy.deepcopy(step.in_)
Expand Down Expand Up @@ -1691,7 +1691,7 @@ def remove_JSReq(
process: Union[cwl.CommandLineTool, cwl.WorkflowStep, cwl.Workflow],
skip_command_line1: bool,
) -> None:
"""Since the InlineJavascriptRequiment is longer needed, remove it."""
"""Since the InlineJavascriptRequirement is longer needed, remove it."""
if skip_command_line1 and isinstance(process, cwl.CommandLineTool):
return
if process.hints:
Expand Down Expand Up @@ -2062,7 +2062,7 @@ def traverse_step(
def workflow_step_to_WorkflowInputParameters(
step_ins: List[cwl.WorkflowStepInput], parent: cwl.Workflow, except_in_id: str
) -> List[cwl.WorkflowInputParameter]:
"""Create WorkflowInputParametes to match the given WorkflowStep inputs."""
"""Create WorkflowInputParameters to match the given WorkflowStep inputs."""
params = []
for inp in step_ins:
if not inp.id:
Expand Down
2 changes: 1 addition & 1 deletion cwl_utils/docker_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def main(args: argparse.Namespace) -> None:
def extract_docker_requirements(
process: ProcessType,
) -> Iterator[cwl.DockerRequirement]:
"""Yield an iterator of the docker reqs, normalizint the pull request."""
"""Yield an iterator of the docker reqs, normalizing the pull request."""
for req in extract_docker_reqs(process):
if isinstance(req.dockerPull, str) and ":" not in req.dockerPull:
req.dockerPull += ":latest"
Expand Down
6 changes: 3 additions & 3 deletions cwl_utils/pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,12 @@ def _add_req(_req_name: str) -> None:
requirements += [{"class": _req_name}]

if cwl.get("class") == "Workflow":
sub_worflow = False
sub_workflow = False
for step in cwl["steps"]:
if step["run"]["class"] == "Workflow":
sub_worflow = True
sub_workflow = True
break
if sub_worflow:
if sub_workflow:
_add_req("SubworkflowFeatureRequirement")
return cwl

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# -- Project information -----------------------------------------------------

project = 'cwl-utils'
copyright = '2019, CWL Commmunity'
author = 'CWL Commmunity'
copyright = '2019, CWL Community'
author = 'CWL Community'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what started this PR. Went to look at the Sphinx issue in #146 , and noticed the typo above. Then ran the Code Inspection in PyCharm to check for other typos.



# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion mypy-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mypy==0.971
typing_extensions
types-requests
types-setuptools>==57.4.0
types-setuptools>=57.4.0