mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 13:50:20 +08:00
style: apply isort/black (tox -e format)
This commit is contained in:
@@ -113,9 +113,7 @@ class DatabaseToolSourceStore(ToolSourceStore):
|
||||
def get(self, hash: str) -> StoredToolSource | None:
|
||||
"""Retrieve a tool source by hash."""
|
||||
with self._read_session() as session:
|
||||
model = session.execute(
|
||||
select(ToolSourceRecord).where(ToolSourceRecord.hash == hash)
|
||||
).scalar_one_or_none()
|
||||
model = session.execute(select(ToolSourceRecord).where(ToolSourceRecord.hash == hash)).scalar_one_or_none()
|
||||
if not model:
|
||||
return None
|
||||
return self._model_to_stored(model)
|
||||
|
||||
@@ -44,9 +44,19 @@ from typing import (
|
||||
cast,
|
||||
)
|
||||
|
||||
from kombu import Connection
|
||||
from kombu.pools import producers
|
||||
|
||||
from galaxy.config import GalaxyAppConfiguration
|
||||
from galaxy.datatypes.registry import Registry
|
||||
from galaxy.model import set_datatypes_registry
|
||||
from galaxy.model.mapping import init_models_from_config
|
||||
from galaxy.model.scoped_session import galaxy_scoped_session
|
||||
from galaxy.queues import galaxy_exchange
|
||||
from galaxy.tool_source_store import (
|
||||
_build_default_store,
|
||||
build_named_store,
|
||||
build_tool_source_store,
|
||||
ReadOnlyStoreError,
|
||||
StoredToolSource,
|
||||
ToolSourceStore,
|
||||
@@ -59,16 +69,6 @@ from galaxy.tool_source_store.index import (
|
||||
ToolIndex,
|
||||
ToolIndexEntry,
|
||||
)
|
||||
from kombu import Connection
|
||||
from kombu.pools import producers
|
||||
|
||||
from galaxy.config import GalaxyAppConfiguration
|
||||
from galaxy.datatypes.registry import Registry
|
||||
from galaxy.model import set_datatypes_registry
|
||||
from galaxy.model.mapping import init_models_from_config
|
||||
from galaxy.model.scoped_session import galaxy_scoped_session
|
||||
from galaxy.queues import galaxy_exchange
|
||||
from galaxy.tool_source_store import build_tool_source_store
|
||||
from galaxy.tool_source_store.search import (
|
||||
ToolSearchTuning,
|
||||
ToolWhooshIndex,
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
from collections.abc import (
|
||||
Callable,
|
||||
Iterable,
|
||||
)
|
||||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
)
|
||||
from collections.abc import Callable, Iterable
|
||||
|
||||
from galaxy.util.tool_version import remove_version_from_guid
|
||||
from .interface import ToolLineage
|
||||
|
||||
@@ -19,8 +19,11 @@ from typing import (
|
||||
from uuid import UUID
|
||||
|
||||
from cachetools import LRUCache
|
||||
from galaxy.tool_util.version import parse_version
|
||||
|
||||
from galaxy.exceptions import (
|
||||
ObjectNotFound,
|
||||
RequestParameterInvalidException,
|
||||
)
|
||||
from galaxy.tool_source_store import (
|
||||
StoredToolSource,
|
||||
ToolSourceStore,
|
||||
@@ -31,16 +34,13 @@ from galaxy.tool_source_store.index import (
|
||||
ToolIndexEntry,
|
||||
)
|
||||
from galaxy.tool_source_store.populator import populate_store_inline
|
||||
from galaxy.exceptions import (
|
||||
ObjectNotFound,
|
||||
RequestParameterInvalidException,
|
||||
)
|
||||
from galaxy.tool_util.id_util import extract_short_id_from_guid
|
||||
from galaxy.tool_util.toolbox.base import ToolConfRepository
|
||||
from galaxy.util.tool_version import remove_version_from_guid
|
||||
from galaxy.tool_util.parser import get_tool_source
|
||||
from galaxy.tool_util.toolbox.base import ToolConfRepository
|
||||
from galaxy.tool_util.toolbox.lineages.interface import ToolLineage
|
||||
from galaxy.tool_util.toolbox.panel import ToolSection
|
||||
from galaxy.tool_util.version import parse_version
|
||||
from galaxy.util.tool_version import remove_version_from_guid
|
||||
from . import (
|
||||
create_tool_from_source,
|
||||
ToolBox,
|
||||
@@ -327,9 +327,7 @@ class LazyTool:
|
||||
from ``_tools_by_id``.
|
||||
"""
|
||||
try:
|
||||
return self._materialize().to_dict(
|
||||
trans, link_details=link_details, tool_help=tool_help, **kw
|
||||
)
|
||||
return self._materialize().to_dict(trans, link_details=link_details, tool_help=tool_help, **kw)
|
||||
except Exception as e:
|
||||
log.warning("LazyTool.to_dict: materialise failed for %s, falling back to entry: %s", self.id, e)
|
||||
return self.to_panel_entry(trans)
|
||||
@@ -864,9 +862,7 @@ class LazyToolBox(ToolBox):
|
||||
|
||||
return tool
|
||||
|
||||
def _create_tool_from_stored_source(
|
||||
self, stored: StoredToolSource, entry: ToolIndexEntry | None = None
|
||||
) -> "Tool":
|
||||
def _create_tool_from_stored_source(self, stored: StoredToolSource, entry: ToolIndexEntry | None = None) -> "Tool":
|
||||
"""Create a Tool object from stored source."""
|
||||
tool_source = get_tool_source(
|
||||
raw_tool_source=stored.raw_source,
|
||||
|
||||
@@ -33,8 +33,7 @@ def hidden_lib_tool_paths() -> list[str]:
|
||||
"""
|
||||
base = os.path.dirname(__file__)
|
||||
return [
|
||||
os.path.abspath(os.path.join(base, p))
|
||||
for p in (*SPECIAL_TOOLS.values(), *_EXTRA_HIDDEN_LIB_TOOLS.values())
|
||||
os.path.abspath(os.path.join(base, p)) for p in (*SPECIAL_TOOLS.values(), *_EXTRA_HIDDEN_LIB_TOOLS.values())
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user