From 283e70601d611db744cffeb6f6b8a2a7736750df Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Fri, 3 Jun 2022 18:17:31 +0100 Subject: [PATCH] Fix mypy issues --- lib/galaxy_test/driver/driver_util.py | 5 ++--- packages/test_driver/setup.py | 11 ++++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/galaxy_test/driver/driver_util.py b/lib/galaxy_test/driver/driver_util.py index 8fb46800df6..890ca3d8cc9 100644 --- a/lib/galaxy_test/driver/driver_util.py +++ b/lib/galaxy_test/driver/driver_util.py @@ -34,6 +34,7 @@ from galaxy.tool_util.verify.interactor import ( GalaxyInteractorApi, verify_tool, ) +from galaxy.tools import ToolBox from galaxy.util import ( asbool, download_to_file, @@ -612,9 +613,7 @@ def setup_shed_tools_for_test(app, tmpdir, testing_migrated_tools, testing_insta tool_configs.remove(relative_migrated_tool_panel_config) for installed_tool_panel_config in INSTALLED_TOOL_PANEL_CONFIGS: tool_configs.append(installed_tool_panel_config) - from galaxy import tools # delay import because this brings in so many modules for small tests # noqa: E402 - - app.toolbox = tools.ToolBox(tool_configs, app.config.tool_path, app) + app.toolbox = ToolBox(tool_configs, app.config.tool_path, app) def build_galaxy_app(simple_kwargs) -> GalaxyUniverseApplication: diff --git a/packages/test_driver/setup.py b/packages/test_driver/setup.py index 79b0ebd7677..bdf57817827 100644 --- a/packages/test_driver/setup.py +++ b/packages/test_driver/setup.py @@ -3,6 +3,10 @@ import ast import os import re +from typing import ( + Dict, + List, +) try: from setuptools import setup @@ -20,8 +24,9 @@ with open(f"{SOURCE_DIR}/project_galaxy_{project_short_name}.py") as f: def get_var(var_name): pattern = re.compile(rf"{var_name}\s+=\s+(.*)") - match = pattern.search(init_contents).group(1) - return str(ast.literal_eval(match)) + match = pattern.search(init_contents) + assert match + return str(ast.literal_eval(match.group(1))) version = get_var("__version__") @@ -39,7 +44,7 @@ PACKAGES = [ ENTRY_POINTS = """ [console_scripts] """ -PACKAGE_DATA = { +PACKAGE_DATA: Dict[str, List[str]] = { # Be sure to update MANIFEST.in for source dist. "galaxy": [], }