Skip to content

Commit

Permalink
BUG: fix slow return speed for help text
Browse files Browse the repository at this point in the history
  • Loading branch information
ebolyen committed Dec 18, 2024
1 parent 0ac7869 commit f63a881
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions q2cli/click/type.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

import click

from qiime2.core.type.util import is_collection_type


def is_writable_dir(path):
import os
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions q2cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions q2cli/core/artifact_cache_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
1 change: 1 addition & 0 deletions q2cli/core/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def get_action_state(action):
state = {
'id': action.id,
'name': action.name,
'type': action.type,
'description': action.description,
'signature': [],
'epilog': [],
Expand Down

0 comments on commit f63a881

Please sign in to comment.