commit/galaxy-central: 3 new changesets
3 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/31d00b1b6a9f/ Changeset: 31d00b1b6a9f User: dan Date: 2014-04-28 21:35:47 Summary: For setup_virtualenv: allow specifying to not use requirements file for pip install. Empirically, calling pip install PACKAGE may work better than using a requirements file with some package combinations. Specify a specific log file for pip to use during installation. Affected #: 1 file diff -r ef1ed48f60a5d6592d148ec55ff2f50dc3587035 -r 31d00b1b6a9f7ed88a74f03569b686e15558d196 lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py @@ -1139,7 +1139,22 @@ # POSIXLY_CORRECT forces shell commands . and source to have the same # and well defined behavior in bash/zsh. activate_command = "POSIXLY_CORRECT=1; . %s" % os.path.join( venv_directory, "bin", "activate" ) - install_command = "python '%s' install -r '%s'" % ( os.path.join( venv_directory, "bin", "pip" ), requirements_path ) + if action_dict[ 'use_requirements_file' ]: + install_command = "python '%s' install -r '%s' --log '%s'" % ( os.path.join( venv_directory, "bin", "pip" ), requirements_path, os.path.join( install_dir, 'pip_install.log' ) ) + else: + install_command = '' + with open( requirements_path, "rb" ) as f: + while True: + line = f.readline() + if not line: + break + line = line.strip() + if line: + line_install_command = "python '%s' install %s --log '%s'" % ( os.path.join( venv_directory, "bin", "pip" ), line, os.path.join( install_dir, 'pip_install_%s.log' % ( line ) ) ) + if not install_command: + install_command = line_install_command + else: + install_command = "%s && %s" % ( install_command, line_install_command ) full_setup_command = "%s; %s; %s" % ( setup_command, activate_command, install_command ) return_code = install_environment.handle_command( app, tool_dependency, install_dir, full_setup_command ) if return_code: @@ -1183,6 +1198,7 @@ # <action type="setup_virtualenv">pyyaml==3.2.0 # lxml==2.3.0</action> ## Manually specify contents of requirements.txt file to create dynamically. + action_dict[ 'use_requirements_file' ] = asbool( action_elem.get( 'use_requirements_file', True ) ) action_dict[ 'requirements' ] = td_common_util.evaluate_template( action_elem.text or 'requirements.txt', install_dir ) action_dict[ 'python' ] = action_elem.get( 'python', 'python' ) return action_dict https://bitbucket.org/galaxy/galaxy-central/commits/dd2f7cb5e0b1/ Changeset: dd2f7cb5e0b1 User: dan Date: 2014-04-28 21:39:55 Summary: merge default Affected #: 3 files diff -r 31d00b1b6a9f7ed88a74f03569b686e15558d196 -r dd2f7cb5e0b14f6410b3bf6c7262f25783e144e8 lib/galaxy/app.py --- a/lib/galaxy/app.py +++ b/lib/galaxy/app.py @@ -40,7 +40,8 @@ # Setup the database engine and ORM config_file = kwargs.get( 'global_conf', {} ).get( '__file__', None ) - self._configure_models( check_migrate_databases=True, check_migrate_tools=True, config_file=config_file ) + check_migrate_tools = self.config.check_migrate_tools + self._configure_models( check_migrate_databases=True, check_migrate_tools=check_migrate_tools, config_file=config_file ) # Manage installed tool shed repositories. from tool_shed.galaxy_install import installed_repository_manager diff -r 31d00b1b6a9f7ed88a74f03569b686e15558d196 -r dd2f7cb5e0b14f6410b3bf6c7262f25783e144e8 lib/galaxy/config.py --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -4,8 +4,12 @@ # absolute_import needed for tool_shed package. from __future__ import absolute_import -import sys, os, tempfile, re -import logging, logging.config +import os +import re +import sys +import tempfile +import logging +import logging.config import ConfigParser from datetime import timedelta from galaxy.web.formatting import expand_pretty_datetime_format @@ -23,11 +27,14 @@ path = os.path.join( root, path ) return path + class ConfigurationError( Exception ): pass + class Configuration( object ): deprecated_options = ( 'database_file', ) + def __init__( self, **kwargs ): self.config_dict = kwargs self.root = kwargs.get( 'root_dir', '.' ) @@ -87,6 +94,9 @@ self.user_section_filters = listify( kwargs.get( "user_tool_section_filters", [] ), do_strip=True ) self.tool_configs = [ resolve_path( p, self.root ) for p in listify( tcf ) ] + # Check for tools defined in the above non-shed tool configs (i.e., tool_conf.xml) tht have + # been migrated from the Galaxy code distribution to the Tool Shed. + self.check_migrate_tools = string_as_bool( kwargs.get( 'check_migrate_tools', True ) ) self.shed_tool_data_path = kwargs.get( "shed_tool_data_path", None ) if self.shed_tool_data_path: self.shed_tool_data_path = resolve_path( self.shed_tool_data_path, self.root ) @@ -397,13 +407,16 @@ return rval except ConfigParser.NoSectionError: return {} + def get( self, key, default ): return self.config_dict.get( key, default ) + def get_bool( self, key, default ): if key in self.config_dict: return string_as_bool( self.config_dict[key] ) else: return default + def check( self ): paths_to_check = [ self.root, self.tool_path, self.tool_data_path, self.template_path ] # Check that required directories exist @@ -488,7 +501,6 @@ rval[ key ] = value return rval - def configure_logging( config ): """ Allow some basic logging configuration to be read from ini file. diff -r 31d00b1b6a9f7ed88a74f03569b686e15558d196 -r dd2f7cb5e0b14f6410b3bf6c7262f25783e144e8 universe_wsgi.ini.sample --- a/universe_wsgi.ini.sample +++ b/universe_wsgi.ini.sample @@ -136,6 +136,13 @@ # Tools can be locally developed or installed from Galaxy tool sheds. #tool_config_file = tool_conf.xml,shed_tool_conf.xml +# Enable / disable checking if any tools defined in the above non-shed tool_config_files +# (i.e., tool_conf.xml) have been migrated from the Galaxy code distribution to the Tool +# Shed. This setting should generally be set to False only for development Galaxy environments +# that are often rebuilt from scratch where migrated tools do not need to be available in the +# Galaxy tool panel. If the following setting remains commented, the default setting will be True. +#check_migrate_tools = True + # Default path to the directory containing the tools defined in tool_conf.xml. # Other tool config files must include the tool_path as an attribute in the <toolbox> tag. #tool_path = tools https://bitbucket.org/galaxy/galaxy-central/commits/04befb2eb25b/ Changeset: 04befb2eb25b User: dan Date: 2014-04-28 21:40:15 Summary: merge default Affected #: 1 file diff -r dd2f7cb5e0b14f6410b3bf6c7262f25783e144e8 -r 04befb2eb25baa347a3f440ed22045d01e75ebc7 test/functional/api/test_tools.py --- a/test/functional/api/test_tools.py +++ b/test/functional/api/test_tools.py @@ -1,6 +1,4 @@ # Test tools API. -from itertools import chain - from base import api from operator import itemgetter from .helpers import DatasetPopulator @@ -13,22 +11,16 @@ self.dataset_populator = DatasetPopulator( self.galaxy_interactor ) def test_index( self ): - index = self._get( "tools" ) - tools_index = index.json() - # In panels by default, so flatten out sections... - tools = list( chain( *map( itemgetter( "elems" ), tools_index ) ) ) - tool_ids = map( itemgetter( "id" ), tools ) + tool_ids = self.__tool_ids() assert "upload1" in tool_ids - assert "cat1" in tool_ids def test_no_panel_index( self ): - index = self._get( "tools", data=dict(in_panel="false") ) + index = self._get( "tools", data=dict( in_panel="false" ) ) tools_index = index.json() # No need to flatten out sections, with in_panel=False, only tools are # returned. tool_ids = map( itemgetter( "id" ), tools_index ) assert "upload1" in tool_ids - assert "cat1" in tool_ids def test_upload1_paste( self ): history_id = self.dataset_populator.new_history() @@ -58,6 +50,7 @@ self.assertEquals( result_content, table ) def test_run_cat1( self ): + self.__skip_without_tool( "cat1" ) # Run simple non-upload tool with an input data parameter. history_id = self.dataset_populator.new_history() new_dataset = self.dataset_populator.new_dataset( history_id, content='Cat1Test' ) @@ -72,6 +65,7 @@ self.assertEqual( output1_content.strip(), "Cat1Test" ) def test_run_cat1_with_two_inputs( self ): + self.__skip_without_tool( "cat1" ) # Run tool with an multiple data parameter and grouping (repeat) history_id = self.dataset_populator.new_history() new_dataset1 = self.dataset_populator.new_dataset( history_id, content='Cat1Test' ) @@ -118,6 +112,25 @@ self._assert_status_code_is( display_response, 200 ) return display_response.content + def __tool_ids( self ): + index = self._get( "tools" ) + tools_index = index.json() + # In panels by default, so flatten out sections... + tools = [] + for tool_or_section in tools_index: + if "elems" in tool_or_section: + tools.extend( tool_or_section[ "elems" ] ) + else: + tools.append( tool_or_section ) + + tool_ids = map( itemgetter( "id" ), tools ) + return tool_ids + + def __skip_without_tool( self, tool_id ): + from nose.plugins.skip import SkipTest + if tool_id not in self.__tool_ids( ): + raise SkipTest( ) + def dataset_to_param( dataset ): return dict( 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