Skip to content
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

Add type annotations to planemo.runnable and planemo.workflow_lint #1291

Merged
merged 4 commits into from Oct 13, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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