From 6fd2fac89cc1c4dd28602fa4fdf66d7c4002afd7 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 29 Oct 2019 15:15:45 -0400 Subject: [PATCH] Rework various tool shed imports head of big refactor. --- lib/galaxy/tool_shed/tools/__init__.py | 0 .../installed_repository_metadata_manager.py | 5 ++- lib/tool_shed/util/repository_util.py | 16 +++++--- packages/app/galaxy/tool_shed | 1 + packages/app/setup.py | 38 ++++++++----------- 5 files changed, 31 insertions(+), 29 deletions(-) create mode 100644 lib/galaxy/tool_shed/tools/__init__.py create mode 120000 packages/app/galaxy/tool_shed diff --git a/lib/galaxy/tool_shed/tools/__init__.py b/lib/galaxy/tool_shed/tools/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/lib/tool_shed/galaxy_install/metadata/installed_repository_metadata_manager.py b/lib/tool_shed/galaxy_install/metadata/installed_repository_metadata_manager.py index 20299bc27ea..c50da12bd66 100644 --- a/lib/tool_shed/galaxy_install/metadata/installed_repository_metadata_manager.py +++ b/lib/tool_shed/galaxy_install/metadata/installed_repository_metadata_manager.py @@ -5,13 +5,14 @@ from sqlalchemy import false from galaxy import util from galaxy.util import inflector +from galaxy.util.tool_shed import common_util +from galaxy.util.tool_shed import xml_util from galaxy.web.form_builder import SelectField from tool_shed.galaxy_install.tools import tool_panel_manager from tool_shed.metadata import metadata_generator -from tool_shed.util import common_util from tool_shed.util import repository_util from tool_shed.util import tool_util -from tool_shed.util import xml_util + log = logging.getLogger(__name__) diff --git a/lib/tool_shed/util/repository_util.py b/lib/tool_shed/util/repository_util.py index eafa90c86b6..046647a392b 100644 --- a/lib/tool_shed/util/repository_util.py +++ b/lib/tool_shed/util/repository_util.py @@ -3,6 +3,7 @@ import os import re import shutil +from markupsafe import escape from six.moves import configparser from six.moves.urllib.error import HTTPError from sqlalchemy import and_, false, or_ @@ -12,8 +13,13 @@ import tool_shed.dependencies.repository import tool_shed.util.metadata_util as metadata_util from galaxy import util from galaxy import web -from tool_shed.util import basic_util, common_util, encoding_util, hg_util -from tool_shed.util.web_util import escape +from galaxy.tool_shed.util import basic_util +from galaxy.util.tool_shed import common_util, encoding_util +from tool_shed.util.hg_util import ( + changeset2rev, + create_hgrc_file, + init_repository, +) log = logging.getLogger(__name__) @@ -259,12 +265,12 @@ def create_repository(app, name, type, description, long_description, user_id, c if not os.path.exists(repository_path): os.makedirs(repository_path) # Create the local repository. - hg_util.init_repository(repo_path=repository_path) + init_repository(repo_path=repository_path) # Add an entry in the hgweb.config file for the local repository. lhs = "repos/%s/%s" % (repository.user.username, repository.name) app.hgweb_config_manager.add_entry(lhs, repository_path) # Create a .hg/hgrc file for the local repository. - hg_util.create_hgrc_file(app, repository) + create_hgrc_file(app, repository) flush_needed = False if category_ids: # Create category associations @@ -468,7 +474,7 @@ def get_repo_info_dict(app, user, repository_id, changeset_revision): includes_tool_dependencies = False includes_tools_for_display_in_tool_panel = False repo_path = repository.repo_path(app) - ctx_rev = str(hg_util.changeset2rev(repo_path, changeset_revision)) + ctx_rev = str(changeset2rev(repo_path, changeset_revision)) repo_info_dict = create_repo_info_dict(app=app, repository_clone_url=repository_clone_url, changeset_revision=changeset_revision, diff --git a/packages/app/galaxy/tool_shed b/packages/app/galaxy/tool_shed new file mode 120000 index 00000000000..dd2ff4d7c55 --- /dev/null +++ b/packages/app/galaxy/tool_shed @@ -0,0 +1 @@ +../../../lib/galaxy/tool_shed \ No newline at end of file diff --git a/packages/app/setup.py b/packages/app/setup.py index 08bd1df2521..89e3a738a68 100644 --- a/packages/app/setup.py +++ b/packages/app/setup.py @@ -63,6 +63,22 @@ PACKAGES = [ 'galaxy.tools.toolbox.lineages', 'galaxy.tools.util', 'galaxy.tools.util.galaxyops', + 'galaxy.tool_shed', + # TODO: + # 'galaxy.tool_shed.galaxy_install', + # 'galaxy.tool_shed.galaxy_install.datatypes', + # 'galaxy.tool_shed.galaxy_install.grids', + # 'galaxy.tool_shed.galaxy_install.metadata', + # 'galaxy.tool_shed.galaxy_install.migrate', + # 'galaxy.tool_shed.galaxy_install.migrate.versions', + # 'galaxy.tool_shed.galaxy_install.repository_dependencies', + # 'galaxy.tool_shed.galaxy_install.tool_dependencies', + # 'galaxy.tool_shed.galaxy_install.tool_dependencies.recipe', + # 'galaxy.tool_shed.galaxy_install.tools', + # 'galaxy.tool_shed.galaxy_install.utility_containers', + 'galaxy.tool_shed.util', + # 'galaxy.tool_shed.metadata', + 'galaxy.tool_shed.tools', 'galaxy.tours', 'galaxy.visualization', 'galaxy.visualization.data_providers', @@ -75,28 +91,6 @@ PACKAGES = [ 'galaxy.workflow', 'galaxy.workflow.resources', 'galaxy.workflow.schedulers', - 'tool_shed', - 'tool_shed.capsule', - 'tool_shed.dependencies', - 'tool_shed.dependencies.repository', - 'tool_shed.dependencies.tool', - 'tool_shed.galaxy_install.datatypes', - 'tool_shed.galaxy_install.grids', - 'tool_shed.galaxy_install.metadata', - 'tool_shed.galaxy_install.migrate', - 'tool_shed.galaxy_install.migrate.versions', - 'tool_shed.galaxy_install.repository_dependencies', - 'tool_shed.galaxy_install.tool_dependencies', - 'tool_shed.galaxy_install.tool_dependencies.recipe', - 'tool_shed.galaxy_install.tools', - 'tool_shed.galaxy_install.utility_containers', - 'tool_shed.grids', - 'tool_shed.managers', - 'tool_shed.metadata', - 'tool_shed.repository_types', - 'tool_shed.tools', - 'tool_shed.util', - 'tool_shed.utility_containers', ] ENTRY_POINTS = ''' [console_scripts]