commit/galaxy-central: greg: Fixes for 12257:9b337a87d6ec.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/196401191eb2/ Changeset: 196401191eb2 User: greg Date: 2014-01-26 16:15:33 Summary: Fixes for 12257:9b337a87d6ec. Affected #: 3 files diff -r 51798d8a3c92a2290537f6dcfb8f93e6f1371509 -r 196401191eb2556d92063fa5784eb57cd03aa5b1 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 @@ -171,7 +171,7 @@ return text -def handle_complex_repository_dependency_for_package( app, elem, package_name, package_version, tool_shed_repository ): +def handle_complex_repository_dependency_for_package( app, elem, package_name, package_version, tool_shed_repository, from_install_manager=False ): """ Inspect the repository defined by a complex repository dependency definition and take certain steps to enable installation of the received package name and version to proceed. The received elem is the <repository> tag set which defines the complex @@ -202,21 +202,32 @@ tool_dependency_version=package_version ) # Define this dependent repository's tool dependency installation directory that will contain the env.sh file with a path to the # required repository's installed tool dependency package. - dependent_install_dir = tool_dependency_util.get_tool_dependency_install_dir( app=app, - repository_name=tool_shed_repository.name, - repository_owner=tool_shed_repository.owner, - repository_changeset_revision=tool_shed_repository.installed_changeset_revision, - tool_dependency_type='package', - tool_dependency_name=package_name, - tool_dependency_version=package_version ) + dependent_install_dir = \ + tool_dependency_util.get_tool_dependency_install_dir( app=app, + repository_name=tool_shed_repository.name, + repository_owner=tool_shed_repository.owner, + repository_changeset_revision=tool_shed_repository.installed_changeset_revision, + tool_dependency_type='package', + tool_dependency_name=package_name, + tool_dependency_version=package_version ) if os.path.exists( dependent_install_dir ): - # Notice that we'll throw away the following tool_dependency if it can be installed. - tool_dependency, can_install_tool_dependency = tool_dependency_util.sync_database_with_file_system( app, - tool_shed_repository, - package_name, - package_version, - dependent_install_dir, - tool_dependency_type='package' ) + # The install manager handles tool migration stages and the sync_database_with_file_system() method handles two + # scenarios: (1) where a Galaxy file system environment related to installed tool shed repositories and tool dependencies + # has somehow (over time )gotten out of sync with the Galaxy database tables associated with these installed items, and + # (2) 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. Neither of + # these scenarios apply when the install manager is running. + if from_install_manager: + can_install_tool_dependency = True + else: + # Notice that we'll throw away the following tool_dependency if it can be installed. + tool_dependency, can_install_tool_dependency = \ + tool_dependency_util.sync_database_with_file_system( app, + tool_shed_repository, + package_name, + package_version, + dependent_install_dir, + tool_dependency_type='package' ) else: can_install_tool_dependency = True if can_install_tool_dependency: @@ -300,7 +311,8 @@ package_elem, package_name, package_version, - tool_shed_repository ) + tool_shed_repository, + from_install_manager=from_install_manager ) for rd_tool_dependency in rd_tool_dependencies: if rd_tool_dependency.status == app.install_model.ToolDependency.installation_status.ERROR: # We'll log the error here, but continue installing packages since some may not require this dependency. @@ -315,11 +327,17 @@ tool_dependency_type='package', tool_dependency_name=package_name, tool_dependency_version=package_version ) - can_install_tool_dependency = True if os.path.exists( install_dir ): - if not from_install_manager: + # The install manager handles tool migration stages and the sync_database_with_file_system() method handles two + # scenarios: (1) where a Galaxy file system environment related to installed tool shed repositories and tool dependencies + # has somehow (over time )gotten out of sync with the Galaxy database tables associated with these installed items, and + # (2) 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. Neither of + # these scenarios apply when the install manager is running. + if from_install_manager: + can_install_tool_dependency = True + else: # Notice that we'll throw away the following tool_dependency if it can be installed. - print 'Calling sync_database_with_file_system 2' tool_dependency, can_install_tool_dependency = \ tool_dependency_util.sync_database_with_file_system( app, tool_shed_repository, diff -r 51798d8a3c92a2290537f6dcfb8f93e6f1371509 -r 196401191eb2556d92063fa5784eb57cd03aa5b1 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 @@ -471,10 +471,12 @@ tool_dependency = tool_dependencies[ index ] if tool_dependency.can_install: # The database record is currently in a state that allows us to install the package on the file system. + log.debug( 'Attempting to install tool dependency package %s version %s.' % ( str( package_name ), str( package_version ) ) ) try: dependencies_ignored = not app.toolbox.dependency_manager.uses_tool_shed_dependencies() if dependencies_ignored: - log.debug( "Skipping package %s because tool shed dependency resolver not enabled." % str( package_name ) ) + log.debug( "Skipping installation of tool dependency package %s because tool shed dependency resolver not enabled." % \ + str( package_name ) ) # Tool dependency resolves have been configured and they do not include the tool shed. Do not install package. if app.toolbox.dependency_manager.find_dep( package_name, package_version, type='package') != INDETERMINATE_DEPENDENCY: ## TODO: Do something here such as marking it installed or @@ -493,7 +495,7 @@ tool_dependencies=tool_dependencies, from_install_manager=from_install_manager ) except Exception, e: - error_message = "Error installing tool dependency %s version %s: %s" % ( str( package_name ), str( package_version ), str( e ) ) + error_message = "Error installing tool dependency package %s version %s: %s" % ( str( package_name ), str( package_version ), str( e ) ) log.exception( error_message ) if tool_dependency: # Since there was an installation error, update the tool dependency status to Error. The remove_installation_path option must diff -r 51798d8a3c92a2290537f6dcfb8f93e6f1371509 -r 196401191eb2556d92063fa5784eb57cd03aa5b1 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 @@ -581,7 +581,9 @@ """ # This method should be reached very rarely. It implies that either the Galaxy environment became corrupted (i.e., # the database records for installed tool dependencies is not synchronized with tool dependencies on disk) or the Tool - # Shed's install and test framework is running. + # 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 can_install_tool_dependency = False tool_dependency = get_tool_dependency_by_name_version_type_repository( app, 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