1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/be5f0c5df96f/ Changeset: be5f0c5df96f User: greg Date: 2014-01-14 22:37:56 Summary: Add the ability to install the latest installable revision of a repository that is already installed into Galaxy via the installed repository's pop-up menu on the Manage installed Tool Shed repositories grid in Galaxy. This is a new grid operation that is available only for those repositories that have a revision upgrade available in the Tool Shed. Affected #: 5 files diff -r 8ac00a14c7fd8fcf263184aeab4786a66cdb4b0e -r be5f0c5df96fba1a12e3e96fdb6f1805703f0b73 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py --- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py @@ -106,10 +106,11 @@ if operation == "activate or reinstall": repository = suc.get_installed_tool_shed_repository( trans, kwd[ 'id' ] ) if repository.uninstalled: - # Since we're reinstalling the repository we need to find the latest changeset revision to which it can be updated so that we - # can reset the metadata if necessary. This will ensure that information about repository dependencies and tool dependencies - # will be current. Only allow selecting a different section in the tool panel if the repository was uninstalled and it contained - # tools that should be displayed in the tool panel. + # Since we're reinstalling the repository we need to find the latest changeset revision to which it can + # be updated so that we can reset the metadata if necessary. This will ensure that information about + # repository dependencies and tool dependencies will be current. Only allow selecting a different section + # in the tool panel if the repository was uninstalled and it contained tools that should be displayed in + # the tool panel. changeset_revision_dict = repository_util.get_update_to_changeset_revision_and_ctx_rev( trans, repository ) current_changeset_revision = changeset_revision_dict.get( 'changeset_revision', None ) current_ctx_rev = changeset_revision_dict.get( 'ctx_rev', None ) @@ -121,11 +122,12 @@ **kwd ) ) else: # The uninstalled repository has updates available in the tool shed. - updated_repo_info_dict = self.get_updated_repository_information( trans=trans, - repository_id=trans.security.encode_id( repository.id ), - repository_name=repository.name, - repository_owner=repository.owner, - changeset_revision=current_changeset_revision ) + updated_repo_info_dict = \ + self.get_updated_repository_information( trans=trans, + repository_id=trans.security.encode_id( repository.id ), + repository_name=repository.name, + repository_owner=repository.owner, + changeset_revision=current_changeset_revision ) json_repo_info_dict = json.to_json_string( updated_repo_info_dict ) encoded_repo_info_dict = encoding_util.tool_shed_encode( json_repo_info_dict ) kwd[ 'latest_changeset_revision' ] = current_changeset_revision @@ -150,6 +152,10 @@ return trans.response.send_redirect( web.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', **kwd ) ) + if operation == "install latest revision": + return trans.response.send_redirect( web.url_for( controller='admin_toolshed', + action='install_latest_repository_revision', + **kwd ) ) return self.installed_repository_grid( trans, **kwd ) @web.expose @@ -460,6 +466,61 @@ @web.expose @web.require_admin + def install_latest_repository_revision( self, trans, **kwd ): + """Install the latest installable revision of a repository that has been previously installed.""" + message = kwd.get( 'message', '' ) + status = kwd.get( 'status', 'done' ) + repository_id = kwd.get( 'id', None ) + if repository_id is not None: + repository = suc.get_installed_tool_shed_repository( trans, repository_id ) + if repository is not None: + tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed ) + name = str( repository.name ) + owner = str( repository.owner ) + url = suc.url_join( tool_shed_url, + 'repository/get_latest_downloadable_changeset_revision?galaxy_url=%s&name=%s&owner=%s' % \ + ( web.url_for( '/', qualified=True ), name, owner ) ) + raw_text = common_util.tool_shed_get( trans.app, tool_shed_url, url ) + latest_downloadable_revision = json.from_json_string( raw_text ) + if latest_downloadable_revision == suc.INITIAL_CHANGELOG_HASH: + message = 'Error retrieving the latest downloadable revision for this repository via the url <b>%s</b>.' % url + status = 'error' + else: + # Make sure the latest changeset_revision of the repository has not already been installed. + # Updates to installed repository revisions may have occurred, so make sure to locate the + # appropriate repository revision if one exists. We need to create a temporary repo_info_tuple + # with the following entries to handle this. + # ( description, clone_url, changeset_revision, ctx_rev, owner, repository_dependencies, tool_dependencies ) + tmp_clone_url = suc.url_join( tool_shed_url, 'repos', owner, name ) + tmp_repo_info_tuple = ( None, tmp_clone_url, latest_downloadable_revision, None, owner, None, None ) + installed_repository, installed_changeset_revision = \ + suc.repository_was_previously_installed( trans, tool_shed_url, name, tmp_repo_info_tuple ) + if installed_repository: + current_changeset_revision = str( installed_repository.changeset_revision ) + message = 'Revision %s of repository %s owned by %s has already been installed.' + if current_changeset_revision != latest_downloadable_revision: + message += ' The current changeset revision is %s.' % current_changeset_revision + status = 'error' + else: + # Install the latest downloadable revision of the repository. + url = suc.url_join( tool_shed_url, + 'repository/install_repositories_by_revision?name=%s&owner=%s&changeset_revisions=%s&galaxy_url=%s' % \ + ( name, owner, latest_downloadable_revision, web.url_for( '/', qualified=True ) ) ) + return trans.response.send_redirect( url ) + else: + message = 'Cannot locate installed tool shed repository with encoded id %s.' % str( repository_id ) + status = 'error' + else: + message = 'The request parameters did not include the required encoded id of installed repository.' + status = 'error' + return trans.response.send_redirect( web.url_for( controller='admin_toolshed', + action='browse_repositories', + message=message, + status=status ) ) + + + @web.expose + @web.require_admin def install_tool_dependencies( self, trans, **kwd ): message = kwd.get( 'message', '' ) status = kwd.get( 'status', 'done' ) @@ -600,12 +661,17 @@ def manage_repository( self, trans, **kwd ): message = kwd.get( 'message', '' ) status = kwd.get( 'status', 'done' ) - repository_id = kwd[ 'id' ] + repository_id = kwd.get( 'id', None ) + if repository_id is None: + return trans.show_error_message( 'Missing required encoded repository id.' ) operation = kwd.get( 'operation', None ) repository = suc.get_installed_tool_shed_repository( trans, repository_id ) - if not repository: + if repository is None: return trans.show_error_message( 'Invalid repository specified.' ) tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed ) + name = str( repository.name ) + owner = str( repository.owner ) + installed_changeset_revision = str( repository.installed_changeset_revision ) if repository.status in [ trans.install_model.ToolShedRepository.installation_status.CLONING ]: tool_shed_repository_ids = [ repository_id ] return trans.response.send_redirect( web.url_for( controller='admin_toolshed', @@ -615,12 +681,12 @@ # Send a request to the tool shed to install the repository. url = suc.url_join( tool_shed_url, 'repository/install_repositories_by_revision?name=%s&owner=%s&changeset_revisions=%s&galaxy_url=%s' % \ - ( repository.name, repository.owner, repository.installed_changeset_revision, ( web.url_for( '/', qualified=True ) ) ) ) + ( name, owner, installed_changeset_revision, ( web.url_for( '/', qualified=True ) ) ) ) return trans.response.send_redirect( url ) description = kwd.get( 'description', repository.description ) shed_tool_conf, tool_path, relative_install_dir = suc.get_tool_panel_config_tool_path_install_dir( trans.app, repository ) if relative_install_dir: - repo_files_dir = os.path.abspath( os.path.join( tool_path, relative_install_dir, repository.name ) ) + repo_files_dir = os.path.abspath( os.path.join( tool_path, relative_install_dir, name ) ) else: repo_files_dir = None if repository.in_error_state: @@ -841,7 +907,7 @@ # Get the information necessary to install each repository. url = suc.url_join( tool_shed_url, 'repository/get_repository_information?repository_ids=%s&changeset_revisions=%s' % \ - ( repository_ids, changeset_revisions ) ) + ( str( repository_ids ), str( changeset_revisions ) ) ) raw_text = common_util.tool_shed_get( trans.app, tool_shed_url, url ) repo_information_dict = json.from_json_string( raw_text ) for encoded_repo_info_dict in repo_information_dict.get( 'repo_info_dicts', [] ): diff -r 8ac00a14c7fd8fcf263184aeab4786a66cdb4b0e -r be5f0c5df96fba1a12e3e96fdb6f1805703f0b73 lib/galaxy/webapps/tool_shed/controllers/repository.py --- a/lib/galaxy/webapps/tool_shed/controllers/repository.py +++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py @@ -1581,28 +1581,52 @@ items=functional_test_results ) @web.json + def get_latest_downloadable_changeset_revision( self, trans, **kwd ): + """ + Return the latest installable changeset revision for the repository associated with the received + name and owner. This method is called from Galaxy when attempting to install the latest revision + of an installed repository. + """ + repository_name = kwd.get( 'name', None ) + repository_owner = kwd.get( 'owner', None ) + if repository_name is not None and repository_owner is not None: + repository = suc.get_repository_by_name_and_owner( trans.app, repository_name, repository_owner ) + if repository: + repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) ) + return suc.get_latest_downloadable_changeset_revision( trans, repository, repo ) + return suc.INITIAL_CHANGELOG_HASH + + @web.json def get_readme_files( self, trans, **kwd ): """ - This method is called when installing or re-installing a single repository into a Galaxy instance. If the received changeset_revision - includes one or more readme files, return them in a dictionary. + This method is called when installing or re-installing a single repository into a Galaxy instance. + If the received changeset_revision includes one or more readme files, return them in a dictionary. """ - repository_name = kwd[ 'name' ] - repository_owner = kwd[ 'owner' ] - changeset_revision = kwd[ 'changeset_revision' ] - repository = suc.get_repository_by_name_and_owner( trans.app, repository_name, repository_owner ) - if repository: - repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, - trans.security.encode_id( repository.id ), - changeset_revision ) - if repository_metadata: - metadata = repository_metadata.metadata - if metadata: - return readme_util.build_readme_files_dict( trans, repository, changeset_revision, repository_metadata.metadata ) + repository_name = kwd.get( 'name', None ) + repository_owner = kwd.get( 'owner', None ) + changeset_revision = kwd.get( 'changeset_revision', None ) + if repository_name is not None and repository_owner is not None and changeset_revision is not None: + repository = suc.get_repository_by_name_and_owner( trans.app, repository_name, repository_owner ) + if repository: + repository_metadata = \ + suc.get_repository_metadata_by_changeset_revision( trans, + trans.security.encode_id( repository.id ), + changeset_revision ) + if repository_metadata: + metadata = repository_metadata.metadata + if metadata: + return readme_util.build_readme_files_dict( trans, + repository, + changeset_revision, + repository_metadata.metadata ) return {} @web.json def get_repository_dependencies( self, trans, **kwd ): - """Return an encoded dictionary of all repositories upon which the contents of the received repository depends.""" + """ + Return an encoded dictionary of all repositories upon which the contents of the received repository + depends. + """ name = kwd.get( 'name', None ) owner = kwd.get( 'owner', None ) changeset_revision = kwd.get( 'changeset_revision', None ) @@ -1630,8 +1654,8 @@ @web.json def get_repository_information( self, trans, repository_ids, changeset_revisions, **kwd ): """ - Generate a list of dictionaries, each of which contains the information about a repository that will be necessary for installing it into - a local Galaxy instance. + Generate a list of dictionaries, each of which contains the information about a repository that will + be necessary for installing it into a local Galaxy instance. """ includes_tools = False includes_tools_for_display_in_tool_panel = False @@ -1665,8 +1689,8 @@ @web.json def get_required_repo_info_dict( self, trans, encoded_str=None ): """ - Retrieve and return a dictionary that includes a list of dictionaries that each contain all of the information needed to install the list of - repositories defined by the received encoded_str. + Retrieve and return a dictionary that includes a list of dictionaries that each contain all of the + information needed to install the list of repositories defined by the received encoded_str. """ repo_info_dict = {} if encoded_str: @@ -1689,7 +1713,10 @@ @web.expose def get_tool_dependencies( self, trans, **kwd ): - """Handle a request from a Galaxy instance to get the tool_dependencies entry from the metadata for a specified changeset revision.""" + """ + Handle a request from a Galaxy instance to get the tool_dependencies entry from the metadata + for a specified changeset revision. + """ name = kwd.get( 'name', None ) owner = kwd.get( 'owner', None ) changeset_revision = kwd.get( 'changeset_revision', None ) @@ -1705,7 +1732,10 @@ @web.expose def get_tool_dependencies_config_contents( self, trans, **kwd ): - """Handle a request from a Galaxy instance to get the tool_dependencies.xml file contents for a specified changeset revision.""" + """ + Handle a request from a Galaxy instance to get the tool_dependencies.xml file contents for a + specified changeset revision. + """ name = kwd.get( 'name', None ) owner = kwd.get( 'owner', None ) changeset_revision = kwd.get( 'changeset_revision', None ) @@ -1726,8 +1756,8 @@ @web.expose def get_tool_versions( self, trans, **kwd ): """ - For each valid /downloadable change set (up to the received changeset_revision) in the repository's change log, append the change - set's tool_versions dictionary to the list that will be returned. + For each valid /downloadable change set (up to the received changeset_revision) in the repository's + change log, append the changeset tool_versions dictionary to the list that will be returned. """ name = kwd[ 'name' ] owner = kwd[ 'owner' ] @@ -1751,7 +1781,10 @@ @web.json def get_updated_repository_information( self, trans, name, owner, changeset_revision, **kwd ): - """Generate a dictionary that contains the information about a repository that is necessary for installing it into a local Galaxy instance.""" + """ + Generate a dictionary that contains the information about a repository that is necessary for installing + it into a local Galaxy instance. + """ repository = suc.get_repository_by_name_and_owner( trans.app, name, owner ) repository_id = trans.security.encode_id( repository.id ) repository_clone_url = suc.generate_clone_url_for_repository_in_tool_shed( trans, repository ) @@ -1828,7 +1861,10 @@ repo_info_dict=repo_info_dict ) def get_versions_of_tool( self, trans, repository, repository_metadata, guid ): - """Return the tool lineage in descendant order for the received guid contained in the received repsitory_metadata.tool_versions.""" + """ + Return the tool lineage in descendant order for the received guid contained in the received + repsitory_metadata.tool_versions. + """ encoded_id = trans.security.encode_id( repository.id ) repo_dir = repository.repo_path( trans.app ) repo = hg.repository( suc.get_configured_ui(), repo_dir ) @@ -1846,7 +1882,9 @@ current_child_guid = parent_guid # Get all descendant guids of the received guid. current_parent_guid = guid - for changeset in suc.reversed_lower_upper_bounded_changelog( repo, repository_metadata.changeset_revision, repository.tip( trans.app ) ): + for changeset in suc.reversed_lower_upper_bounded_changelog( repo, + repository_metadata.changeset_revision, + repository.tip( trans.app ) ): ctx = repo.changectx( changeset ) rm = suc.get_repository_metadata_by_changeset_revision( trans, encoded_id, str( ctx ) ) if rm: @@ -1943,8 +1981,9 @@ @web.expose def install_repositories_by_revision( self, trans, **kwd ): """ - Send the list of repository_ids and changeset_revisions to Galaxy so it can begin the installation process. If the value of - repository_ids is not received, then the name and owner of a single repository must be received to install a single repository. + Send the list of repository_ids and changeset_revisions to Galaxy so it can begin the installation + process. If the value of repository_ids is not received, then the name and owner of a single repository + must be received to install a single repository. """ repository_ids = kwd.get( 'repository_ids', None ) changeset_revisions = kwd.get( 'changeset_revisions', None ) @@ -1958,10 +1997,13 @@ # Redirect back to local Galaxy to perform install. url = suc.url_join( galaxy_url, 'admin_toolshed/prepare_for_install?tool_shed_url=%s&repository_ids=%s&changeset_revisions=%s' % \ - ( web.url_for( '/', qualified=True ), ','.join( util.listify( repository_ids ) ), ','.join( util.listify( changeset_revisions ) ) ) ) + ( web.url_for( '/', qualified=True ), + ','.join( util.listify( repository_ids ) ), + ','.join( util.listify( changeset_revisions ) ) ) ) return trans.response.send_redirect( url ) else: - message = 'Repository installation is not possible due to an invalid Galaxy URL: <b>%s</b>. You may need to enable cookies in your browser. ' % galaxy_url + message = 'Repository installation is not possible due to an invalid Galaxy URL: <b>%s</b>. ' + message += 'You may need to enable cookies in your browser. ' % galaxy_url status = 'error' return trans.response.send_redirect( web.url_for( controller='repository', action='browse_valid_categories', diff -r 8ac00a14c7fd8fcf263184aeab4786a66cdb4b0e -r be5f0c5df96fba1a12e3e96fdb6f1805703f0b73 lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py --- a/lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py +++ b/lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py @@ -131,73 +131,99 @@ args = { self.key: val } accepted_filters.append( grids.GridColumnFilter( label, args) ) return accepted_filters + # Grid definition title = "Installed tool shed repositories" model_class = tool_shed_install.ToolShedRepository template='/admin/tool_shed_repository/grid.mako' default_sort_key = "name" columns = [ - ToolShedStatusColumn( "", - attach_popup=False ), - NameColumn( "Name", + ToolShedStatusColumn( label="" ), + NameColumn( label="Name", key="name", link=( lambda item: iff( item.status in [ tool_shed_install.ToolShedRepository.installation_status.CLONING ], None, dict( operation="manage_repository", id=item.id ) ) ), attach_popup=True ), - DescriptionColumn( "Description" ), - OwnerColumn( "Owner" ), - RevisionColumn( "Revision" ), - StatusColumn( "Installation Status", + DescriptionColumn( label="Description" ), + OwnerColumn( label="Owner" ), + RevisionColumn( label="Revision" ), + StatusColumn( label="Installation Status", filterable="advanced" ), - ToolShedColumn( "Tool shed" ), + ToolShedColumn( label="Tool shed" ), # Columns that are valid for filtering but are not visible. - DeletedColumn( "Status", + DeletedColumn( label="Status", key="deleted", visible=False, filterable="advanced" ) ] columns.append( grids.MulticolFilterColumn( "Search repository name", - cols_to_filter=[ columns[0] ], + cols_to_filter=[ columns[ 1 ] ], key="free-text-search", visible=False, filterable="standard" ) ) global_actions = [ - grids.GridAction( "Update tool shed status", - dict( controller='admin_toolshed', action='update_tool_shed_status_for_installed_repository', all_installed_repositories=True ) ) + grids.GridAction( label="Update tool shed status", + url_args=dict( controller='admin_toolshed', + action='update_tool_shed_status_for_installed_repository', + all_installed_repositories=True ), + inbound=False ) ] - operations = [ grids.GridOperation( "Update tool shed status", + operations = [ grids.GridOperation( label="Update tool shed status", + condition=( lambda item: not item.deleted ), allow_multiple=False, - condition=( lambda item: not item.deleted ), - async_compatible=False, - url_args=dict( controller='admin_toolshed', action='browse_repositories', operation='update tool shed status' ) ), - grids.GridOperation( "Get updates", + url_args=dict( controller='admin_toolshed', + action='browse_repositories', + operation='update tool shed status' ) ), + grids.GridOperation( label="Get updates", + condition=( lambda item: \ + not item.deleted and \ + item.revision_update_available and \ + item.status not in \ + [ tool_shed_install.ToolShedRepository.installation_status.ERROR, + tool_shed_install.ToolShedRepository.installation_status.NEW ] ), allow_multiple=False, - condition=( lambda item: not item.deleted and item.revision_update_available and item.status not in \ - [ tool_shed_install.ToolShedRepository.installation_status.ERROR, tool_shed_install.ToolShedRepository.installation_status.NEW ] ), - async_compatible=False, - url_args=dict( controller='admin_toolshed', action='browse_repositories', operation='get updates' ) ), - grids.GridOperation( "Install", + url_args=dict( controller='admin_toolshed', + action='browse_repositories', + operation='get updates' ) ), + grids.GridOperation( label="Install latest revision", + condition=( lambda item: item.upgrade_available ), allow_multiple=False, - condition=( lambda item: not item.deleted and item.status == tool_shed_install.ToolShedRepository.installation_status.NEW ), - async_compatible=False, - url_args=dict( controller='admin_toolshed', action='manage_repository', operation='install' ) ), - grids.GridOperation( "Deactivate or uninstall", + url_args=dict( controller='admin_toolshed', + action='browse_repositories', + operation='install latest revision' ) ), + grids.GridOperation( label="Install", + condition=( lambda item: \ + not item.deleted and \ + item.status == tool_shed_install.ToolShedRepository.installation_status.NEW ), allow_multiple=False, - condition=( lambda item: not item.deleted and item.status not in \ - [ tool_shed_install.ToolShedRepository.installation_status.ERROR, tool_shed_install.ToolShedRepository.installation_status.NEW ] ), - async_compatible=False, - url_args=dict( controller='admin_toolshed', action='browse_repositories', operation='deactivate or uninstall' ) ), - grids.GridOperation( "Reset to install", + url_args=dict( controller='admin_toolshed', + action='manage_repository', + operation='install' ) ), + grids.GridOperation( label="Deactivate or uninstall", + condition=( lambda item: \ + not item.deleted and \ + item.status not in \ + [ tool_shed_install.ToolShedRepository.installation_status.ERROR, + tool_shed_install.ToolShedRepository.installation_status.NEW ] ), allow_multiple=False, - condition=( lambda item: ( item.status == tool_shed_install.ToolShedRepository.installation_status.ERROR ) ), - async_compatible=False, - url_args=dict( controller='admin_toolshed', action='browse_repositories', operation='reset to install' ) ), - grids.GridOperation( "Activate or reinstall", + url_args=dict( controller='admin_toolshed', + action='browse_repositories', + operation='deactivate or uninstall' ) ), + grids.GridOperation( label="Reset to install", + condition=( lambda item: \ + ( item.status == tool_shed_install.ToolShedRepository.installation_status.ERROR ) ), allow_multiple=False, + url_args=dict( controller='admin_toolshed', + action='browse_repositories', + operation='reset to install' ) ), + grids.GridOperation( label="Activate or reinstall", condition=( lambda item: item.deleted ), - async_compatible=False, - url_args=dict( controller='admin_toolshed', action='browse_repositories', operation='activate or reinstall' ) ) ] + allow_multiple=False, + target=None, + url_args=dict( controller='admin_toolshed', + action='browse_repositories', + operation='activate or reinstall' ) ) ] standard_filters = [] default_filter = dict( deleted="False" ) num_rows_per_page = 50 diff -r 8ac00a14c7fd8fcf263184aeab4786a66cdb4b0e -r be5f0c5df96fba1a12e3e96fdb6f1805703f0b73 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 @@ -224,8 +224,9 @@ def get_installed_and_missing_repository_dependencies_for_new_install( trans, repo_info_tuple ): """ - Parse the received repository_dependencies dictionary that is associated with a repository being installed into Galaxy for the first time - and attempt to determine repository dependencies that are already installed and those that are not. + Parse the received repository_dependencies dictionary that is associated with a repository being + installed into Galaxy for the first time and attempt to determine repository dependencies that are + already installed and those that are not. """ missing_repository_dependencies = {} installed_repository_dependencies = {} @@ -236,20 +237,25 @@ if repository_dependencies: description = repository_dependencies[ 'description' ] root_key = repository_dependencies[ 'root_key' ] - # The repository dependencies container will include only the immediate repository dependencies of this repository, so the container will be - # only a single level in depth. + # The repository dependencies container will include only the immediate repository dependencies of + # this repository, so the container will be only a single level in depth. for key, rd_tups in repository_dependencies.items(): if key in [ 'description', 'root_key' ]: continue for rd_tup in rd_tups: tool_shed, name, owner, changeset_revision, prior_installation_required, only_if_compiling_contained_td = \ common_util.parse_repository_dependency_tuple( rd_tup ) - # Updates to installed repository revisions may have occurred, so make sure to locate the appropriate repository revision if one exists. - # We need to create a temporary repo_info_tuple that includes the correct repository owner which we get from the current rd_tup. The current - # tuple looks like: ( description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, installed_td ) + # Updates to installed repository revisions may have occurred, so make sure to locate the + # appropriate repository revision if one exists. We need to create a temporary repo_info_tuple + # that includes the correct repository owner which we get from the current rd_tup. The current + # tuple looks like: ( description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, + # repository_dependencies, installed_td ) tmp_clone_url = suc.generate_clone_url_from_repo_info_tup( rd_tup ) tmp_repo_info_tuple = ( None, tmp_clone_url, changeset_revision, None, owner, None, None ) - repository, installed_changeset_revision = suc.repository_was_previously_installed( trans, tool_shed, name, tmp_repo_info_tuple ) + repository, installed_changeset_revision = suc.repository_was_previously_installed( trans, + tool_shed, + name, + tmp_repo_info_tuple ) if repository: new_rd_tup = [ tool_shed, name, @@ -263,10 +269,11 @@ if new_rd_tup not in installed_rd_tups: installed_rd_tups.append( new_rd_tup ) else: - # A repository dependency that is not installed will not be considered missing if it's value for only_if_compiling_contained_td is - # True This is because this type of repository dependency will only be considered at the time that the specified tool dependency - # is being installed, and even then only if the compiled binary of the tool dependency could not be installed due to the unsupported - # installation environment. + # A repository dependency that is not installed will not be considered missing if it's value + # for only_if_compiling_contained_td is True This is because this type of repository dependency + # will only be considered at the time that the specified tool dependency is being installed, and + # even then only if the compiled binary of the tool dependency could not be installed due to the + # unsupported installation environment. if not util.asbool( only_if_compiling_contained_td ): if new_rd_tup not in missing_rd_tups: missing_rd_tups.append( new_rd_tup ) @@ -280,8 +287,8 @@ None, 'Never installed' ] if not util.asbool( only_if_compiling_contained_td ): - # A repository dependency that is not installed will not be considered missing if it's value for only_if_compiling_contained_td is - # True - see above... + # A repository dependency that is not installed will not be considered missing if it's value for + # only_if_compiling_contained_td is True - see above... if new_rd_tup not in missing_rd_tups: missing_rd_tups.append( new_rd_tup ) if installed_rd_tups: @@ -295,7 +302,10 @@ return installed_repository_dependencies, missing_repository_dependencies def get_installed_and_missing_tool_dependencies_for_installing_repository( trans, tool_shed_url, tool_dependencies_dict ): - """Return the lists of installed tool dependencies and missing tool dependencies for a set of repositories being installed into Galaxy.""" + """ + Return the lists of installed tool dependencies and missing tool dependencies for a set of repositories + being installed into Galaxy. + """ installed_tool_dependencies = {} missing_tool_dependencies = {} if tool_dependencies_dict: diff -r 8ac00a14c7fd8fcf263184aeab4786a66cdb4b0e -r be5f0c5df96fba1a12e3e96fdb6f1805703f0b73 lib/tool_shed/util/shed_util_common.py --- a/lib/tool_shed/util/shed_util_common.py +++ b/lib/tool_shed/util/shed_util_common.py @@ -1622,10 +1622,12 @@ def repository_was_previously_installed( trans, tool_shed_url, repository_name, repo_info_tuple ): """ - Find out if a repository is already installed into Galaxy - there are several scenarios where this is necessary. For example, this method - will handle the case where the repository was previously installed using an older changeset_revsion, but later the repository was updated - in the tool shed and now we're trying to install the latest changeset revision of the same repository instead of updating the one that was - previously installed. We'll look in the database instead of on disk since the repository may be currently uninstalled. + Find out if a repository is already installed into Galaxy - there are several scenarios where this + is necessary. For example, this method will handle the case where the repository was previously + installed using an older changeset_revsion, but later the repository was updated in the tool shed + and now we're trying to install the latest changeset revision of the same repository instead of + updating the one that was previously installed. We'll look in the database instead of on disk since + the repository may be currently uninstalled. """ description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, tool_dependencies = \ get_repo_info_tuple_contents( repo_info_tuple ) @@ -1638,8 +1640,8 @@ changeset_revision ) if tool_shed_repository: return tool_shed_repository, changeset_revision - # Get all previous changeset revisions from the tool shed for the repository back to, but excluding, the previous valid changeset - # revision to see if it was previously installed using one of them. + # Get all previous changeset revisions from the tool shed for the repository back to, but excluding, + # the previous valid changeset revision to see if it was previously installed using one of them. url = url_join( tool_shed_url, 'repository/previous_changeset_revisions?galaxy_url=%s&name=%s&owner=%s&changeset_revision=%s' % \ ( url_for( '/', qualified=True ), repository_name, repository_owner, changeset_revision ) ) 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.