diff --git a/q2cli/click/type.py b/q2cli/click/type.py index 6b9c5ca0..67e82162 100644 --- a/q2cli/click/type.py +++ b/q2cli/click/type.py @@ -8,8 +8,6 @@ import click -from qiime2.core.type.util import is_collection_type - def is_writable_dir(path): import os @@ -85,6 +83,7 @@ def convert(self, value, param, ctx): def _convert_output(self, value, param, ctx): import os from q2cli.util import output_in_cache + from qiime2.core.type.util import is_collection_type # Click path fails to validate writability on new paths # Check if our output path is actually in a cache and if it is skip our diff --git a/q2cli/commands.py b/q2cli/commands.py index 732104cc..590d19f4 100644 --- a/q2cli/commands.py +++ b/q2cli/commands.py @@ -271,8 +271,7 @@ def __init__(self, name, plugin, action): # If this action is a pipeline it needs additional options for # recycling and parallelization - action_obj = self._get_action() - if action_obj.type == 'pipeline': + if action['type'] == 'pipeline': self._misc.extend([ click.Option(['--recycle-pool'], required=False, type=str, diff --git a/q2cli/core/artifact_cache_global.py b/q2cli/core/artifact_cache_global.py index 10f6023d..f188e2cb 100644 --- a/q2cli/core/artifact_cache_global.py +++ b/q2cli/core/artifact_cache_global.py @@ -6,9 +6,6 @@ # The full license is in the file LICENSE, distributed with this software. # ---------------------------------------------------------------------------- -from qiime2.core.cache import Cache - - # Do not make this the default cache. If this is the default cache then we will # instantiate the default cache when the module is imported which will write a # process pool to the default cache which is undesirable if that isn't the @@ -33,6 +30,7 @@ def set_used_artifact_cache(args): Should only be called once to init the used cache for this invocation. """ + from qiime2.core.cache import Cache from q2cli.util import exit_with_error global _USED_ARTIFACT_CACHE @@ -78,4 +76,6 @@ def get_used_artifact_cache(): The default cache if the user didn't set a cache or the cache they set if they did set one. """ + from qiime2.core.cache import Cache + return Cache() if _USED_ARTIFACT_CACHE is None else _USED_ARTIFACT_CACHE diff --git a/q2cli/core/state.py b/q2cli/core/state.py index b2ad3f50..faaa11c1 100644 --- a/q2cli/core/state.py +++ b/q2cli/core/state.py @@ -36,6 +36,7 @@ def get_action_state(action): state = { 'id': action.id, 'name': action.name, + 'type': action.type, 'description': action.description, 'signature': [], 'epilog': [],