Skip to content

Commit

Permalink
Merge pull request #1291 from nsoranzo/type_annots
Browse files Browse the repository at this point in the history
Add type annotations to ``planemo.runnable`` and ``planemo.workflow_lint``
  • Loading branch information
mvdbeek committed Oct 13, 2022
2 parents a8b63ab + 75c7a00 commit a83301c
Show file tree
Hide file tree
Showing 6 changed files with 157 additions and 87 deletions.
6 changes: 1 addition & 5 deletions planemo/cli.py
Expand Up @@ -23,7 +23,6 @@
from planemo.exit_codes import ExitCodeException
from planemo.galaxy import profiles
from .config import OptionSource
from .io import error

CONTEXT_SETTINGS = dict(auto_envvar_prefix="PLANEMO")
COMMAND_ALIASES = {
Expand Down Expand Up @@ -71,13 +70,10 @@ def name_to_command(name: str) -> Command:
this method uses `__import__` to load and return that method.
"""
try:
if sys.version_info[0] == 2:
name = name.encode("ascii", "replace")
mod_name = "planemo.commands.cmd_" + name
mod = __import__(mod_name, None, None, ["cli"])
except ImportError as e:
error(f"Problem loading command {name}, exception {e}")
return
raise Exception(f"Problem loading command {name}, exception {e}")
return mod.cli


Expand Down
2 changes: 1 addition & 1 deletion planemo/cwl/run.py
Expand Up @@ -45,7 +45,7 @@ def __init__(
log: str,
outputs: Optional[Dict[str, Any]] = None,
) -> None:
self._runnable = runnable
super().__init__(runnable=runnable)
self._log = log
self._outputs = outputs

Expand Down
2 changes: 1 addition & 1 deletion planemo/galaxy/activity.py
Expand Up @@ -332,8 +332,8 @@ def __init__(
start_datetime=None,
end_datetime=None,
):
super().__init__(runnable=runnable)
self._ctx = ctx
self._runnable = runnable
self._user_gi = user_gi
self._history_id = history_id
self._log = log
Expand Down

0 comments on commit a83301c

Please sign in to comment.