1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/89a685c87b0e/ Changeset: 89a685c87b0e User: greg Date: 2014-01-26 18:16:33 Summary: Fixes for the tool shed's install and test framework. Affected #: 3 files diff -r 196401191eb2556d92063fa5784eb57cd03aa5b1 -r 89a685c87b0ee5a04b36bb2e48c5b0fe00dd1e74 lib/tool_shed/galaxy_install/tool_dependencies/install_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py @@ -228,6 +228,11 @@ package_version, dependent_install_dir, tool_dependency_type='package' ) + if not can_install_tool_dependency: + log.debug( "Tool dependency %s version %s cannot be installed (it was probably previously installed), " % \ + ( str( tool_dependency.name, str( tool_dependency.version ) ) ) ) + log.debug( "so appending it to the list of handled tool dependencies." ) + handled_tool_dependencies.append( tool_dependency ) else: can_install_tool_dependency = True if can_install_tool_dependency: @@ -271,8 +276,6 @@ package_version=package_version, tool_dependencies_config=config_to_use ) suc.remove_file( tmp_filename ) - else: - handled_tool_dependencies.append( tool_dependency ) else: message = "Unable to locate required tool shed repository named %s owned by %s with revision %s." % \ ( str( required_repository_name ), str( required_repository_owner ), str( default_required_repository_changeset_revision ) ) @@ -345,6 +348,10 @@ package_version, install_dir, tool_dependency_type='package' ) + if not can_install_tool_dependency: + log.debug( "Tool dependency %s version %s cannot be installed (it was probably previously installed), so returning it." % \ + ( str( tool_dependency.name, str( tool_dependency.version ) ) ) ) + return tool_dependency else: can_install_tool_dependency = True if can_install_tool_dependency: diff -r 196401191eb2556d92063fa5784eb57cd03aa5b1 -r 89a685c87b0ee5a04b36bb2e48c5b0fe00dd1e74 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 @@ -26,6 +26,7 @@ relationships are defined in the repository_dependencies entry for each dictionary in the received list of repo_info_dicts. Each of these dictionaries is associated with a repository in the received tool_shed_repositories list. """ + log.debug( "Building repository dependency relationships..." ) for repo_info_dict in repo_info_dicts: for name, repo_info_tuple in repo_info_dict.items(): description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, tool_dependencies = \ @@ -103,6 +104,7 @@ 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. all_created_or_updated_tool_shed_repositories = [] @@ -140,8 +142,12 @@ trans.install_model.ToolShedRepository.installation_status.INSTALLING_REPOSITORY_DEPENDENCIES, trans.install_model.ToolShedRepository.installation_status.INSTALLING_TOOL_DEPENDENCIES, trans.install_model.ToolShedRepository.installation_status.LOADING_PROPRIETARY_DATATYPES ]: - log.debug( "Skipping installation of tool_shed_repository '%s' because it's installation status is '%s'." % \ - ( str( repository_db_record.name ), str( repository_db_record.status ) ) ) + debug_msg = "Skipping installation of revision %s of repository '%s' because it was installed " % \ + ( str( changeset_revision ), str( repository_db_record.name ) ) + debug_msg += "with the (possibly updated) revision %s and it's current installation status is '%s'." % \ + ( str( installed_changeset_revision ), str( repository_db_record.status ) ) + log.debug( debug_msg ) + can_update_db_record = False else: if repository_db_record.status in [ trans.install_model.ToolShedRepository.installation_status.ERROR, trans.install_model.ToolShedRepository.installation_status.NEW, diff -r 196401191eb2556d92063fa5784eb57cd03aa5b1 -r 89a685c87b0ee5a04b36bb2e48c5b0fe00dd1e74 lib/tool_shed/util/tool_dependency_util.py --- a/lib/tool_shed/util/tool_dependency_util.py +++ b/lib/tool_shed/util/tool_dependency_util.py @@ -43,7 +43,9 @@ return tool_dependencies def create_or_update_tool_dependency( app, tool_shed_repository, name, version, type, status, set_status=True ): - # Called from Galaxy (never the tool shed) when a new repository is being installed or when an uninstalled repository is being reinstalled. + """Create or update a tool_dependency record in the Galaxy database.""" + # Called from Galaxy (never the tool shed) when a new repository is being installed or when an uninstalled + # repository is being reinstalled. context = app.install_model.context # First see if an appropriate tool_dependency record exists for the received tool_shed_repository. if version: @@ -51,7 +53,8 @@ else: tool_dependency = get_tool_dependency_by_name_type_repository( app, tool_shed_repository, name, type ) if tool_dependency: - # In some cases we should not override the current status of an existing tool_dependency, so do so only if set_status is True. + # In some cases we should not override the current status of an existing tool_dependency, so do so only + # if set_status is True. if set_status: if str( tool_dependency.status ) != str( status ): debug_msg = 'Updating an existing record for version %s of tool dependency %s for revision %s of repository %s ' % \ @@ -584,7 +587,12 @@ # Shed's install and test framework is running. The Tool Shed's install and test framework which installs repositories # in 2 stages, those of type tool_dependency_definition followed by those containing valid tools and tool functional # test components. - sa_session = app.install_model.context.current + log.debug( "Synchronizing the database with the file system..." ) + try: + log.debug( "The value of app.config.running_functional_tests is: %s" % str( app.config.running_functional_tests ) ) + except: + pass + sa_session = app.install_model.context can_install_tool_dependency = False tool_dependency = get_tool_dependency_by_name_version_type_repository( app, tool_shed_repository, @@ -618,9 +626,9 @@ # tool dependencies are not deleted by default, from the "install and test" framework.. tool_dependency.status = app.install_model.ToolDependency.installation_status.INSTALLED else: - error_message = 'The installation directory for this tool dependency had contents, but the database had no record. ' + error_message = 'The installation directory for this tool dependency had contents but the database had no record. ' error_message += 'The installation log may show this tool dependency to be correctly installed, but due to the ' - error_message += 'missing database record, it is automatically set to Error.' + error_message += 'missing database record it is now being set to Error.' tool_dependency.status = app.install_model.ToolDependency.installation_status.ERROR tool_dependency.error_message = error_message else: @@ -637,6 +645,11 @@ can_install_tool_dependency = True sa_session.add( tool_dependency ) sa_session.flush() + try: + log.debug( "Returning from sync_database_with_file_system with tool_dependency %s, can_install_tool_dependency %s." % \ + ( str( tool_dependency.name ), str( can_install_tool_dependency ) ) ) + except Exception, e: + log.debug( str( e ) ) return tool_dependency, can_install_tool_dependency def tool_dependency_is_orphan( type, name, version, tools ): 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.