2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/f1a13b9f2c3e/ Changeset: f1a13b9f2c3e Branch: stable User: greg Date: 2014-03-04 23:01:51 Summary: Fix for white ghost scenario discovery. Affected #: 2 files diff -r b1b8acdf8c7268dfded0a358acfe31308196381a -r f1a13b9f2c3eb89dd28a8bbcc20fd929d39dcb65 lib/tool_shed/util/common_install_util.py --- a/lib/tool_shed/util/common_install_util.py +++ b/lib/tool_shed/util/common_install_util.py @@ -1,3 +1,4 @@ +import copy import logging import os import urllib @@ -71,8 +72,8 @@ def get_dependencies_for_repository( trans, tool_shed_url, repo_info_dict, includes_tool_dependencies ): """ - Return dictionaries containing the sets of installed and missing tool dependencies and repository dependencies associated - with the repository defined by the received repo_info_dict. + Return dictionaries containing the sets of installed and missing tool dependencies and repository + dependencies associated with the repository defined by the received repo_info_dict. """ repository = None installed_rd = {} @@ -86,15 +87,20 @@ if tool_dependencies: if not includes_tool_dependencies: includes_tool_dependencies = True - # Inspect the tool_dependencies dictionary to separate the installed and missing tool dependencies. We don't add to installed_td - # and missing_td here because at this point they are empty. - installed_td, missing_td = get_installed_and_missing_tool_dependencies_for_installing_repository( trans, tool_shed_url, tool_dependencies ) - # In cases where a repository dependency is required only for compiling a dependent repository's tool dependency, the value of - # repository_dependencies will be an empty dictionary here. + # Inspect the tool_dependencies dictionary to separate the installed and missing tool dependencies. + # We don't add to installed_td and missing_td here because at this point they are empty. + installed_td, missing_td = \ + get_installed_and_missing_tool_dependencies_for_installing_repository( trans, tool_shed_url, tool_dependencies ) + # In cases where a repository dependency is required only for compiling a dependent repository's + # tool dependency, the value of repository_dependencies will be an empty dictionary here. if repository_dependencies: # We have a repository with one or more defined repository dependencies. if not repository: - repository = suc.get_repository_for_dependency_relationship( trans.app, tool_shed_url, name, repository_owner, changeset_revision ) + repository = suc.get_repository_for_dependency_relationship( trans.app, + tool_shed_url, + name, + repository_owner, + changeset_revision ) if repository and repository.metadata: installed_rd, missing_rd = get_installed_and_missing_repository_dependencies( trans, repository ) else: @@ -309,18 +315,26 @@ installed_tool_dependencies = {} missing_tool_dependencies = {} if tool_dependencies_dict: - for td_key, val in tool_dependencies_dict.items(): + # Make sure not to change anything in the received tool_dependencies_dict as that would be a bad side-effect! + tmp_tool_dependencies_dict = copy.deepcopy( tool_dependencies_dict ) + for td_key, val in tmp_tool_dependencies_dict.items(): # Default the status to NEVER_INSTALLED. tool_dependency_status = trans.install_model.ToolDependency.installation_status.NEVER_INSTALLED # Set environment tool dependencies are a list. if td_key == 'set_environment': new_val = [] for requirement_dict in val: - # {'repository_name': 'xx', 'name': 'bwa', 'version': '0.5.9', 'repository_owner': 'yy', 'changeset_revision': 'zz', 'type': 'package'} - tool_dependency = tool_dependency_util.get_tool_dependency_by_name_version_type( trans.app, - requirement_dict.get( 'name', None ), - requirement_dict.get( 'version', None ), - requirement_dict.get( 'type', 'package' ) ) + # {'repository_name': 'xx', + # 'name': 'bwa', + # 'version': '0.5.9', + # 'repository_owner': 'yy', + # 'changeset_revision': 'zz', + # 'type': 'package'} + tool_dependency = \ + tool_dependency_util.get_tool_dependency_by_name_version_type( trans.app, + requirement_dict.get( 'name', None ), + requirement_dict.get( 'version', None ), + requirement_dict.get( 'type', 'package' ) ) if tool_dependency: tool_dependency_status = tool_dependency.status requirement_dict[ 'status' ] = tool_dependency_status @@ -331,7 +345,12 @@ missing_tool_dependencies[ td_key ] = new_val else: # The val dictionary looks something like this: - # {'repository_name': 'xx', 'name': 'bwa', 'version': '0.5.9', 'repository_owner': 'yy', 'changeset_revision': 'zz', 'type': 'package'} + # {'repository_name': 'xx', + # 'name': 'bwa', + # 'version': '0.5.9', + # 'repository_owner': 'yy', + # 'changeset_revision': 'zz', + # 'type': 'package'} tool_dependency = tool_dependency_util.get_tool_dependency_by_name_version_type( trans.app, val.get( 'name', None ), val.get( 'version', None ), @@ -347,14 +366,16 @@ def get_required_repo_info_dicts( trans, tool_shed_url, repo_info_dicts ): """ - Inspect the list of repo_info_dicts for repository dependencies and append a repo_info_dict for each of them to the list. All - repository_dependencies entries in each of the received repo_info_dicts includes all required repositories, so only one pass through - this method is required to retrieve all repository dependencies. + Inspect the list of repo_info_dicts for repository dependencies and append a repo_info_dict for each of + them to the list. All repository_dependencies entries in each of the received repo_info_dicts includes + all required repositories, so only one pass through this method is required to retrieve all repository + dependencies. """ all_required_repo_info_dict = {} all_repo_info_dicts = [] if repo_info_dicts: - # We'll send tuples of ( tool_shed, repository_name, repository_owner, changeset_revision ) to the tool shed to discover repository ids. + # We'll send tuples of ( tool_shed, repository_name, repository_owner, changeset_revision ) to the tool + # shed to discover repository ids. required_repository_tups = [] for repo_info_dict in repo_info_dicts: if repo_info_dict not in all_repo_info_dicts: @@ -368,9 +389,10 @@ continue repository_components_tuple = container_util.get_components_from_key( key ) components_list = suc.extract_components_from_tuple( repository_components_tuple ) - # Skip listing a repository dependency if it is required only to compile a tool dependency defined for the dependent repository since - # in this case, the repository dependency is really a dependency of the dependent repository's contained tool dependency, and only if - # that tool dependency requires compilation. + # Skip listing a repository dependency if it is required only to compile a tool dependency + # defined for the dependent repository since in this case, the repository dependency is really + # a dependency of the dependent repository's contained tool dependency, and only if that + # tool dependency requires compilation. # For backward compatibility to the 12/20/12 Galaxy release. prior_installation_required = 'False' only_if_compiling_contained_td = 'False' @@ -388,8 +410,8 @@ only_if_compiling_contained_td = components_list[ 5 ] except: only_if_compiling_contained_td = 'False' - # Skip listing a repository dependency if it is required only to compile a tool dependency defined for the dependent repository - # (see above comment). + # Skip listing a repository dependency if it is required only to compile a tool dependency + # defined for the dependent repository (see above comment). if not util.asbool( only_if_compiling_contained_td ): if components_list not in required_repository_tups: required_repository_tups.append( components_list ) diff -r b1b8acdf8c7268dfded0a358acfe31308196381a -r f1a13b9f2c3eb89dd28a8bbcc20fd929d39dcb65 lib/tool_shed/util/repository_dependency_util.py --- a/lib/tool_shed/util/repository_dependency_util.py +++ b/lib/tool_shed/util/repository_dependency_util.py @@ -99,34 +99,37 @@ def create_repository_dependency_objects( trans, tool_path, tool_shed_url, repo_info_dicts, install_repository_dependencies=False, no_changes_checked=False, tool_panel_section_id=None, new_tool_panel_section_label=None ): """ - Discover all repository dependencies and make sure all tool_shed_repository and associated repository_dependency records exist as well as - the dependency relationships between installed repositories. This method is called when uninstalled repositories are being reinstalled. - If the user elected to install repository dependencies, all items in the all_repo_info_dicts list will be processed. However, if repository - dependencies are not to be installed, only those items contained in the received repo_info_dicts list will be processed. + Discover all repository dependencies and make sure all tool_shed_repository and associated repository_dependency + records exist as well as the dependency relationships between installed repositories. This method is called when + uninstalled repositories are being reinstalled. If the user elected to install repository dependencies, all items + in the all_repo_info_dicts list will be processed. However, if repository dependencies are not to be installed, + only those items contained in the received repo_info_dicts list will be processed. """ log.debug( "Creating repository dependency objects..." ) - # The following list will be maintained within this method to contain all created or updated tool shed repositories, including repository - # dependencies that may not be installed. + # The following list will be maintained within this method to contain all created or updated tool shed repositories, + # including repository dependencies that may not be installed. all_created_or_updated_tool_shed_repositories = [] - # There will be a one-to-one mapping between items in 3 lists: created_or_updated_tool_shed_repositories, tool_panel_section_keys and - # filtered_repo_info_dicts. The 3 lists will filter out repository dependencies that are not to be installed. + # There will be a one-to-one mapping between items in 3 lists: created_or_updated_tool_shed_repositories, + # tool_panel_section_keys and filtered_repo_info_dicts. The 3 lists will filter out repository dependencies + # that are not to be installed. created_or_updated_tool_shed_repositories = [] tool_panel_section_keys = [] - # Repositories will be filtered (e.g., if already installed, if elected to not be installed, etc), so filter the associated repo_info_dicts - # accordingly. + # Repositories will be filtered (e.g., if already installed, if elected to not be installed, etc), so filter + # the associated repo_info_dicts accordingly. filtered_repo_info_dicts = [] - # Discover all repository dependencies and retrieve information for installing them. Even if the user elected to not install repository - # dependencies we have to make sure all repository dependency objects exist so that the appropriate repository dependency relationships can - # be built. + # Discover all repository dependencies and retrieve information for installing them. Even if the user elected + # to not install repository dependencies we have to make sure all repository dependency objects exist so that + # the appropriate repository dependency relationships can be built. all_required_repo_info_dict = common_install_util.get_required_repo_info_dicts( trans, tool_shed_url, repo_info_dicts ) all_repo_info_dicts = all_required_repo_info_dict.get( 'all_repo_info_dicts', [] ) if not all_repo_info_dicts: # No repository dependencies were discovered so process the received repositories. all_repo_info_dicts = [ rid for rid in repo_info_dicts ] for repo_info_dict in all_repo_info_dicts: - # If the user elected to install repository dependencies, all items in the all_repo_info_dicts list will be processed. However, if - # repository dependencies are not to be installed, only those items contained in the received repo_info_dicts list will be processed - # but the the all_repo_info_dicts list will be used to create all defined repository dependency relationships. + # If the user elected to install repository dependencies, all items in the all_repo_info_dicts list will + # be processed. However, if repository dependencies are not to be installed, only those items contained + # in the received repo_info_dicts list will be processed but the the all_repo_info_dicts list will be used + # to create all defined repository dependency relationships. if is_in_repo_info_dicts( repo_info_dict, repo_info_dicts ) or install_repository_dependencies: for name, repo_info_tuple in repo_info_dict.items(): can_update_db_record = False @@ -196,7 +199,7 @@ suc.create_or_update_tool_shed_repository( app=trans.app, name=name, description=description, - installed_changeset_revision=changeset_revision, + installed_changeset_revision=installed_changeset_revision, ctx_rev=ctx_rev, repository_clone_url=repository_clone_url, metadata_dict={}, https://bitbucket.org/galaxy/galaxy-central/commits/27f8a2d9c711/ Changeset: 27f8a2d9c711 User: davebgx Date: 2014-03-04 23:03:11 Summary: Merge stable. Affected #: 0 files 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.