commit/galaxy-central: greg: Eliminate the deprecated "orphan" designation when displaying tool dependencies in tool shed containers.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/5fb649265c51/ Changeset: 5fb649265c51 User: greg Date: 2013-12-13 20:18:38 Summary: Eliminate the deprecated "orphan" designation when displaying tool dependencies in tool shed containers. Affected #: 1 file diff -r 35b1a3c6e617247de50ac3f83de46a090f9ac59c -r 5fb649265c513d6efd1e9d6c93ab06e6996e2008 lib/tool_shed/util/container_util.py --- a/lib/tool_shed/util/container_util.py +++ b/lib/tool_shed/util/container_util.py @@ -5,7 +5,6 @@ from galaxy.web.framework.helpers import time_ago from tool_shed.util import common_util from tool_shed.util import readme_util -from tool_shed.util.tool_dependency_util import tool_dependency_is_orphan import tool_shed.util.shed_util_common as suc log = logging.getLogger( __name__ ) @@ -269,7 +268,7 @@ """Tool dependency object""" def __init__( self, id=None, name=None, version=None, type=None, readme=None, installation_status=None, repository_id=None, - tool_dependency_id=None, is_orphan=None ): + tool_dependency_id=None ): self.id = id self.name = name self.version = version @@ -278,15 +277,6 @@ self.installation_status = installation_status self.repository_id = repository_id self.tool_dependency_id = tool_dependency_id - # The designation of a ToolDependency into the "orphan" category has evolved over time, and is significantly restricted since the - # introduction of the TOOL_DEPENDENCY_DEFINITION repository type. This designation is still critical, however, in that it handles - # the case where a repository contains both tools and a tool_dependencies.xml file, but the definition in the tool_dependencies.xml - # file is in no way related to anything defined by any of the contained tool's requirements tag sets. This is important in that it - # is often a result of a typo (e.g., dependency name or version) that differs between the tool dependency definition within the - # tool_dependencies.xml file and what is defined in the tool config's <requirements> tag sets. In these cases, the user should be - # presented with a warning message, and this warning message is is in fact displayed if the following is_orphan attribute is True. - # This is tricky because in some cases it may be intentional, and tool dependencies that are categorized as "orphan" are in fact valid. - self.is_orphan = is_orphan @property def listify( self ): @@ -318,42 +308,6 @@ self.repository_metadata_id = repository_metadata_id self.repository_id = repository_id -def add_orphan_settings_to_tool_dependencies( tool_dependencies, tools ): - """Inspect all received tool dependencies and label those that are orphans within the repository.""" - #orphan_env_dependencies = orphan_tool_dependencies.get( 'set_environment', None ) - new_tool_dependencies = {} - for td_key, requirements_dict in tool_dependencies.items(): - if td_key in [ 'set_environment' ]: - # "set_environment": [{"name": "R_SCRIPT_PATH", "type": "set_environment"}] - new_set_environment_dict_list = [] - for env_requirements_dict in requirements_dict: - try: - name = env_requirements_dict[ 'name' ] - type = env_requirements_dict[ 'type' ] - if tool_dependency_is_orphan( type, name, None, tools ): - env_requirements_dict[ 'is_orphan' ] = True - except Exception, e: - name = str( e ) - type = 'unknown' - is_orphan = 'unknown' - new_set_environment_dict_list.append( env_requirements_dict ) - new_tool_dependencies[ td_key ] = new_set_environment_dict_list - else: - # {"R/2.15.1": {"name": "R", "readme": "some string", "type": "package", "version": "2.15.1"} - try: - name = requirements_dict[ 'name' ] - type = requirements_dict[ 'type' ] - version = requirements_dict[ 'version'] - if tool_dependency_is_orphan( type, name, version, tools ): - requirements_dict[ 'is_orphan' ] = True - except Exception, e: - name = str( e ) - type = 'unknown' - version = 'unknown' - is_orphan = 'unknown' - new_tool_dependencies[ td_key ] = requirements_dict - return new_tool_dependencies - def build_data_managers_folder( trans, folder_id, data_managers, label=None ): """Return a folder hierarchy containing Data Managers.""" if data_managers: @@ -849,8 +803,6 @@ if 'tools' not in exclude: tools = metadata.get( 'tools', [] ) tools.extend( metadata.get( 'invalid_tools', [] ) ) - if tools: - tool_dependencies = add_orphan_settings_to_tool_dependencies( tool_dependencies, tools ) folder_id, tool_dependencies_root_folder = build_tool_dependencies_folder( trans, folder_id, tool_dependencies, @@ -1055,13 +1007,6 @@ tool_dependency_id += 1 if dependency_key in [ 'set_environment' ]: for set_environment_dict in requirements_dict: - if trans.webapp.name == 'tool_shed': - is_orphan = set_environment_dict.get( 'is_orphan', False ) - else: - # This is probably not necessary to display in Galaxy. - is_orphan = False - if is_orphan: - folder.description = not_used_by_local_tools_description try: name = set_environment_dict.get( 'name', None ) type = set_environment_dict[ 'type' ] @@ -1086,16 +1031,9 @@ readme=None, installation_status=installation_status, repository_id=repository_id, - tool_dependency_id=td_id, - is_orphan=is_orphan ) + tool_dependency_id=td_id ) folder.tool_dependencies.append( tool_dependency ) else: - if trans.webapp.name == 'tool_shed': - is_orphan = requirements_dict.get( 'is_orphan', False ) - else: - is_orphan = False - if is_orphan: - folder.description = not_used_by_local_tools_description try: name = requirements_dict[ 'name' ] version = requirements_dict[ 'version' ] @@ -1122,8 +1060,7 @@ readme=None, installation_status=installation_status, repository_id=repository_id, - tool_dependency_id=td_id, - is_orphan=is_orphan ) + tool_dependency_id=td_id ) folder.tool_dependencies.append( tool_dependency ) else: tool_dependencies_root_folder = None Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org