galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
July 2013
- 1 participants
- 83 discussions
commit/galaxy-central: Dave Bouvier: Tool shed functional tests for the $ENV[] environment variable inheritance feature.
by commits-noreply@bitbucket.org 24 Jul '13
by commits-noreply@bitbucket.org 24 Jul '13
24 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b42dfe74e237/
Changeset: b42dfe74e237
User: Dave Bouvier
Date: 2013-07-24 19:39:47
Summary: Tool shed functional tests for the $ENV[] environment variable inheritance feature.
Affected #: 14 files
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/base/twilltestcase.py
--- a/test/tool_shed/base/twilltestcase.py
+++ b/test/tool_shed/base/twilltestcase.py
@@ -578,12 +578,8 @@
return None
def get_env_sh_path( self, tool_dependency_name, tool_dependency_version, repository ):
- env_sh_path = os.path.join( self.galaxy_tool_dependency_dir,
- tool_dependency_name,
- tool_dependency_version,
- repository.owner,
- repository.name,
- repository.installed_changeset_revision,
+ '''Return the absolute path to an installed repository's env.sh file.'''
+ env_sh_path = os.path.join( self.get_tool_dependency_path( tool_dependency_name, tool_dependency_version, repository ),
'env.sh' )
return env_sh_path
@@ -604,6 +600,15 @@
else:
last_review = None
return last_review
+
+ def get_tool_dependency_path( self, tool_dependency_name, tool_dependency_version, repository ):
+ '''Return the absolute path for an installed tool dependency.'''
+ return os.path.join( self.galaxy_tool_dependency_dir,
+ tool_dependency_name,
+ tool_dependency_version,
+ repository.owner,
+ repository.name,
+ repository.installed_changeset_revision )
def get_or_create_repository( self, owner=None, strings_displayed=[], strings_not_displayed=[], **kwd ):
repository = test_db_util.get_repository_by_name_and_owner( kwd[ 'name' ], owner )
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/functional/test_1420_tool_dependency_environment_inheritance.py
--- /dev/null
+++ b/test/tool_shed/functional/test_1420_tool_dependency_environment_inheritance.py
@@ -0,0 +1,320 @@
+from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
+import tool_shed.base.test_db_util as test_db_util
+
+import logging
+log = logging.getLogger( __name__ )
+
+category_name = 'Test 1420 Tool dependency environment variable inheritance'
+category_description = 'Test script 1420 for interpolation of inherited environment variables.'
+package_atlas_repository_name = 'package_atlas_3_10_1420'
+package_bzlib_repository_name = 'package_bzlib_1_0_1420'
+package_boost_repository_name = 'package_boost_1_53_1420'
+package_numpy_repository_name = 'package_numpy_1_7_1420'
+package_rdkit_repository_name = 'package_rdkit_2012_12_1420'
+package_lapack_repository_name = 'package_lapack_3_4_1420'
+package_atlas_repository_description = 'Automatically Tuned Linear Algebra Software'
+package_bzlib_repository_description = 'Contains a tool dependency definition that downloads and compiles version 1.0 of the bzlib library.'
+package_boost_repository_description = 'Contains a tool dependency definition that downloads and compiles version 1.53 of the boost C++ libraries'
+package_numpy_repository_description = 'Contains a tool dependency definition that downloads and compiles version 1.7 of the the python numpy package'
+package_rdkit_repository_description = 'Contains a tool dependency definition that downloads and compiles version 2012-12 of the RDKit cheminformatics and machine-learning package.'
+package_lapack_repository_description = 'Linear Algebra PACKage'
+package_atlas_repository_long_description = '%s: %s' % ( package_atlas_repository_name, package_atlas_repository_description )
+package_bzlib_repository_long_description = '%s: %s' % ( package_bzlib_repository_name, package_bzlib_repository_description )
+package_boost_repository_long_description = '%s: %s' % ( package_boost_repository_name, package_boost_repository_description )
+package_numpy_repository_long_description = '%s: %s' % ( package_numpy_repository_name, package_numpy_repository_description )
+package_rdkit_repository_long_description = '%s: %s' % ( package_rdkit_repository_name, package_rdkit_repository_description )
+package_lapack_repository_long_description = '%s: %s' % ( package_lapack_repository_name, package_lapack_repository_description )
+
+'''
+1. Create repository package_lapack_3_4_1420
+
+2. Create repository package_atlas_3_10_1420
+
+3. Create repository package_bzlib_1_0_1420
+
+4. Create repository package_boost_1_53_1420
+
+5. Create repository package_numpy_1_7_1420
+
+6. Create repository package_rdkit_2012_12_1420
+
+Repository dependency structure should be as follows:
+ Repository package_rdkit_2012_12_1420
+ Repository package_boost_1_53_1420 (prior install required)
+ Repository package_bzlib_1_0_1420 (prior install required)
+ Repository package_numpy_1_7_1420 (prior install required)
+ Repository package_lapack_3_4_1420 (prior install required)
+ Repository package_atlas_3_10_1420 (prior install required)
+
+8. Install package_rdkit_2012_12 into Galaxy.
+
+9. Verify that the env.sh file for package_rdkit_2012_12_1420 also defines the variables inherited from package_numpy_1_7_1420 and package_boost_1_53_1420.
+'''
+
+class TestEnvironmentInheritance( ShedTwillTestCase ):
+ '''Test referencing environment variables that were defined in a separate tool dependency.'''
+
+ def test_0000_initiate_users_and_category( self ):
+ """Create necessary user accounts and login as an admin user."""
+ self.logout()
+ self.login( email=common.admin_email, username=common.admin_username )
+ admin_user = test_db_util.get_user( common.admin_email )
+ assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email
+ admin_user_private_role = test_db_util.get_private_role( admin_user )
+ self.create_category( name=category_name, description=category_description )
+ self.logout()
+ self.login( email=common.test_user_2_email, username=common.test_user_2_name )
+ test_user_2 = test_db_util.get_user( common.test_user_2_email )
+ assert test_user_2 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_2_email
+ test_user_2_private_role = test_db_util.get_private_role( test_user_2 )
+ self.logout()
+ self.login( email=common.test_user_1_email, username=common.test_user_1_name )
+ test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_1_email
+ test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+
+ def test_0005_create_lapack_repository( self ):
+ '''Create and populate package_lapack_3_4_1420.'''
+ '''
+ This is step 1 - Create repository package_lapack_3_4_1420.
+
+ All tool dependency definitions should download and extract a tarball containing precompiled binaries from the local
+ filesystem and install them into the path specified by $INSTALL_DIR.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=package_lapack_repository_name,
+ description=package_lapack_repository_description,
+ long_description=package_lapack_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Load the original tool dependency definition into memory, then fill in the __PATH__ placeholder with the
+ # actual system path where the binary tarball is found.
+ tool_dependency_path = self.generate_temp_path( '1420_tool_dependency', additional_paths=[ 'package_lapack_3_4_1420' ] )
+ precompiled_binary_tarball = self.get_filename( '1420_files/binary_tarballs/lapack.tar' )
+ edited_tool_dependency_filename = self.get_filename( filepath=tool_dependency_path, filename='tool_dependencies.xml' )
+ original_tool_dependency = self.get_filename( '1420_files/package_lapack_3_4_1420/tool_dependencies.xml' )
+ tool_dependency_definition = file( original_tool_dependency, 'r' ).read().replace( '__PATH__', precompiled_binary_tarball )
+ file( edited_tool_dependency_filename, 'w' ).write( tool_dependency_definition )
+ # Upload the edited tool dependency definition to the package_lapack_3_4_1420 repository.
+ self.upload_file( repository,
+ filename='tool_dependencies.xml',
+ filepath=tool_dependency_path,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_lapack_3_4_1420 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0010_create_atlas_repository( self ):
+ '''Create and populate package_atlas_3_10_1420.'''
+ '''
+ This is step 1 - Create repository package_atlas_3_10_1420.
+
+ All tool dependency definitions should download and extract a tarball containing precompiled binaries from the local
+ filesystem and install them into the path specified by $INSTALL_DIR.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=package_atlas_repository_name,
+ description=package_atlas_repository_description,
+ long_description=package_atlas_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Load the original tool dependency definition into memory, then fill in the __PATH__ placeholder with the
+ # actual system path where the binary tarball is found.
+ tool_dependency_path = self.generate_temp_path( '1420_tool_dependency', additional_paths=[ 'package_atlas_3_10_1420' ] )
+ precompiled_binary_tarball = self.get_filename( '1420_files/binary_tarballs/atlas.tar' )
+ edited_tool_dependency_filename = self.get_filename( filepath=tool_dependency_path, filename='tool_dependencies.xml' )
+ original_tool_dependency = self.get_filename( '1420_files/package_atlas_3_10_1420/tool_dependencies.xml' )
+ tool_dependency_definition = file( original_tool_dependency, 'r' ).read().replace( '__PATH__', precompiled_binary_tarball )
+ file( edited_tool_dependency_filename, 'w' ).write( tool_dependency_definition )
+ # Upload the edited tool dependency definition to the package_atlas_3_10_1420 repository.
+ self.upload_file( repository,
+ filename='tool_dependencies.xml',
+ filepath=tool_dependency_path,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_atlas_3_10_1420 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0015_create_bzlib_repository( self ):
+ '''Create and populate package_bzlib_1_0_1420.'''
+ '''
+ This is step 1 - Create repository package_bzlib_1_0_1420.
+
+ All tool dependency definitions should download and extract a tarball containing precompiled binaries from the local
+ filesystem and install them into the path specified by $INSTALL_DIR.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=package_bzlib_repository_name,
+ description=package_bzlib_repository_description,
+ long_description=package_bzlib_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Load the original tool dependency definition into memory, then fill in the __PATH__ placeholder with the
+ # actual system path where the binary tarball is found.
+ tool_dependency_path = self.generate_temp_path( '1420_tool_dependency', additional_paths=[ 'package_bzlib_1_0_1420' ] )
+ precompiled_binary_tarball = self.get_filename( '1420_files/binary_tarballs/bzlib.tar' )
+ edited_tool_dependency_filename = self.get_filename( filepath=tool_dependency_path, filename='tool_dependencies.xml' )
+ original_tool_dependency = self.get_filename( '1420_files/package_bzlib_1_0_1420/tool_dependencies.xml' )
+ tool_dependency_definition = file( original_tool_dependency, 'r' ).read().replace( '__PATH__', precompiled_binary_tarball )
+ file( edited_tool_dependency_filename, 'w' ).write( tool_dependency_definition )
+ # Upload the edited tool dependency definition to the package_bzlib_1_0_1420 repository.
+ self.upload_file( repository,
+ filename='tool_dependencies.xml',
+ filepath=tool_dependency_path,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_bzlib_1_0_1420 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0020_create_boost_repository( self ):
+ '''Create and populate package_boost_1_53_1420.'''
+ '''
+ This is step 1 - Create repository package_boost_1_53_1420.
+
+ All tool dependency definitions should download and extract a tarball containing precompiled binaries from the local
+ filesystem and install them into the path specified by $INSTALL_DIR.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=package_boost_repository_name,
+ description=package_boost_repository_description,
+ long_description=package_boost_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Load the original tool dependency definition into memory, then fill in the __PATH__ placeholder with the
+ # actual system path where the binary tarball is found.
+ tool_dependency_path = self.generate_temp_path( '1420_tool_dependency', additional_paths=[ 'package_boost_1_53_1420' ] )
+ precompiled_binary_tarball = self.get_filename( '1420_files/binary_tarballs/boost.tar' )
+ edited_tool_dependency_filename = self.get_filename( filepath=tool_dependency_path, filename='tool_dependencies.xml' )
+ original_tool_dependency = self.get_filename( '1420_files/package_boost_1_53_1420/tool_dependencies.xml' )
+ tool_dependency_definition = file( original_tool_dependency, 'r' ).read().replace( '__PATH__', precompiled_binary_tarball )
+ file( edited_tool_dependency_filename, 'w' ).write( tool_dependency_definition )
+ # Upload the edited tool dependency definition to the package_boost_1_53_1420 repository.
+ self.upload_file( repository,
+ filename='tool_dependencies.xml',
+ filepath=tool_dependency_path,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_boost_1_53_1420 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0025_create_numpy_repository( self ):
+ '''Create and populate package_numpy_1_7_1420.'''
+ '''
+ This is step 1 - Create repository package_numpy_1_7_1420.
+
+ All tool dependency definitions should download and extract a tarball containing precompiled binaries from the local
+ filesystem and install them into the path specified by $INSTALL_DIR.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=package_numpy_repository_name,
+ description=package_numpy_repository_description,
+ long_description=package_numpy_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Load the original tool dependency definition into memory, then fill in the __PATH__ placeholder with the
+ # actual system path where the binary tarball is found.
+ tool_dependency_path = self.generate_temp_path( '1420_tool_dependency', additional_paths=[ 'package_numpy_1_7_1420' ] )
+ precompiled_binary_tarball = self.get_filename( '1420_files/binary_tarballs/numpy.tar' )
+ edited_tool_dependency_filename = self.get_filename( filepath=tool_dependency_path, filename='tool_dependencies.xml' )
+ original_tool_dependency = self.get_filename( '1420_files/package_numpy_1_7_1420/tool_dependencies.xml' )
+ tool_dependency_definition = file( original_tool_dependency, 'r' ).read().replace( '__PATH__', precompiled_binary_tarball )
+ file( edited_tool_dependency_filename, 'w' ).write( tool_dependency_definition )
+ # Upload the edited tool dependency definition to the package_numpy_1_7_1420 repository.
+ self.upload_file( repository,
+ filename='tool_dependencies.xml',
+ filepath=tool_dependency_path,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_numpy_1_7_1420 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0030_create_rdkit_repository( self ):
+ '''Create and populate package_rdkit_2012_12_1420.'''
+ '''
+ This is step 1 - Create repository package_rdkit_2012_12_1420.
+
+ All tool dependency definitions should download and extract a tarball containing precompiled binaries from the local
+ filesystem and install them into the path specified by $INSTALL_DIR.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=package_rdkit_repository_name,
+ description=package_rdkit_repository_description,
+ long_description=package_rdkit_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Load the original tool dependency definition into memory, then fill in the __PATH__ placeholder with the
+ # actual system path where the binary tarball is found.
+ tool_dependency_path = self.generate_temp_path( '1420_tool_dependency', additional_paths=[ 'package_rdkit_2012_12_1420' ] )
+ precompiled_binary_tarball = self.get_filename( '1420_files/binary_tarballs/rdkit.tar' )
+ edited_tool_dependency_filename = self.get_filename( filepath=tool_dependency_path, filename='tool_dependencies.xml' )
+ original_tool_dependency = self.get_filename( '1420_files/package_rdkit_2012_12_1420/tool_dependencies.xml' )
+ tool_dependency_definition = file( original_tool_dependency, 'r' ).read().replace( '__PATH__', precompiled_binary_tarball )
+ file( edited_tool_dependency_filename, 'w' ).write( tool_dependency_definition )
+ # Upload the edited tool dependency definition to the package_rdkit_2012_12_1420 repository.
+ self.upload_file( repository,
+ filename='tool_dependencies.xml',
+ filepath=tool_dependency_path,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_rdkit_2012_12_1420 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0035_install_rdkit_2012_12_repository( self ):
+ '''Install the package_rdkit_2012_12_1420 repository into Galaxy.'''
+ '''
+ This is step 4 - Install package_rdkit_2012_12_1420 into Galaxy.
+
+ Install package_rdkit_2012_12_1420 with tool dependencies selected to be installed. The result of this should be
+ package_atlas_3_10_1420, package_bzlib_1_0_1420, package_boost_1_53_1420, package_numpy_1_7_1420, package_rdkit_2012_12_1420,
+ and package_lapack_3_4_1420 being installed, and an env.sh generated for package_rdkit_2012_12_1420 that
+ contains environment variables defined in package_boost_1_53_1420 and package_numpy_1_7_1420.
+ '''
+ self.galaxy_logout()
+ self.galaxy_login( email=common.admin_email, username=common.admin_username )
+ post_submit_strings_displayed = [ 'package_rdkit_2012_12_1420', 'package_atlas_3_10_1420', 'package_bzlib_1_0_1420',
+ 'package_numpy_1_7_1420', 'package_lapack_3_4_1420', 'package_boost_1_53_1420' ]
+ self.install_repository( 'package_rdkit_2012_12_1420',
+ common.test_user_1_name,
+ category_name,
+ install_tool_dependencies=True,
+ post_submit_strings_displayed=post_submit_strings_displayed )
+
+ def test_0040_verify_env_sh_contents( self ):
+ '''Check the env.sh file for the appropriate contents.'''
+ '''
+ This is step 5 - Verify that the env.sh file for package_rdkit_2012_12_1420 also defines the variables inherited from package_numpy_1_7_1420
+ and package_boost_1_53_1420. Test for the numpy and boost tool dependency paths.
+ '''
+ package_rdkit_repository = test_db_util.get_installed_repository_by_name_owner( 'package_rdkit_2012_12_1420', common.test_user_1_name )
+ package_numpy_repository = test_db_util.get_installed_repository_by_name_owner( 'package_numpy_1_7_1420', common.test_user_1_name )
+ package_boost_repository = test_db_util.get_installed_repository_by_name_owner( 'package_boost_1_53_1420', common.test_user_1_name )
+ rdkit_env_sh = self.get_env_sh_path( tool_dependency_name='rdkit',
+ tool_dependency_version='2012_12_1',
+ repository=package_rdkit_repository )
+ numpy_tool_dependency_path = self.get_tool_dependency_path( tool_dependency_name='numpy',
+ tool_dependency_version='1.7.1',
+ repository=package_numpy_repository )
+ boost_tool_dependency_path = self.get_tool_dependency_path( tool_dependency_name='boost',
+ tool_dependency_version='1.53.0',
+ repository=package_boost_repository )
+ rdkit_env_file_contents = file( rdkit_env_sh, 'r' ).read()
+ assert numpy_tool_dependency_path in rdkit_env_file_contents, 'Environment file for package_rdkit_2012_12_1420 does not contain numpy path.'
+ assert boost_tool_dependency_path in rdkit_env_file_contents, 'Environment file for package_rdkit_2012_12_1420 does not contain boost path.'
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/binary_tarballs/atlas.tar
Binary file test/tool_shed/test_data/1420_files/binary_tarballs/atlas.tar has changed
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/binary_tarballs/boost.tar
Binary file test/tool_shed/test_data/1420_files/binary_tarballs/boost.tar has changed
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/binary_tarballs/bzlib.tar
Binary file test/tool_shed/test_data/1420_files/binary_tarballs/bzlib.tar has changed
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/binary_tarballs/lapack.tar
Binary file test/tool_shed/test_data/1420_files/binary_tarballs/lapack.tar has changed
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/binary_tarballs/numpy.tar
Binary file test/tool_shed/test_data/1420_files/binary_tarballs/numpy.tar has changed
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/binary_tarballs/rdkit.tar
Binary file test/tool_shed/test_data/1420_files/binary_tarballs/rdkit.tar has changed
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/package_atlas_3_10_1420/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/1420_files/package_atlas_3_10_1420/tool_dependencies.xml
@@ -0,0 +1,22 @@
+<tool_dependency>
+ <package name="atlas" version="3.10.1">
+ <install version="1.0">
+ <actions>
+ <!-- first action is always downloading -->
+ <action type="download_file">file://__PATH__</action>
+ <action type="move_directory_files">
+ <source_directory>.</source_directory>
+ <destination_directory>$INSTALL_DIR</destination_directory>
+ </action>
+ <action type="set_environment">
+ <environment_variable name="ATLAS_LIB_DIR" action="set_to">$INSTALL_DIR/atlas/lib</environment_variable>
+ <environment_variable name="ATLAS_INCLUDE_DIR" action="set_to">$INSTALL_DIR/atlas/include</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>ATLAS_LIB_DIR and ATLAS_INCLUDE_DIR (including libatlas.a) will be exported for later use.
+ During ATLAS library compilation, ATLAS performs code efficiency checks. These checks can only provide optimal results, if "frequency scaling" is disabled on the CPU, and no other load-intense processes are running.
+ Ideally, you should compile on an empty cluster node with CPU frequency scaling disabled (see "cpufreq-selector" or "cpufreq-set").
+ </readme>
+ </package>
+</tool_dependency>
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/package_boost_1_53_1420/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/1420_files/package_boost_1_53_1420/tool_dependencies.xml
@@ -0,0 +1,29 @@
+<?xml version='1.0' encoding='utf-8'?>
+<tool_dependency>
+ <package name="bzlib" version="1.0.6">
+ <repository name="package_bzlib_1_0_1420" owner="user1" prior_installation_required="True" />
+ </package>
+ <package name="boost" version="1.53.0">
+ <install version="1.0">
+ <actions>
+ <action type="download_by_url">file://__PATH__</action>
+
+ <!-- populate the environment variables from the dependend repos -->
+ <action type="set_environment_for_install">
+ <repository name="package_bzlib_1_0_1420" owner="user1">
+ <package name="bzlib" version="1.0.6" />
+ </repository>
+ </action>
+ <action type="move_directory_files">
+ <source_directory>.</source_directory>
+ <destination_directory>$INSTALL_DIR</destination_directory>
+ </action>
+ <action type="set_environment">
+ <environment_variable action="set_to" name="BOOST_ROOT_DIR">$INSTALL_DIR/boost</environment_variable>
+ <environment_variable action="append_to" name="LD_LIBRARY_PATH">$INSTALL_DIR/boost/lib/</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>Compiling boost requires a C++ compiler (typically gcc). You can access the boost root directory through the $BOOST_ROOT_DIR system variable. All modules will be build.</readme>
+ </package>
+</tool_dependency>
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/package_bzlib_1_0_1420/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/1420_files/package_bzlib_1_0_1420/tool_dependencies.xml
@@ -0,0 +1,21 @@
+ <tool_dependency>
+ <package name="bzlib" version="1.0.6">
+ <install version="1.0">
+ <actions>
+ <!-- first action is always downloading -->
+ <action type="download_by_url">file://__PATH__</action>
+ <action type="move_directory_files">
+ <source_directory>.</source_directory>
+ <destination_directory>$INSTALL_DIR</destination_directory>
+ </action>
+ <action type="set_environment">
+ <environment_variable name="PATH" action="prepend_to">$INSTALL_DIR/bzlib/bin</environment_variable>
+ <environment_variable name="BZLIB_LIB_DIR" action="set_to">$INSTALL_DIR/bzlib/lib</environment_variable>
+ <environment_variable name="BZLIB_INCLUDE_DIR" action="set_to">$INSTALL_DIR/bzlib/include</environment_variable>
+ <environment_variable name="BZLIB_SOURCE_DIR" action="set_to">$INSTALL_DIR/bzlib/source</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>Compiling bzlib requires make and a C compiler. You can access bzlib with $BZLIB_LIB_DIR and $BZLIB_INCLUDE_DIR.</readme>
+ </package>
+</tool_dependency>
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/package_lapack_3_4_1420/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/1420_files/package_lapack_3_4_1420/tool_dependencies.xml
@@ -0,0 +1,18 @@
+<tool_dependency>
+ <package name="lapack" version="3.4.2">
+ <install version="1.0">
+ <actions>
+ <!-- first action is always downloading -->
+ <action type="download_by_url">file://__PATH__</action>
+ <action type="move_directory_files">
+ <source_directory>.</source_directory>
+ <destination_directory>$INSTALL_DIR</destination_directory>
+ </action>
+ <action type="set_environment">
+ <environment_variable name="LAPACK_LIB_DIR" action="set_to">$INSTALL_DIR/lapack/lib</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>LAPACK requires gcc and gfortran. LAPACK_LIB_DIR will be set (including liblapack.a and libblas.a). </readme>
+ </package>
+</tool_dependency>
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/package_numpy_1_7_1420/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/1420_files/package_numpy_1_7_1420/tool_dependencies.xml
@@ -0,0 +1,35 @@
+<?xml version='1.0' encoding='utf-8'?>
+<tool_dependency>
+ <package name="lapack" version="3.4.2">
+ <repository name="package_lapack_3_4_1420" owner="user1" prior_installation_required="True" />
+ </package>
+ <package name="atlas" version="3.10.1">
+ <repository name="package_atlas_3_10_1420" owner="user1" prior_installation_required="True" />
+ </package>
+ <package name="numpy" version="1.7.1">
+ <install version="1.0">
+ <actions>
+ <action type="download_by_url">file://__PATH__</action>
+ <action type="set_environment_for_install">
+ <repository name="package_atlas_3_10_1420" owner="user1">
+ <package name="atlas" version="3.10.1" />
+ </repository>
+ <repository name="package_lapack_3_4_1420" owner="user1">
+ <package name="lapack" version="3.4.2" />
+ </repository>
+ </action>
+ <action type="move_directory_files">
+ <source_directory>.</source_directory>
+ <destination_directory>$INSTALL_DIR</destination_directory>
+ </action>
+ <action type="set_environment">
+ <environment_variable action="append_to" name="PYTHONPATH">$INSTALL_DIR/lib/python</environment_variable>
+ <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable>
+ <environment_variable action="set_to" name="PYTHONPATH_NUMPY">$INSTALL_DIR/lib/python</environment_variable>
+ <environment_variable action="set_to" name="PATH_NUMPY">$INSTALL_DIR/bin</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>Compiling numpy requires a C and Fortran compiler (typically gcc and gfortran). The PYTHONPATH for numpy can be accessed through PYTHONPATH_NUMPY and the binaries with PATH_NUMPY.</readme>
+ </package>
+</tool_dependency>
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/package_rdkit_2012_12_1420/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/1420_files/package_rdkit_2012_12_1420/tool_dependencies.xml
@@ -0,0 +1,43 @@
+<?xml version='1.0' encoding='utf-8'?>
+<tool_dependency>
+ <package name="numpy" version="1.7.1">
+ <repository name="package_numpy_1_7_1420" owner="user1" prior_installation_required="True" />
+ </package>
+ <package name="boost" version="1.53.0">
+ <repository name="package_boost_1_53_1420" owner="user1" prior_installation_required="True" />
+ </package>
+
+ <package name="rdkit" version="2012_12_1">
+ <install version="1.0">
+ <actions>
+ <!-- first action is always downloading -->
+ <action type="download_by_url">file://__PATH__</action>
+
+ <!-- populate the environment variables from the dependend repos -->
+ <action type="set_environment_for_install">
+ <repository name="package_numpy_1_7_1420" owner="user1">
+ <package name="numpy" version="1.7.1" />
+ </repository>
+ <repository name="package_boost_1_53_1420" owner="user1">
+ <package name="boost" version="1.53.0" />
+ </repository>
+ </action>
+
+ <!-- PYTHONPATH_NUMPY is set in the numpy package -->
+ <action type="move_directory_files">
+ <source_directory>.</source_directory>
+ <destination_directory>$INSTALL_DIR</destination_directory>
+ </action>
+ <action type="set_environment">
+ <environment_variable action="set_to" name="RDBASE">$INSTALL_DIR/rdkit</environment_variable>
+ <environment_variable action="append_to" name="LD_LIBRARY_PATH">$INSTALL_DIR/rdkit/lib/</environment_variable>
+ <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/rdkit/bin</environment_variable>
+ <environment_variable action="prepend_to" name="PYTHONPATH">$INSTALL_DIR/rdkit/lib/python2.7/site-packages/</environment_variable>
+ <environment_variable action="prepend_to" name="PYTHONPATH">$ENV[PYTHONPATH_NUMPY]</environment_variable>
+ <environment_variable action="append_to" name="LD_LIBRARY_PATH">$ENV[BOOST_ROOT_DIR]/lib/</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>Compiling rdkit requires cmake, python headers, sqlite3, flex and bison.</readme>
+ </package>
+</tool_dependency>
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.
1
0
commit/galaxy-central: carlfeberhard: History panel: remove profiling methods
by commits-noreply@bitbucket.org 24 Jul '13
by commits-noreply@bitbucket.org 24 Jul '13
24 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b9bd309b4b72/
Changeset: b9bd309b4b72
User: carlfeberhard
Date: 2013-07-24 17:06:51
Summary: History panel: remove profiling methods
Affected #: 3 files
diff -r 6fa490b703b062231da599fdd7f169d84eddc930 -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 lib/galaxy/web/base/controller.py
--- a/lib/galaxy/web/base/controller.py
+++ b/lib/galaxy/web/base/controller.py
@@ -631,72 +631,6 @@
return trans.security.encode_dict_ids( hda_dict )
- def profile_get_hda_dict( self, trans, hda ):
- """Profiles returning full details of this HDA in dictionary form.
- """
- from galaxy.util.debugging import SimpleProfiler
- profiler = SimpleProfiler()
- profiler.start()
-
- hda_dict = hda.get_api_value( view='element' )
- profiler.report( '\t\t get_api_value' )
- history = hda.history
- hda_dict[ 'api_type' ] = "file"
-
- # Add additional attributes that depend on trans can hence must be added here rather than at the model level.
- can_access_hda = trans.app.security_agent.can_access_dataset( trans.get_current_user_roles(), hda.dataset )
- can_access_hda = ( trans.user_is_admin() or can_access_hda )
- hda_dict[ 'accessible' ] = can_access_hda
- profiler.report( '\t\t accessible' )
-
- # ---- return here if deleted AND purged OR can't access
- purged = ( hda.purged or hda.dataset.purged )
- if ( hda.deleted and purged ) or not can_access_hda:
- #TODO: get_api_value should really go AFTER this - only summary data
- return ( profiler, trans.security.encode_dict_ids( hda_dict ) )
-
- if trans.user_is_admin() or trans.app.config.expose_dataset_path:
- hda_dict[ 'file_name' ] = hda.file_name
- profiler.report( '\t\t file_name' )
-
- hda_dict[ 'download_url' ] = url_for( 'history_contents_display',
- history_id = trans.security.encode_id( history.id ),
- history_content_id = trans.security.encode_id( hda.id ) )
- profiler.report( '\t\t download_url' )
-
- # indeces, assoc. metadata files, etc.
- meta_files = []
- for meta_type in hda.metadata.spec.keys():
- if isinstance( hda.metadata.spec[ meta_type ].param, FileParameter ):
- meta_files.append( dict( file_type=meta_type ) )
- if meta_files:
- hda_dict[ 'meta_files' ] = meta_files
- profiler.report( '\t\t meta_files' )
-
- # currently, the viz reg is optional - handle on/off
- if trans.app.visualizations_registry:
- hda_dict[ 'visualizations' ] = trans.app.visualizations_registry.get_visualizations( trans, hda )
- else:
- hda_dict[ 'visualizations' ] = hda.get_visualizations()
- profiler.report( '\t\t visualizations' )
- #TODO: it may also be wiser to remove from here and add as API call that loads the visualizations
- # when the visualizations button is clicked (instead of preloading/pre-checking)
-
- # ---- return here if deleted
- if hda.deleted and not purged:
- return ( profiler, trans.security.encode_dict_ids( hda_dict ) )
-
- # if a tool declares 'force_history_refresh' in its xml, when the hda -> ready, reload the history panel
- # expensive
- if( ( hda.state in [ 'running', 'queued' ] )
- and ( hda.creating_job and hda.creating_job.tool_id ) ):
- tool_used = trans.app.toolbox.get_tool( hda.creating_job.tool_id )
- if tool_used and tool_used.force_history_refresh:
- hda_dict[ 'force_history_refresh' ] = True
- profiler.report( '\t\t force_history_refresh' )
-
- return ( profiler, trans.security.encode_dict_ids( hda_dict ) )
-
def get_hda_dict_with_error( self, trans, hda, error_msg='' ):
return trans.security.encode_dict_ids({
'id' : hda.id,
diff -r 6fa490b703b062231da599fdd7f169d84eddc930 -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 lib/galaxy/webapps/galaxy/controllers/root.py
--- a/lib/galaxy/webapps/galaxy/controllers/root.py
+++ b/lib/galaxy/webapps/galaxy/controllers/root.py
@@ -157,76 +157,6 @@
history_json = to_json_string( history_dictionary ), hda_json = to_json_string( hda_dictionaries ),
show_deleted=show_deleted, show_hidden=show_hidden, hda_id=hda_id, log=log, message=message, status=status )
- @web.expose
- def profile_history( self, trans, as_xml=False, show_deleted=None, show_hidden=None, hda_id=None, **kwd ):
- """
- Same as above but adds SimpleProfiler to get some
- profiling times for the operations done.
- """
- if as_xml:
- return self.history_as_xml( trans,
- show_deleted=string_as_bool( show_deleted ), show_hidden=string_as_bool( show_hidden ) )
-
- # get all datasets server-side, client-side will get flags and render appropriately
- show_deleted = string_as_bool_or_none( show_deleted )
- show_purged = show_deleted
- show_hidden = string_as_bool_or_none( show_hidden )
- params = Params( kwd )
- message = params.get( 'message', '' )
- #TODO: ugh...
- message = message if message != 'None' else ''
- status = params.get( 'status', 'done' )
-
- if trans.app.config.require_login and not trans.user:
- return trans.fill_template( '/no_access.mako', message = 'Please log in to access Galaxy histories.' )
-
- def err_msg( where=None ):
- where = where if where else 'getting the history data from the server'
- err_msg = ( 'An error occurred %s. '
- + 'Please contact a Galaxy administrator if the problem persists.' ) %( where )
- return err_msg, 'error'
-
- profiler = SimpleProfiler()
- profiler.start()
-
- history_dictionary = {}
- hda_dictionaries = []
- import pprint
- try:
- history = trans.get_history( create=True )
- profiler.report( 'trans.get_history' )
- hdas = self.get_history_datasets( trans, history,
- show_deleted=True, show_hidden=True, show_purged=True )
- profiler.report( 'get_history_datasets' )
-
- for hda in hdas:
- try:
- ( hda_profiler, hda_dict ) = self.profile_get_hda_dict( trans, hda )
- profiler.reports.extend( hda_profiler.get_reports() )
- profiler.report( '\t hda -> dictionary (%s)' %( hda.name ) )
- hda_dictionaries.append( hda_dict )
-
- except Exception, exc:
- # don't fail entire list if hda err's, record and move on
- log.error( 'Error bootstrapping hda %d: %s', hda.id, str( exc ), exc_info=True )
- hda_dictionaries.append( self.get_hda_dict_with_error( trans, hda, str( exc ) ) )
- profiler.report( 'hdas -> dictionaries' )
-
- # re-use the hdas above to get the history data...
- history_dictionary = self.get_history_dict( trans, history, hda_dictionaries=hda_dictionaries )
- profiler.report( 'history -> dictionary' )
-
- except Exception, exc:
- user_id = str( trans.user.id ) if trans.user else '(anonymous)'
- log.error( 'Error bootstrapping history for user %s: %s', user_id, str( exc ), exc_info=True )
- message, status = err_msg()
- history_dictionary[ 'error' ] = message
-
- return trans.stream_template_mako( "root/history.mako",
- history_json = to_json_string( history_dictionary ), hda_json = to_json_string( hda_dictionaries ),
- show_deleted=show_deleted, show_hidden=show_hidden, hda_id=hda_id, log=log, message=message, status=status,
- profiling=profiler.get_reports() )
-
## ---- Dataset display / editing ----------------------------------------
@web.expose
def display( self, trans, id=None, hid=None, tofile=None, toext=".txt", **kwd ):
diff -r 6fa490b703b062231da599fdd7f169d84eddc930 -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 templates/webapps/galaxy/root/history.mako
--- a/templates/webapps/galaxy/root/history.mako
+++ b/templates/webapps/galaxy/root/history.mako
@@ -213,10 +213,6 @@
galaxyPageSetUp();
// ostensibly, this is the App
- %if 'profiling' in self.context.kwargs:
- Galaxy.profiling = ${h.to_json_string( profiling )}.join( '\n' );
- %endif
-
//NOTE: for debugging on non-local instances (main/test)
// 1. load history panel in own tab
// 2. from console: new PersistantStorage( '__history_panel' ).set( 'debugging', true )
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.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/881a16a71891/
Changeset: 881a16a71891
User: Dave Bouvier
Date: 2013-07-24 16:54:37
Summary: Tool shed functional tests for the repository type feature.
Affected #: 9 files
diff -r 27b458743a117b5fb119915dc89bddc017625146 -r 881a16a718913fad393369059afe982ecb6b77bc test/tool_shed/base/twilltestcase.py
--- a/test/tool_shed/base/twilltestcase.py
+++ b/test/tool_shed/base/twilltestcase.py
@@ -453,15 +453,15 @@
original_information = dict( repo_name=repository.name, description=repository.description, long_description=repository.long_description )
strings_displayed = []
strings_not_displayed = []
- for input_elem_name in [ 'repo_name', 'description', 'long_description' ]:
+ for input_elem_name in [ 'repo_name', 'description', 'long_description', 'repository_type' ]:
if input_elem_name in kwd:
- tc.fv( "1", input_elem_name, kwd[ input_elem_name ] )
+ tc.fv( "edit_repository", input_elem_name, kwd[ input_elem_name ] )
strings_displayed.append( self.escape_html( kwd[ input_elem_name ] ) )
tc.submit( "edit_repository_button" )
self.check_for_strings( strings_displayed )
strings_displayed = []
for input_elem_name in [ 'repo_name', 'description', 'long_description' ]:
- tc.fv( "1", input_elem_name, original_information[ input_elem_name ] )
+ tc.fv( "edit_repository", input_elem_name, original_information[ input_elem_name ] )
strings_displayed.append( self.escape_html( original_information[ input_elem_name ] ) )
tc.submit( "edit_repository_button" )
self.check_for_strings( strings_displayed )
@@ -577,6 +577,16 @@
return datatypes_count.group( 1 )
return None
+ def get_env_sh_path( self, tool_dependency_name, tool_dependency_version, repository ):
+ env_sh_path = os.path.join( self.galaxy_tool_dependency_dir,
+ tool_dependency_name,
+ tool_dependency_version,
+ repository.owner,
+ repository.name,
+ repository.installed_changeset_revision,
+ 'env.sh' )
+ return env_sh_path
+
def get_filename( self, filename, filepath=None ):
if filepath is not None:
return os.path.abspath( os.path.join( filepath, filename ) )
diff -r 27b458743a117b5fb119915dc89bddc017625146 -r 881a16a718913fad393369059afe982ecb6b77bc test/tool_shed/functional/test_0470_tool_dependency_repository_type.py
--- /dev/null
+++ b/test/tool_shed/functional/test_0470_tool_dependency_repository_type.py
@@ -0,0 +1,253 @@
+from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
+import tool_shed.base.test_db_util as test_db_util
+
+import logging
+log = logging.getLogger( __name__ )
+
+category_name = 'Test 0470 Tool dependency repository type'
+category_description = 'Test script 0470 for changing repository types.'
+package_libx11_repository_name = 'package_x11_client_1_5_proto_7_0_0470'
+package_libx11_repository_description = "Contains a tool dependency definition that provides the X11 client libraries and core protocol header files."
+package_libx11_repository_long_description = "Xlib is an X Window System protocol client library written in the C programming language."
+package_emboss_repository_name = 'package_emboss_5_0_0_0470'
+package_emboss_repository_description = "Contains a tool dependency definition that downloads and compiles version 5.0.0 of the EMBOSS tool suite."
+package_emboss_repository_long_description = 'EMBOSS is "The European Molecular Biology Open Software Suite".'
+datatypes_repository_name = 'emboss_datatypes_0470'
+datatypes_repository_description = 'Galaxy applicable data formats used by Emboss tools.'
+datatypes_repository_long_description = 'Galaxy applicable data formats used by Emboss tools. This repository contains no tools.'
+emboss_repository_name = 'emboss_5_0470'
+emboss_repository_description = "Galaxy wrappers for Emboss version 5.0.0 tools"
+emboss_repository_long_description = "Galaxy wrappers for Emboss version 5.0.0 tools"
+
+'''
+1. Create and populate a repository named package_x11_client_1_5_proto_7_0 that contains only a single file named tool_dependencies.xml.
+ Keep the repository type as the default "Unrestricted".
+
+2. Create a repository named package_emboss_5_0_0 of type "Unrestricted" that has a repository dependency definition that defines the
+ above package_x11_client_1_5_proto_7_0 repository. Upload the tool_dependencies.xml file such that it does not have a changeset_revision
+ defined so it will get automatically populated.
+
+3. Create a repository named emboss_5 of type "Unrestricted" that has a tool-dependencies.xml file defining a complex repository dependency
+ on the package_emboss_5_0_0 repository above. Upload the tool_dependencies.xml file such that it does not have a change set_revision defined
+ so it will get automatically populated.
+
+4. Add a comment to the tool_dependencies.xml file to be uploaded to the package_x11_client_1_5_prot_7_0 repository, creating a new installable
+ changeset revision at the repository tip.
+
+5. Add a comment to the tool_dependencies.xml file for the package_emboss_5_0_0 repository, eliminating the change set_revision attribute so
+ that it gets automatically populated when uploaded. After uploading the file, the package_emboss_5_0_0 repository should have 2
+ installable changeset revisions.
+
+6. Add a comment to the tool_dependencies.xml file in the emboss_5 repository, eliminating the changeset_revision attribute so that it gets
+ automatically populated when uploaded. After uploading the file, the emboss5 repository should have 2 installable metadata revisions.
+
+7. Change the repository type of the package_x11_client_1_5_proto_7_0 repository to be tool_dependency_definition.
+
+8. Change the repository type of the package_emboss_5_0_0 repository to be tool_dependency_definition.
+
+9. Reset metadata on the package_emboss_5_0_0 repository. It should now have only it's tip as the installable revision.
+
+10. Reset metadata on the emboss_5 repository. It should now have only it's tip as the installable revision.
+'''
+
+class TestEnvironmentInheritance( ShedTwillTestCase ):
+ '''Test referencing environment variables that were defined in a separate tool dependency.'''
+
+ def test_0000_initiate_users_and_category( self ):
+ """Create necessary user accounts and login as an admin user."""
+ self.logout()
+ self.login( email=common.admin_email, username=common.admin_username )
+ admin_user = test_db_util.get_user( common.admin_email )
+ assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email
+ admin_user_private_role = test_db_util.get_private_role( admin_user )
+ self.create_category( name=category_name, description=category_description )
+ self.logout()
+ self.login( email=common.test_user_2_email, username=common.test_user_2_name )
+ test_user_2 = test_db_util.get_user( common.test_user_2_email )
+ assert test_user_2 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_2_email
+ test_user_2_private_role = test_db_util.get_private_role( test_user_2 )
+ self.logout()
+ self.login( email=common.test_user_1_email, username=common.test_user_1_name )
+ test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_1_email
+ test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+
+ def test_0005_create_libx11_repository( self ):
+ '''Create and populate package_x11_client_1_5_proto_7_0_0470.'''
+ '''
+ This is step 1 - Create and populate a repository named package_x11_client_1_5_proto_7_0.
+
+ Create and populate a repository named package_x11_client_1_5_proto_7_0 that contains only a single file named tool_dependencies.xml.
+ Keep the repository type as the default "Unrestricted".
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=package_libx11_repository_name,
+ description=package_libx11_repository_description,
+ long_description=package_libx11_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Upload the tool dependency definition to the package_x11_client_1_5_proto_7_0_0470 repository.
+ self.upload_file( repository,
+ filename='emboss/libx11_proto/first_tool_dependency/tool_dependencies.xml',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_x11_client_1_5_proto_7_0_0470 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0010_create_emboss_5_0_0_repository( self ):
+ '''Create and populate package_emboss_5_0_0_0470.'''
+ '''
+ This is step 2 - Create a repository named package_emboss_5_0_0 of type "Unrestricted".
+
+ Create a repository named package_emboss_5_0_0 of type "Unrestricted" that has a repository dependency definition that defines the
+ above package_x11_client_1_5_proto_7_0 repository. Upload the tool_dependencues.xml file such that it does not have a changeset_revision
+ defined so it will get automatically populated.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=package_emboss_repository_name,
+ description=package_emboss_repository_description,
+ long_description=package_emboss_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Upload the edited tool dependency definition to the package_emboss_5_0_0 repository.
+ self.upload_file( repository,
+ filename='emboss/emboss_5_0_0/first_tool_dependency/tool_dependencies.xml',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_emboss_5_0_0_0470 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0015_create_emboss_5_repository( self ):
+ '''Create and populate emboss_5_0470.'''
+ '''
+ This is step 3 - Create a repository named emboss_5 of type "Unrestricted".
+
+ Create a repository named emboss_5 of type "Unrestricted" that has a tool-dependencies.xml file defining a complex repository dependency
+ on the package_emboss_5_0_0 repository above. Upload the tool_dependencies.xml file such that it does not have a change set_revision defined
+ so it will get automatically populated.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=emboss_repository_name,
+ description=emboss_repository_description,
+ long_description=emboss_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Populate emboss_5 with tool and dependency definitions.
+ self.upload_file( repository,
+ filename='emboss/0470_files/emboss_complex_dependency.tar',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=True,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate emboss_5 with tool and dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0020_upload_updated_tool_dependency_to_package_x11( self ):
+ '''Upload a new tool_dependencies.xml to package_x11_client_1_5_proto_7_0_0470.'''
+ '''
+ This is step 4 - Add a comment to the tool_dependencies.xml file to be uploaded to the package_x11_client_1_5_prot_7_0 repository, creating
+ a new installable changeset revision at the repository tip.
+ '''
+ package_x11_repository = test_db_util.get_repository_by_name_and_owner( package_libx11_repository_name, common.test_user_1_name )
+ # Upload the tool dependency definition to the package_x11_client_1_5_proto_7_0_0470 repository.
+ self.upload_file( package_x11_repository,
+ filename='emboss/libx11_proto/second_tool_dependency/tool_dependencies.xml',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_x11_client_1_5_proto_7_0_0470 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+ assert len( package_x11_repository.metadata_revisions ) == 1, 'package_x11_client_1_5_proto_7_0_0470 has incorrect number of metadata revisions'
+
+ def test_0025_upload_updated_tool_dependency_to_package_emboss( self ):
+ '''Upload a new tool_dependencies.xml to package_emboss_5_0_0_0470.'''
+ '''
+ This is step 5 - Add a comment to the tool_dependencies.xml file for the package_emboss_5_0_0 repository, eliminating
+ the change set_revision attribute so that it gets automatically populated when uploaded. After uploading the file,
+ the package_emboss_5_0_0 repository should have 2 installable changeset revisions.
+ '''
+ package_emboss_repository = test_db_util.get_repository_by_name_and_owner( package_emboss_repository_name, common.test_user_1_name )
+ # Populate package_emboss_5_0_0_0470 with updated tool dependency definition.
+ self.upload_file( package_emboss_repository,
+ filename='emboss/emboss_5_0_0/second_tool_dependency/tool_dependencies.xml',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_emboss_5_0_0_0470 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+ assert len( package_emboss_repository.metadata_revisions ) == 2, 'package_emboss_5_0_0_0470 has incorrect number of metadata revisions'
+
+ def test_0030_upload_updated_tool_dependency_to_emboss_5_repository( self ):
+ '''Upload a new tool_dependencies.xml to emboss_5_0470.'''
+ '''
+ This is step 6 - Add a comment to the tool_dependencies.xml file in the emboss_5 repository, eliminating the
+ changeset_revision attribute so that it gets automatically populated when uploaded. After uploading the file,
+ the emboss5 repository should have 2 installable metadata revisions.
+ '''
+ emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ # Populate package_emboss_5_0_0_0470 with updated tool dependency definition.
+ self.upload_file( emboss_repository,
+ filename='emboss/0470_files/tool_dependencies.xml',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Upload updated complex repository dependency definition to emboss_5_0470.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+ assert len( emboss_repository.metadata_revisions ) == 2, 'package_emboss_5_0_0_0470 has incorrect number of metadata revisions'
+
+ def test_0035_modify_package_x11_repository_type( self ):
+ '''Set package_x11_client_1_5_proto_7_0 type tool_dependency_definition.'''
+ '''
+ This is step 7 - Change the repository type of the package_x11_client_1_5_proto_7_0 repository to be tool_dependency_definition.
+ '''
+ package_x11_repository = test_db_util.get_repository_by_name_and_owner( package_libx11_repository_name, common.test_user_1_name )
+ self.edit_repository_information( package_x11_repository, repository_type='tool_dependency_definition' )
+
+ def test_0040_modify_package_emboss_repository_type( self ):
+ '''Set package_emboss_5_0_0 to type tool_dependency_definition.'''
+ '''
+ This is step 8 - Change the repository type of the package_emboss_5_0_0 repository to be tool_dependency_definition.
+ '''
+ package_emboss_repository = test_db_util.get_repository_by_name_and_owner( package_emboss_repository_name, common.test_user_1_name )
+ self.edit_repository_information( package_emboss_repository, repository_type='tool_dependency_definition' )
+
+ def test_0045_reset_repository_metadata( self ):
+ '''Reset metadata on package_emboss_5_0_0_0470 and package_x11_client_1_5_proto_7_0.'''
+ '''
+ This is step 9 - Reset metadata on the package_emboss_5_0_0 and package_x11_client_1_5_proto_7_0 repositories. They should
+ now have only their tip as the installable revision.
+ '''
+ package_emboss_repository = test_db_util.get_repository_by_name_and_owner( package_emboss_repository_name, common.test_user_1_name )
+ package_x11_repository = test_db_util.get_repository_by_name_and_owner( package_libx11_repository_name, common.test_user_1_name )
+ self.reset_repository_metadata( package_emboss_repository )
+ self.reset_repository_metadata( package_x11_repository )
+ assert len( package_emboss_repository.metadata_revisions ) == 1, 'Repository package_emboss_5_0_0 has %d installable revisions, expected 1.' % \
+ len( package_emboss_repository.metadata_revisions )
+ assert len( package_x11_repository.metadata_revisions ) == 1, 'Repository package_x11_client_1_5_proto_7_0 has %d installable revisions, expected 1.' % \
+ len( package_x11_repository.metadata_revisions )
+
+ def test_0050_reset_emboss_5_metadata( self ):
+ '''Reset metadata on emboss_5.'''
+ '''
+ This is step 10 - Reset metadata on the emboss_5 repository. It should now have only it's tip as the installable revision.
+ '''
+ emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ self.reset_repository_metadata( emboss_repository )
+ assert len( emboss_repository.metadata_revisions ) == 1, 'Repository emboss_5 has %d installable revisions, expected 1.' % \
+ len( emboss_repository.metadata_revisions )
diff -r 27b458743a117b5fb119915dc89bddc017625146 -r 881a16a718913fad393369059afe982ecb6b77bc test/tool_shed/functional/test_1100_install_repository_with_complex_dependencies.py
--- a/test/tool_shed/functional/test_1100_install_repository_with_complex_dependencies.py
+++ b/test/tool_shed/functional/test_1100_install_repository_with_complex_dependencies.py
@@ -56,7 +56,7 @@
uncompress_file=False,
remove_repo_files_not_in_tar=False,
commit_message='Uploaded tool_dependencies.xml.',
- strings_displayed=[ 'The settings for <b>name</b>, <b>version</b> and <b>type</b> from a contained tool' ],
+ strings_displayed=[ 'This repository currently contains a single file named <b>tool_dependencies.xml</b>' ],
strings_not_displayed=[] )
self.display_manage_repository_page( repository, strings_displayed=[ 'Tool dependencies', 'may not be', 'in this repository' ] )
@@ -262,13 +262,9 @@
'''Verify that the generated env.sh contains the right data.'''
base_repository = test_db_util.get_installed_repository_by_name_owner( bwa_base_repository_name, common.test_user_1_name )
tool_repository = test_db_util.get_installed_repository_by_name_owner( bwa_package_repository_name, common.test_user_1_name )
- env_sh_path = os.path.join( self.galaxy_tool_dependency_dir,
- 'bwa',
- '0.5.9',
- base_repository.owner,
- base_repository.name,
- base_repository.installed_changeset_revision,
- 'env.sh' )
+ env_sh_path = self.get_env_sh_path( tool_dependency_name='bwa',
+ tool_dependency_version='0.5.9',
+ repository=base_repository )
assert os.path.exists( env_sh_path ), 'env.sh was not generated in %s for this dependency.' % env_sh_path
contents = file( env_sh_path, 'r' ).read()
if tool_repository.installed_changeset_revision not in contents:
diff -r 27b458743a117b5fb119915dc89bddc017625146 -r 881a16a718913fad393369059afe982ecb6b77bc test/tool_shed/test_data/emboss/0470_files/emboss_complex_dependency.tar
Binary file test/tool_shed/test_data/emboss/0470_files/emboss_complex_dependency.tar has changed
diff -r 27b458743a117b5fb119915dc89bddc017625146 -r 881a16a718913fad393369059afe982ecb6b77bc test/tool_shed/test_data/emboss/0470_files/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/emboss/0470_files/tool_dependencies.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<tool_dependency>
+ <package name="emboss" version="5.0.0">
+ <!-- These tools require the EMBOSS 5.0.0 binaries. -->
+ <repository name="package_emboss_5_0_0_0470" owner="user1" />
+ </package>
+</tool_dependency>
diff -r 27b458743a117b5fb119915dc89bddc017625146 -r 881a16a718913fad393369059afe982ecb6b77bc test/tool_shed/test_data/emboss/emboss_5_0_0/first_tool_dependency/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/emboss/emboss_5_0_0/first_tool_dependency/tool_dependencies.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<tool_dependency>
+ <package name="libx11" version="1.5.0">
+ <repository name="package_x11_client_1_5_proto_7_0_0470" owner="user1" prior_installation_required="True" />
+ </package>
+ <package name="emboss" version="5.0.0">
+ <install version="1.0">
+ <actions>
+ <action type="download_by_url">ftp://emboss.open-bio.org/pub/EMBOSS/old/5.0.0/EMBOSS-5.0.0.tar.gz</action>
+ <action type="set_environment_for_install">
+ <repository name="package_x11_client_1_5_proto_7_0_0470" owner="user1" prior_installation_required="True">
+ <package name="libx11" version="1.5.0" />
+ </repository>
+ </action>
+ <action type="template_command">
+ #if env.get('X11_LIB_DIR', False) and env.get('X11_INCLUDE_DIR', False):
+ ./configure --prefix=$env.INSTALL_DIR --x-includes=$env.X11_INCLUDE_DIR --x-libraries=$env.X11_LIB_DIR
+ #else:
+ ./configure --prefix=$env.INSTALL_DIR
+ #end if
+ </action>
+ <action type="shell_command">make && make install</action>
+ <action extract="true" type="download_file">ftp://emboss.open-bio.org/pub/EMBOSS/old/5.0.0/PHYLIP-3.6b.tar.gz</action>
+ <action type="change_directory">PHYLIP-3.6b</action>
+ <action type="template_command">
+ #if env.get('X11_LIB_DIR', False) and env.get('X11_INCLUDE_DIR', False):
+ ./configure --prefix=$env.INSTALL_DIR --x-includes=$env.X11_INCLUDE_DIR --x-libraries=$env.X11_LIB_DIR CFLAGS='-I$env.INSTALL_DIR/include'
+ #else:
+ ./configure --prefix=$env.INSTALL_DIR
+ #end if
+ </action>
+ <action type="shell_command">make && make install</action>
+ <action type="set_environment">
+ <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>
+These links provide information for building the Emboss package in most environments.
+
+System requirements
+http://emboss.sourceforge.net/download/#Requirements
+
+Platform-dependent notes
+http://emboss.sourceforge.net/download/#Platforms
+ </readme>
+ </package>
+</tool_dependency>
\ No newline at end of file
diff -r 27b458743a117b5fb119915dc89bddc017625146 -r 881a16a718913fad393369059afe982ecb6b77bc test/tool_shed/test_data/emboss/emboss_5_0_0/second_tool_dependency/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/emboss/emboss_5_0_0/second_tool_dependency/tool_dependencies.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<tool_dependency>
+ <package name="libx11" version="1.5.0">
+ <repository name="package_x11_client_1_5_proto_7_0_0470" owner="user1" prior_installation_required="True" />
+ </package>
+ <package name="emboss" version="5.0.0">
+ <install version="1.0">
+ <actions>
+ <!-- This is also a comment -->
+ <action type="download_by_url">ftp://emboss.open-bio.org/pub/EMBOSS/old/5.0.0/EMBOSS-5.0.0.tar.gz</action>
+ <action type="set_environment_for_install">
+ <repository name="package_x11_client_1_5_proto_7_0_0470" owner="user1" prior_installation_required="True">
+ <package name="libx11" version="1.5.0" />
+ </repository>
+ </action>
+ <action type="template_command">
+ #if env.get('X11_LIB_DIR', False) and env.get('X11_INCLUDE_DIR', False):
+ ./configure --prefix=$env.INSTALL_DIR --x-includes=$env.X11_INCLUDE_DIR --x-libraries=$env.X11_LIB_DIR
+ #else:
+ ./configure --prefix=$env.INSTALL_DIR
+ #end if
+ </action>
+ <action type="shell_command">make && make install</action>
+ <action extract="true" type="download_file">ftp://emboss.open-bio.org/pub/EMBOSS/old/5.0.0/PHYLIP-3.6b.tar.gz</action>
+ <action type="change_directory">PHYLIP-3.6b</action>
+ <action type="template_command">
+ #if env.get('X11_LIB_DIR', False) and env.get('X11_INCLUDE_DIR', False):
+ ./configure --prefix=$env.INSTALL_DIR --x-includes=$env.X11_INCLUDE_DIR --x-libraries=$env.X11_LIB_DIR CFLAGS='-I$env.INSTALL_DIR/include'
+ #else:
+ ./configure --prefix=$env.INSTALL_DIR
+ #end if
+ </action>
+ <action type="shell_command">make && make install</action>
+ <action type="set_environment">
+ <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>
+These links provide information for building the Emboss package in most environments.
+
+System requirements
+http://emboss.sourceforge.net/download/#Requirements
+
+Platform-dependent notes
+http://emboss.sourceforge.net/download/#Platforms
+ </readme>
+ </package>
+</tool_dependency>
\ No newline at end of file
diff -r 27b458743a117b5fb119915dc89bddc017625146 -r 881a16a718913fad393369059afe982ecb6b77bc test/tool_shed/test_data/emboss/libx11_proto/first_tool_dependency/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/emboss/libx11_proto/first_tool_dependency/tool_dependencies.xml
@@ -0,0 +1,22 @@
+<tool_dependency>
+ <package name="libx11" version="1.5.0">
+ <install version="1.0">
+ <actions>
+ <action type="download_by_url">ftp://ftp.x.org/pub/X11R7.7/src/proto/xproto-7.0.23.tar.bz2</action>
+ <action type="shell_command">./configure --prefix=$INSTALL_DIR</action>
+ <action type="shell_command">make && make install</action>
+ <action type="set_environment">
+ <environment_variable name="X11_INCLUDE_DIR" action="set_to">$INSTALL_DIR/include</environment_variable>
+ </action>
+ <action type="download_file" extract="true">ftp://ftp.x.org/pub/X11R7.7/src/lib/libX11-1.5.0.tar.bz2</action>
+ <action type="change_directory">libX11-1.5.0</action>
+ <action type="shell_command">./configure --prefix=$INSTALL_DIR CFLAGS='-I$INSTALL_DIR/include'</action>
+ <action type="shell_command">make && make install</action>
+ <action type="set_environment">
+ <environment_variable name="X11_LIB_DIR" action="set_to">$INSTALL_DIR/lib</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>Xlib is an X Window System protocol client library written in the C programming language. It contains functions for interacting with an X server. These functions allow programmers to write programs without knowing the details of the protocol. Few applications use Xlib directly; rather, they employ other libraries that use Xlib functions to provide widget toolkits.</readme>
+ </package>
+</tool_dependency>
\ No newline at end of file
diff -r 27b458743a117b5fb119915dc89bddc017625146 -r 881a16a718913fad393369059afe982ecb6b77bc test/tool_shed/test_data/emboss/libx11_proto/second_tool_dependency/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/emboss/libx11_proto/second_tool_dependency/tool_dependencies.xml
@@ -0,0 +1,23 @@
+<tool_dependency>
+ <package name="libx11" version="1.5.0">
+ <install version="1.0">
+ <actions>
+ <!-- This is a comment -->
+ <action type="download_by_url">ftp://ftp.x.org/pub/X11R7.7/src/proto/xproto-7.0.23.tar.bz2</action>
+ <action type="shell_command">./configure --prefix=$INSTALL_DIR</action>
+ <action type="shell_command">make && make install</action>
+ <action type="set_environment">
+ <environment_variable name="X11_INCLUDE_DIR" action="set_to">$INSTALL_DIR/include</environment_variable>
+ </action>
+ <action type="download_file" extract="true">ftp://ftp.x.org/pub/X11R7.7/src/lib/libX11-1.5.0.tar.bz2</action>
+ <action type="change_directory">libX11-1.5.0</action>
+ <action type="shell_command">./configure --prefix=$INSTALL_DIR CFLAGS='-I$INSTALL_DIR/include'</action>
+ <action type="shell_command">make && make install</action>
+ <action type="set_environment">
+ <environment_variable name="X11_LIB_DIR" action="set_to">$INSTALL_DIR/lib</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>Xlib is an X Window System protocol client library written in the C programming language. It contains functions for interacting with an X server. These functions allow programmers to write programs without knowing the details of the protocol. Few applications use Xlib directly; rather, they employ other libraries that use Xlib functions to provide widget toolkits.</readme>
+ </package>
+</tool_dependency>
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/6fa490b703b0/
Changeset: 6fa490b703b0
User: Dave Bouvier
Date: 2013-07-24 16:58:05
Summary: Merged in changes.
Affected #: 9 files
diff -r 528bee4dd14addc5db2b59a0a229e3aa441f8fda -r 6fa490b703b062231da599fdd7f169d84eddc930 test/tool_shed/base/twilltestcase.py
--- a/test/tool_shed/base/twilltestcase.py
+++ b/test/tool_shed/base/twilltestcase.py
@@ -453,15 +453,15 @@
original_information = dict( repo_name=repository.name, description=repository.description, long_description=repository.long_description )
strings_displayed = []
strings_not_displayed = []
- for input_elem_name in [ 'repo_name', 'description', 'long_description' ]:
+ for input_elem_name in [ 'repo_name', 'description', 'long_description', 'repository_type' ]:
if input_elem_name in kwd:
- tc.fv( "1", input_elem_name, kwd[ input_elem_name ] )
+ tc.fv( "edit_repository", input_elem_name, kwd[ input_elem_name ] )
strings_displayed.append( self.escape_html( kwd[ input_elem_name ] ) )
tc.submit( "edit_repository_button" )
self.check_for_strings( strings_displayed )
strings_displayed = []
for input_elem_name in [ 'repo_name', 'description', 'long_description' ]:
- tc.fv( "1", input_elem_name, original_information[ input_elem_name ] )
+ tc.fv( "edit_repository", input_elem_name, original_information[ input_elem_name ] )
strings_displayed.append( self.escape_html( original_information[ input_elem_name ] ) )
tc.submit( "edit_repository_button" )
self.check_for_strings( strings_displayed )
@@ -577,6 +577,16 @@
return datatypes_count.group( 1 )
return None
+ def get_env_sh_path( self, tool_dependency_name, tool_dependency_version, repository ):
+ env_sh_path = os.path.join( self.galaxy_tool_dependency_dir,
+ tool_dependency_name,
+ tool_dependency_version,
+ repository.owner,
+ repository.name,
+ repository.installed_changeset_revision,
+ 'env.sh' )
+ return env_sh_path
+
def get_filename( self, filename, filepath=None ):
if filepath is not None:
return os.path.abspath( os.path.join( filepath, filename ) )
diff -r 528bee4dd14addc5db2b59a0a229e3aa441f8fda -r 6fa490b703b062231da599fdd7f169d84eddc930 test/tool_shed/functional/test_0470_tool_dependency_repository_type.py
--- /dev/null
+++ b/test/tool_shed/functional/test_0470_tool_dependency_repository_type.py
@@ -0,0 +1,253 @@
+from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
+import tool_shed.base.test_db_util as test_db_util
+
+import logging
+log = logging.getLogger( __name__ )
+
+category_name = 'Test 0470 Tool dependency repository type'
+category_description = 'Test script 0470 for changing repository types.'
+package_libx11_repository_name = 'package_x11_client_1_5_proto_7_0_0470'
+package_libx11_repository_description = "Contains a tool dependency definition that provides the X11 client libraries and core protocol header files."
+package_libx11_repository_long_description = "Xlib is an X Window System protocol client library written in the C programming language."
+package_emboss_repository_name = 'package_emboss_5_0_0_0470'
+package_emboss_repository_description = "Contains a tool dependency definition that downloads and compiles version 5.0.0 of the EMBOSS tool suite."
+package_emboss_repository_long_description = 'EMBOSS is "The European Molecular Biology Open Software Suite".'
+datatypes_repository_name = 'emboss_datatypes_0470'
+datatypes_repository_description = 'Galaxy applicable data formats used by Emboss tools.'
+datatypes_repository_long_description = 'Galaxy applicable data formats used by Emboss tools. This repository contains no tools.'
+emboss_repository_name = 'emboss_5_0470'
+emboss_repository_description = "Galaxy wrappers for Emboss version 5.0.0 tools"
+emboss_repository_long_description = "Galaxy wrappers for Emboss version 5.0.0 tools"
+
+'''
+1. Create and populate a repository named package_x11_client_1_5_proto_7_0 that contains only a single file named tool_dependencies.xml.
+ Keep the repository type as the default "Unrestricted".
+
+2. Create a repository named package_emboss_5_0_0 of type "Unrestricted" that has a repository dependency definition that defines the
+ above package_x11_client_1_5_proto_7_0 repository. Upload the tool_dependencies.xml file such that it does not have a changeset_revision
+ defined so it will get automatically populated.
+
+3. Create a repository named emboss_5 of type "Unrestricted" that has a tool-dependencies.xml file defining a complex repository dependency
+ on the package_emboss_5_0_0 repository above. Upload the tool_dependencies.xml file such that it does not have a change set_revision defined
+ so it will get automatically populated.
+
+4. Add a comment to the tool_dependencies.xml file to be uploaded to the package_x11_client_1_5_prot_7_0 repository, creating a new installable
+ changeset revision at the repository tip.
+
+5. Add a comment to the tool_dependencies.xml file for the package_emboss_5_0_0 repository, eliminating the change set_revision attribute so
+ that it gets automatically populated when uploaded. After uploading the file, the package_emboss_5_0_0 repository should have 2
+ installable changeset revisions.
+
+6. Add a comment to the tool_dependencies.xml file in the emboss_5 repository, eliminating the changeset_revision attribute so that it gets
+ automatically populated when uploaded. After uploading the file, the emboss5 repository should have 2 installable metadata revisions.
+
+7. Change the repository type of the package_x11_client_1_5_proto_7_0 repository to be tool_dependency_definition.
+
+8. Change the repository type of the package_emboss_5_0_0 repository to be tool_dependency_definition.
+
+9. Reset metadata on the package_emboss_5_0_0 repository. It should now have only it's tip as the installable revision.
+
+10. Reset metadata on the emboss_5 repository. It should now have only it's tip as the installable revision.
+'''
+
+class TestEnvironmentInheritance( ShedTwillTestCase ):
+ '''Test referencing environment variables that were defined in a separate tool dependency.'''
+
+ def test_0000_initiate_users_and_category( self ):
+ """Create necessary user accounts and login as an admin user."""
+ self.logout()
+ self.login( email=common.admin_email, username=common.admin_username )
+ admin_user = test_db_util.get_user( common.admin_email )
+ assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email
+ admin_user_private_role = test_db_util.get_private_role( admin_user )
+ self.create_category( name=category_name, description=category_description )
+ self.logout()
+ self.login( email=common.test_user_2_email, username=common.test_user_2_name )
+ test_user_2 = test_db_util.get_user( common.test_user_2_email )
+ assert test_user_2 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_2_email
+ test_user_2_private_role = test_db_util.get_private_role( test_user_2 )
+ self.logout()
+ self.login( email=common.test_user_1_email, username=common.test_user_1_name )
+ test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_1_email
+ test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+
+ def test_0005_create_libx11_repository( self ):
+ '''Create and populate package_x11_client_1_5_proto_7_0_0470.'''
+ '''
+ This is step 1 - Create and populate a repository named package_x11_client_1_5_proto_7_0.
+
+ Create and populate a repository named package_x11_client_1_5_proto_7_0 that contains only a single file named tool_dependencies.xml.
+ Keep the repository type as the default "Unrestricted".
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=package_libx11_repository_name,
+ description=package_libx11_repository_description,
+ long_description=package_libx11_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Upload the tool dependency definition to the package_x11_client_1_5_proto_7_0_0470 repository.
+ self.upload_file( repository,
+ filename='emboss/libx11_proto/first_tool_dependency/tool_dependencies.xml',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_x11_client_1_5_proto_7_0_0470 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0010_create_emboss_5_0_0_repository( self ):
+ '''Create and populate package_emboss_5_0_0_0470.'''
+ '''
+ This is step 2 - Create a repository named package_emboss_5_0_0 of type "Unrestricted".
+
+ Create a repository named package_emboss_5_0_0 of type "Unrestricted" that has a repository dependency definition that defines the
+ above package_x11_client_1_5_proto_7_0 repository. Upload the tool_dependencues.xml file such that it does not have a changeset_revision
+ defined so it will get automatically populated.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=package_emboss_repository_name,
+ description=package_emboss_repository_description,
+ long_description=package_emboss_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Upload the edited tool dependency definition to the package_emboss_5_0_0 repository.
+ self.upload_file( repository,
+ filename='emboss/emboss_5_0_0/first_tool_dependency/tool_dependencies.xml',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_emboss_5_0_0_0470 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0015_create_emboss_5_repository( self ):
+ '''Create and populate emboss_5_0470.'''
+ '''
+ This is step 3 - Create a repository named emboss_5 of type "Unrestricted".
+
+ Create a repository named emboss_5 of type "Unrestricted" that has a tool-dependencies.xml file defining a complex repository dependency
+ on the package_emboss_5_0_0 repository above. Upload the tool_dependencies.xml file such that it does not have a change set_revision defined
+ so it will get automatically populated.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=emboss_repository_name,
+ description=emboss_repository_description,
+ long_description=emboss_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Populate emboss_5 with tool and dependency definitions.
+ self.upload_file( repository,
+ filename='emboss/0470_files/emboss_complex_dependency.tar',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=True,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate emboss_5 with tool and dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0020_upload_updated_tool_dependency_to_package_x11( self ):
+ '''Upload a new tool_dependencies.xml to package_x11_client_1_5_proto_7_0_0470.'''
+ '''
+ This is step 4 - Add a comment to the tool_dependencies.xml file to be uploaded to the package_x11_client_1_5_prot_7_0 repository, creating
+ a new installable changeset revision at the repository tip.
+ '''
+ package_x11_repository = test_db_util.get_repository_by_name_and_owner( package_libx11_repository_name, common.test_user_1_name )
+ # Upload the tool dependency definition to the package_x11_client_1_5_proto_7_0_0470 repository.
+ self.upload_file( package_x11_repository,
+ filename='emboss/libx11_proto/second_tool_dependency/tool_dependencies.xml',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_x11_client_1_5_proto_7_0_0470 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+ assert len( package_x11_repository.metadata_revisions ) == 1, 'package_x11_client_1_5_proto_7_0_0470 has incorrect number of metadata revisions'
+
+ def test_0025_upload_updated_tool_dependency_to_package_emboss( self ):
+ '''Upload a new tool_dependencies.xml to package_emboss_5_0_0_0470.'''
+ '''
+ This is step 5 - Add a comment to the tool_dependencies.xml file for the package_emboss_5_0_0 repository, eliminating
+ the change set_revision attribute so that it gets automatically populated when uploaded. After uploading the file,
+ the package_emboss_5_0_0 repository should have 2 installable changeset revisions.
+ '''
+ package_emboss_repository = test_db_util.get_repository_by_name_and_owner( package_emboss_repository_name, common.test_user_1_name )
+ # Populate package_emboss_5_0_0_0470 with updated tool dependency definition.
+ self.upload_file( package_emboss_repository,
+ filename='emboss/emboss_5_0_0/second_tool_dependency/tool_dependencies.xml',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_emboss_5_0_0_0470 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+ assert len( package_emboss_repository.metadata_revisions ) == 2, 'package_emboss_5_0_0_0470 has incorrect number of metadata revisions'
+
+ def test_0030_upload_updated_tool_dependency_to_emboss_5_repository( self ):
+ '''Upload a new tool_dependencies.xml to emboss_5_0470.'''
+ '''
+ This is step 6 - Add a comment to the tool_dependencies.xml file in the emboss_5 repository, eliminating the
+ changeset_revision attribute so that it gets automatically populated when uploaded. After uploading the file,
+ the emboss5 repository should have 2 installable metadata revisions.
+ '''
+ emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ # Populate package_emboss_5_0_0_0470 with updated tool dependency definition.
+ self.upload_file( emboss_repository,
+ filename='emboss/0470_files/tool_dependencies.xml',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Upload updated complex repository dependency definition to emboss_5_0470.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+ assert len( emboss_repository.metadata_revisions ) == 2, 'package_emboss_5_0_0_0470 has incorrect number of metadata revisions'
+
+ def test_0035_modify_package_x11_repository_type( self ):
+ '''Set package_x11_client_1_5_proto_7_0 type tool_dependency_definition.'''
+ '''
+ This is step 7 - Change the repository type of the package_x11_client_1_5_proto_7_0 repository to be tool_dependency_definition.
+ '''
+ package_x11_repository = test_db_util.get_repository_by_name_and_owner( package_libx11_repository_name, common.test_user_1_name )
+ self.edit_repository_information( package_x11_repository, repository_type='tool_dependency_definition' )
+
+ def test_0040_modify_package_emboss_repository_type( self ):
+ '''Set package_emboss_5_0_0 to type tool_dependency_definition.'''
+ '''
+ This is step 8 - Change the repository type of the package_emboss_5_0_0 repository to be tool_dependency_definition.
+ '''
+ package_emboss_repository = test_db_util.get_repository_by_name_and_owner( package_emboss_repository_name, common.test_user_1_name )
+ self.edit_repository_information( package_emboss_repository, repository_type='tool_dependency_definition' )
+
+ def test_0045_reset_repository_metadata( self ):
+ '''Reset metadata on package_emboss_5_0_0_0470 and package_x11_client_1_5_proto_7_0.'''
+ '''
+ This is step 9 - Reset metadata on the package_emboss_5_0_0 and package_x11_client_1_5_proto_7_0 repositories. They should
+ now have only their tip as the installable revision.
+ '''
+ package_emboss_repository = test_db_util.get_repository_by_name_and_owner( package_emboss_repository_name, common.test_user_1_name )
+ package_x11_repository = test_db_util.get_repository_by_name_and_owner( package_libx11_repository_name, common.test_user_1_name )
+ self.reset_repository_metadata( package_emboss_repository )
+ self.reset_repository_metadata( package_x11_repository )
+ assert len( package_emboss_repository.metadata_revisions ) == 1, 'Repository package_emboss_5_0_0 has %d installable revisions, expected 1.' % \
+ len( package_emboss_repository.metadata_revisions )
+ assert len( package_x11_repository.metadata_revisions ) == 1, 'Repository package_x11_client_1_5_proto_7_0 has %d installable revisions, expected 1.' % \
+ len( package_x11_repository.metadata_revisions )
+
+ def test_0050_reset_emboss_5_metadata( self ):
+ '''Reset metadata on emboss_5.'''
+ '''
+ This is step 10 - Reset metadata on the emboss_5 repository. It should now have only it's tip as the installable revision.
+ '''
+ emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ self.reset_repository_metadata( emboss_repository )
+ assert len( emboss_repository.metadata_revisions ) == 1, 'Repository emboss_5 has %d installable revisions, expected 1.' % \
+ len( emboss_repository.metadata_revisions )
diff -r 528bee4dd14addc5db2b59a0a229e3aa441f8fda -r 6fa490b703b062231da599fdd7f169d84eddc930 test/tool_shed/functional/test_1100_install_repository_with_complex_dependencies.py
--- a/test/tool_shed/functional/test_1100_install_repository_with_complex_dependencies.py
+++ b/test/tool_shed/functional/test_1100_install_repository_with_complex_dependencies.py
@@ -56,7 +56,7 @@
uncompress_file=False,
remove_repo_files_not_in_tar=False,
commit_message='Uploaded tool_dependencies.xml.',
- strings_displayed=[ 'The settings for <b>name</b>, <b>version</b> and <b>type</b> from a contained tool' ],
+ strings_displayed=[ 'This repository currently contains a single file named <b>tool_dependencies.xml</b>' ],
strings_not_displayed=[] )
self.display_manage_repository_page( repository, strings_displayed=[ 'Tool dependencies', 'may not be', 'in this repository' ] )
@@ -262,13 +262,9 @@
'''Verify that the generated env.sh contains the right data.'''
base_repository = test_db_util.get_installed_repository_by_name_owner( bwa_base_repository_name, common.test_user_1_name )
tool_repository = test_db_util.get_installed_repository_by_name_owner( bwa_package_repository_name, common.test_user_1_name )
- env_sh_path = os.path.join( self.galaxy_tool_dependency_dir,
- 'bwa',
- '0.5.9',
- base_repository.owner,
- base_repository.name,
- base_repository.installed_changeset_revision,
- 'env.sh' )
+ env_sh_path = self.get_env_sh_path( tool_dependency_name='bwa',
+ tool_dependency_version='0.5.9',
+ repository=base_repository )
assert os.path.exists( env_sh_path ), 'env.sh was not generated in %s for this dependency.' % env_sh_path
contents = file( env_sh_path, 'r' ).read()
if tool_repository.installed_changeset_revision not in contents:
diff -r 528bee4dd14addc5db2b59a0a229e3aa441f8fda -r 6fa490b703b062231da599fdd7f169d84eddc930 test/tool_shed/test_data/emboss/0470_files/emboss_complex_dependency.tar
Binary file test/tool_shed/test_data/emboss/0470_files/emboss_complex_dependency.tar has changed
diff -r 528bee4dd14addc5db2b59a0a229e3aa441f8fda -r 6fa490b703b062231da599fdd7f169d84eddc930 test/tool_shed/test_data/emboss/0470_files/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/emboss/0470_files/tool_dependencies.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<tool_dependency>
+ <package name="emboss" version="5.0.0">
+ <!-- These tools require the EMBOSS 5.0.0 binaries. -->
+ <repository name="package_emboss_5_0_0_0470" owner="user1" />
+ </package>
+</tool_dependency>
diff -r 528bee4dd14addc5db2b59a0a229e3aa441f8fda -r 6fa490b703b062231da599fdd7f169d84eddc930 test/tool_shed/test_data/emboss/emboss_5_0_0/first_tool_dependency/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/emboss/emboss_5_0_0/first_tool_dependency/tool_dependencies.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<tool_dependency>
+ <package name="libx11" version="1.5.0">
+ <repository name="package_x11_client_1_5_proto_7_0_0470" owner="user1" prior_installation_required="True" />
+ </package>
+ <package name="emboss" version="5.0.0">
+ <install version="1.0">
+ <actions>
+ <action type="download_by_url">ftp://emboss.open-bio.org/pub/EMBOSS/old/5.0.0/EMBOSS-5.0.0.tar.gz</action>
+ <action type="set_environment_for_install">
+ <repository name="package_x11_client_1_5_proto_7_0_0470" owner="user1" prior_installation_required="True">
+ <package name="libx11" version="1.5.0" />
+ </repository>
+ </action>
+ <action type="template_command">
+ #if env.get('X11_LIB_DIR', False) and env.get('X11_INCLUDE_DIR', False):
+ ./configure --prefix=$env.INSTALL_DIR --x-includes=$env.X11_INCLUDE_DIR --x-libraries=$env.X11_LIB_DIR
+ #else:
+ ./configure --prefix=$env.INSTALL_DIR
+ #end if
+ </action>
+ <action type="shell_command">make && make install</action>
+ <action extract="true" type="download_file">ftp://emboss.open-bio.org/pub/EMBOSS/old/5.0.0/PHYLIP-3.6b.tar.gz</action>
+ <action type="change_directory">PHYLIP-3.6b</action>
+ <action type="template_command">
+ #if env.get('X11_LIB_DIR', False) and env.get('X11_INCLUDE_DIR', False):
+ ./configure --prefix=$env.INSTALL_DIR --x-includes=$env.X11_INCLUDE_DIR --x-libraries=$env.X11_LIB_DIR CFLAGS='-I$env.INSTALL_DIR/include'
+ #else:
+ ./configure --prefix=$env.INSTALL_DIR
+ #end if
+ </action>
+ <action type="shell_command">make && make install</action>
+ <action type="set_environment">
+ <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>
+These links provide information for building the Emboss package in most environments.
+
+System requirements
+http://emboss.sourceforge.net/download/#Requirements
+
+Platform-dependent notes
+http://emboss.sourceforge.net/download/#Platforms
+ </readme>
+ </package>
+</tool_dependency>
\ No newline at end of file
diff -r 528bee4dd14addc5db2b59a0a229e3aa441f8fda -r 6fa490b703b062231da599fdd7f169d84eddc930 test/tool_shed/test_data/emboss/emboss_5_0_0/second_tool_dependency/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/emboss/emboss_5_0_0/second_tool_dependency/tool_dependencies.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<tool_dependency>
+ <package name="libx11" version="1.5.0">
+ <repository name="package_x11_client_1_5_proto_7_0_0470" owner="user1" prior_installation_required="True" />
+ </package>
+ <package name="emboss" version="5.0.0">
+ <install version="1.0">
+ <actions>
+ <!-- This is also a comment -->
+ <action type="download_by_url">ftp://emboss.open-bio.org/pub/EMBOSS/old/5.0.0/EMBOSS-5.0.0.tar.gz</action>
+ <action type="set_environment_for_install">
+ <repository name="package_x11_client_1_5_proto_7_0_0470" owner="user1" prior_installation_required="True">
+ <package name="libx11" version="1.5.0" />
+ </repository>
+ </action>
+ <action type="template_command">
+ #if env.get('X11_LIB_DIR', False) and env.get('X11_INCLUDE_DIR', False):
+ ./configure --prefix=$env.INSTALL_DIR --x-includes=$env.X11_INCLUDE_DIR --x-libraries=$env.X11_LIB_DIR
+ #else:
+ ./configure --prefix=$env.INSTALL_DIR
+ #end if
+ </action>
+ <action type="shell_command">make && make install</action>
+ <action extract="true" type="download_file">ftp://emboss.open-bio.org/pub/EMBOSS/old/5.0.0/PHYLIP-3.6b.tar.gz</action>
+ <action type="change_directory">PHYLIP-3.6b</action>
+ <action type="template_command">
+ #if env.get('X11_LIB_DIR', False) and env.get('X11_INCLUDE_DIR', False):
+ ./configure --prefix=$env.INSTALL_DIR --x-includes=$env.X11_INCLUDE_DIR --x-libraries=$env.X11_LIB_DIR CFLAGS='-I$env.INSTALL_DIR/include'
+ #else:
+ ./configure --prefix=$env.INSTALL_DIR
+ #end if
+ </action>
+ <action type="shell_command">make && make install</action>
+ <action type="set_environment">
+ <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>
+These links provide information for building the Emboss package in most environments.
+
+System requirements
+http://emboss.sourceforge.net/download/#Requirements
+
+Platform-dependent notes
+http://emboss.sourceforge.net/download/#Platforms
+ </readme>
+ </package>
+</tool_dependency>
\ No newline at end of file
diff -r 528bee4dd14addc5db2b59a0a229e3aa441f8fda -r 6fa490b703b062231da599fdd7f169d84eddc930 test/tool_shed/test_data/emboss/libx11_proto/first_tool_dependency/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/emboss/libx11_proto/first_tool_dependency/tool_dependencies.xml
@@ -0,0 +1,22 @@
+<tool_dependency>
+ <package name="libx11" version="1.5.0">
+ <install version="1.0">
+ <actions>
+ <action type="download_by_url">ftp://ftp.x.org/pub/X11R7.7/src/proto/xproto-7.0.23.tar.bz2</action>
+ <action type="shell_command">./configure --prefix=$INSTALL_DIR</action>
+ <action type="shell_command">make && make install</action>
+ <action type="set_environment">
+ <environment_variable name="X11_INCLUDE_DIR" action="set_to">$INSTALL_DIR/include</environment_variable>
+ </action>
+ <action type="download_file" extract="true">ftp://ftp.x.org/pub/X11R7.7/src/lib/libX11-1.5.0.tar.bz2</action>
+ <action type="change_directory">libX11-1.5.0</action>
+ <action type="shell_command">./configure --prefix=$INSTALL_DIR CFLAGS='-I$INSTALL_DIR/include'</action>
+ <action type="shell_command">make && make install</action>
+ <action type="set_environment">
+ <environment_variable name="X11_LIB_DIR" action="set_to">$INSTALL_DIR/lib</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>Xlib is an X Window System protocol client library written in the C programming language. It contains functions for interacting with an X server. These functions allow programmers to write programs without knowing the details of the protocol. Few applications use Xlib directly; rather, they employ other libraries that use Xlib functions to provide widget toolkits.</readme>
+ </package>
+</tool_dependency>
\ No newline at end of file
diff -r 528bee4dd14addc5db2b59a0a229e3aa441f8fda -r 6fa490b703b062231da599fdd7f169d84eddc930 test/tool_shed/test_data/emboss/libx11_proto/second_tool_dependency/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/emboss/libx11_proto/second_tool_dependency/tool_dependencies.xml
@@ -0,0 +1,23 @@
+<tool_dependency>
+ <package name="libx11" version="1.5.0">
+ <install version="1.0">
+ <actions>
+ <!-- This is a comment -->
+ <action type="download_by_url">ftp://ftp.x.org/pub/X11R7.7/src/proto/xproto-7.0.23.tar.bz2</action>
+ <action type="shell_command">./configure --prefix=$INSTALL_DIR</action>
+ <action type="shell_command">make && make install</action>
+ <action type="set_environment">
+ <environment_variable name="X11_INCLUDE_DIR" action="set_to">$INSTALL_DIR/include</environment_variable>
+ </action>
+ <action type="download_file" extract="true">ftp://ftp.x.org/pub/X11R7.7/src/lib/libX11-1.5.0.tar.bz2</action>
+ <action type="change_directory">libX11-1.5.0</action>
+ <action type="shell_command">./configure --prefix=$INSTALL_DIR CFLAGS='-I$INSTALL_DIR/include'</action>
+ <action type="shell_command">make && make install</action>
+ <action type="set_environment">
+ <environment_variable name="X11_LIB_DIR" action="set_to">$INSTALL_DIR/lib</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>Xlib is an X Window System protocol client library written in the C programming language. It contains functions for interacting with an X server. These functions allow programmers to write programs without knowing the details of the protocol. Few applications use Xlib directly; rather, they employ other libraries that use Xlib functions to provide widget toolkits.</readme>
+ </package>
+</tool_dependency>
\ No newline at end of file
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.
1
0
commit/galaxy-central: greg: Apply Peter Cock's patch for appending a .rst extension to readme file names in tool shed repositories.
by commits-noreply@bitbucket.org 24 Jul '13
by commits-noreply@bitbucket.org 24 Jul '13
24 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/528bee4dd14a/
Changeset: 528bee4dd14a
User: greg
Date: 2013-07-24 16:51:30
Summary: Apply Peter Cock's patch for appending a .rst extension to readme file names in tool shed repositories.
Affected #: 1 file
diff -r e22f360cda1363d0c93a86d64c17032e7507b296 -r 528bee4dd14addc5db2b59a0a229e3aa441f8fda lib/tool_shed/util/metadata_util.py
--- a/lib/tool_shed/util/metadata_util.py
+++ b/lib/tool_shed/util/metadata_util.py
@@ -990,6 +990,7 @@
valid_filenames.extend( map( lambda f: '%s.rst' % f, readme_files ) )
valid_filenames.extend( readme_files )
valid_filenames.append( '%s.txt' % repository_name )
+ valid_filenames.append( '%s.rst' % repository_name )
return valid_filenames
def get_relative_path_to_repository_file( root, name, relative_install_dir, work_dir, shed_config_dict, resetting_all_metadata_on_repository ):
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.
1
0
commit/galaxy-central: greg: Render tool shed repository readme files as rst only if the file name ends with .rst.
by commits-noreply@bitbucket.org 24 Jul '13
by commits-noreply@bitbucket.org 24 Jul '13
24 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e22f360cda13/
Changeset: e22f360cda13
User: greg
Date: 2013-07-24 16:34:21
Summary: Render tool shed repository readme files as rst only if the file name ends with .rst.
Affected #: 1 file
diff -r 27b458743a117b5fb119915dc89bddc017625146 -r e22f360cda1363d0c93a86d64c17032e7507b296 templates/webapps/tool_shed/repository/common.mako
--- a/templates/webapps/tool_shed/repository/common.mako
+++ b/templates/webapps/tool_shed/repository/common.mako
@@ -600,8 +600,10 @@
<%def name="render_readme( readme, pad, parent, row_counter )"><%
+ from tool_shed.util.shed_util_common import to_safe_string
from galaxy.util import rst_to_html
encoded_id = trans.security.encode_id( readme.id )
+ render_rst = readme.name.endswith( '.rst' )
%><style type="text/css">
#readme_table{ table-layout:fixed;
@@ -620,7 +622,11 @@
id="libraryItem-${encoded_id}"><td style="padding-left: ${pad+20}px;"><table id="readme_table">
- <tr><td>${ rst_to_html( readme.text ) }</td></tr>
+ %if render_rst:
+ <tr><td>${ rst_to_html( readme.text ) }</td></tr>
+ %else:
+ <tr><td>${readme.name}<br/>${ to_safe_string( readme.text, to_html=True ) }</td></tr>
+ %endif
</table></td></tr>
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.
1
0
commit/galaxy-central: Dave Bouvier: Fix to correctly handle comments in repository dependency definitions.
by commits-noreply@bitbucket.org 24 Jul '13
by commits-noreply@bitbucket.org 24 Jul '13
24 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/27b458743a11/
Changeset: 27b458743a11
User: Dave Bouvier
Date: 2013-07-24 16:17:03
Summary: Fix to correctly handle comments in repository dependency definitions.
Affected #: 1 file
diff -r fdcd30ffdafd0a11ba7c90d5c01d1a3b5cb1f60c -r 27b458743a117b5fb119915dc89bddc017625146 lib/tool_shed/util/commit_util.py
--- a/lib/tool_shed/util/commit_util.py
+++ b/lib/tool_shed/util/commit_util.py
@@ -236,15 +236,16 @@
root = tree.getroot()
if root.tag == 'repositories':
for index, elem in enumerate( root ):
- # <repository name="molecule_datatypes" owner="test" changeset_revision="1a070566e9c6" />
- populated, elem, error_message = handle_repository_dependency_elem( trans, elem )
- if error_message:
- exception_message = 'The repository_dependencies.xml file contains an invalid <repository> tag. %s' % error_message
- raise Exception( exception_message )
- if populated:
- root[ index ] = elem
- if not altered:
- altered = True
+ if elem.tag == 'repository':
+ # <repository name="molecule_datatypes" owner="test" changeset_revision="1a070566e9c6" />
+ populated, elem, error_message = handle_repository_dependency_elem( trans, elem )
+ if error_message:
+ exception_message = 'The repository_dependencies.xml file contains an invalid <repository> tag. %s' % error_message
+ raise Exception( exception_message )
+ if populated:
+ root[ index ] = elem
+ if not altered:
+ altered = True
return altered, root
return False, None
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.
1
0
commit/galaxy-central: carlfeberhard: base controller, get_history_dataset_association: remove deleted=False flag; api/histories, update: remove deleted flag; casperjs tests: update for previous and remove tool iframe code
by commits-noreply@bitbucket.org 23 Jul '13
by commits-noreply@bitbucket.org 23 Jul '13
23 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/fdcd30ffdafd/
Changeset: fdcd30ffdafd
User: carlfeberhard
Date: 2013-07-23 19:55:39
Summary: base controller, get_history_dataset_association: remove deleted=False flag; api/histories, update: remove deleted flag; casperjs tests: update for previous and remove tool iframe code
Affected #: 7 files
diff -r 6187607058e66e1b8b31f2da905d603ae0c65f23 -r fdcd30ffdafd0a11ba7c90d5c01d1a3b5cb1f60c lib/galaxy/web/base/controller.py
--- a/lib/galaxy/web/base/controller.py
+++ b/lib/galaxy/web/base/controller.py
@@ -512,7 +512,8 @@
"""
#TODO: duplicate of above? alias to above (or vis-versa)
self.security_check( trans, history, check_ownership=check_ownership, check_accessible=check_accessible )
- hda = self.get_object( trans, dataset_id, 'HistoryDatasetAssociation', check_ownership=False, check_accessible=False, deleted=False )
+ hda = self.get_object( trans, dataset_id, 'HistoryDatasetAssociation',
+ check_ownership=False, check_accessible=False )
if check_accessible:
if not trans.app.security_agent.can_access_dataset( trans.get_current_user_roles(), hda.dataset ):
diff -r 6187607058e66e1b8b31f2da905d603ae0c65f23 -r fdcd30ffdafd0a11ba7c90d5c01d1a3b5cb1f60c lib/galaxy/webapps/galaxy/api/histories.py
--- a/lib/galaxy/webapps/galaxy/api/histories.py
+++ b/lib/galaxy/webapps/galaxy/api/histories.py
@@ -193,7 +193,7 @@
"""
#TODO: PUT /api/histories/{encoded_history_id} payload = { rating: rating } (w/ no security checks)
try:
- history = self.get_history( trans, id, check_ownership=True, check_accessible=True, deleted=True )
+ history = self.get_history( trans, id, check_ownership=True, check_accessible=True )
# validation handled here and some parsing, processing, and conversion
payload = self._validate_and_parse_update_payload( payload )
# additional checks here (security, etc.)
diff -r 6187607058e66e1b8b31f2da905d603ae0c65f23 -r fdcd30ffdafd0a11ba7c90d5c01d1a3b5cb1f60c test/casperjs/api-hda-tests.js
--- a/test/casperjs/api-hda-tests.js
+++ b/test/casperjs/api-hda-tests.js
@@ -217,7 +217,7 @@
deleted: true
});
//this.debug( 'returned:\n' + this.jsonStr( returned ) );
- hdaShow = this.api.hdas.show( lastHistory.id, firstHda.id );
+ hdaShow = this.api.hdas.show( lastHistory.id, firstHda.id, true );
this.test.assert( hdaShow.deleted === true, "Update set the deleted flag: " + hdaShow.deleted );
this.test.comment( 'update should allow changing the deleted flag back' );
diff -r 6187607058e66e1b8b31f2da905d603ae0c65f23 -r fdcd30ffdafd0a11ba7c90d5c01d1a3b5cb1f60c test/casperjs/api-history-tests.js
--- a/test/casperjs/api-history-tests.js
+++ b/test/casperjs/api-history-tests.js
@@ -107,7 +107,7 @@
this.test.comment( 'A bad id to show should throw an error' );
this.assertRaises( function(){
this.api.histories.show( '1234123412341234' );
- }, 'Error in history API at showing history detail: 400 Bad Request', 'Raises an exception' );
+ }, '400 Bad Request', 'Raises an exception' );
// ------------------------------------------------------------------------------------------- CREATE
@@ -131,8 +131,10 @@
this.test.comment( 'calling delete should delete the given history and remove it from the standard index' );
var deletedHistory = this.api.histories.delete_( createdHistory.id );
//this.debug( 'returned from delete:\n' + this.jsonStr( deletedHistory ) );
- this.test.assert( deletedHistory === 'OK',
- "Deletion returned 'OK' - even though that's not a great, informative response: " + deletedHistory );
+ this.test.assert( deletedHistory.id === createdHistory.id,
+ "Deletion returned id matching created history: " + deletedHistory.id );
+ this.test.assert( deletedHistory.deleted === true,
+ "Deletion return 'deleted: true': " + deletedHistory.deleted );
newFirstHistory = this.api.histories.index()[0];
//this.debug( 'newFirstHistory:\n' + this.jsonStr( newFirstHistory ) );
@@ -252,7 +254,7 @@
deleted: true
});
//this.debug( 'returned:\n' + this.jsonStr( returned ) );
- historyShow = this.api.histories.show( newFirstHistory.id );
+ historyShow = this.api.histories.show( newFirstHistory.id, true );
this.test.assert( historyShow.deleted === true, "Update set the deleted flag: " + historyShow.deleted );
this.test.comment( 'update should allow changing the deleted flag back' );
diff -r 6187607058e66e1b8b31f2da905d603ae0c65f23 -r fdcd30ffdafd0a11ba7c90d5c01d1a3b5cb1f60c test/casperjs/modules/api.js
--- a/test/casperjs/modules/api.js
+++ b/test/casperjs/modules/api.js
@@ -261,7 +261,7 @@
};
HDAAPI.prototype.show = function show( historyId, id, deleted ){
- this.api.spaceghost.info( 'hdas.show: ' + [ historyId, id, (( deleted )?( 'w deleted' ):( '' )) ] );
+ this.api.spaceghost.info( 'hdas.show: ' + [ historyId, id, (( deleted )?( 'w/deleted' ):( '' )) ] );
id = ( id === 'most_recently_used' )?( id ):( this.api.ensureId( id ) );
deleted = deleted || false;
diff -r 6187607058e66e1b8b31f2da905d603ae0c65f23 -r fdcd30ffdafd0a11ba7c90d5c01d1a3b5cb1f60c test/casperjs/modules/tools.js
--- a/test/casperjs/modules/tools.js
+++ b/test/casperjs/modules/tools.js
@@ -87,7 +87,7 @@
uploadInfo[ spaceghost.data.selectors.tools.upload.fileInput ] = filepath;
// click the upload tool
- spaceghost.thenOpen( spaceghost.baseUrl ).withToolPanel( function(){
+ spaceghost.thenOpen( spaceghost.baseUrl, function(){
// we can apprently click a tool label without expanding the tool container for it
this.clickLabel( spaceghost.data.labels.tools.upload.panelLabel );
this.jumpToMain( function(){
diff -r 6187607058e66e1b8b31f2da905d603ae0c65f23 -r fdcd30ffdafd0a11ba7c90d5c01d1a3b5cb1f60c test/casperjs/spaceghost.js
--- a/test/casperjs/spaceghost.js
+++ b/test/casperjs/spaceghost.js
@@ -635,13 +635,6 @@
return this.withFrame( this.data.selectors.frames.history, then );
};
-/** Version of Casper#withFrame for the tool iframe.
- * @param {Function} then function called when in the frame
- */
-SpaceGhost.prototype.withToolPanel = function withToolPanel( then ){
- return this.withFrame( this.data.selectors.frames.tools, then );
-};
-
/** Version of Casper#withFrame for the main iframe.
* @param {Function} then function called when in the frame
*/
@@ -687,15 +680,6 @@
return this.jumpToFrame( this.data.selectors.frames.history, fn );
};
-/** Jumps into tools frame, exectutes fn, and jumps back to original frame.
- * @param {Selector} frame the selector for the frame to jump to
- * @param {Function} fn function called when in the frame
- * @returns {Any} the return value of fn
- */
-SpaceGhost.prototype.jumpToTools = function jumpToTools( fn ){
- return this.jumpToFrame( this.data.selectors.frames.tools, fn );
-};
-
/** Jumps into main frame, exectutes fn, and jumps back to original frame.
* @param {Selector} frame the selector for the frame to jump to
* @param {Function} fn function called when in the frame
@@ -1141,7 +1125,6 @@
frames : {
main : 'galaxy_main',
- tools : 'galaxy_tools',
history : 'galaxy_history'
},
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.
1
0
commit/galaxy-central: carlfeberhard: api/genomes, create: update docs
by commits-noreply@bitbucket.org 23 Jul '13
by commits-noreply@bitbucket.org 23 Jul '13
23 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/6187607058e6/
Changeset: 6187607058e6
User: carlfeberhard
Date: 2013-07-23 16:12:59
Summary: api/genomes, create: update docs
Affected #: 1 file
diff -r 547bfb9b7bbe090f93dc4b0935522662bb9805b5 -r 6187607058e66e1b8b31f2da905d603ae0c65f23 lib/galaxy/webapps/galaxy/api/genomes.py
--- a/lib/galaxy/webapps/galaxy/api/genomes.py
+++ b/lib/galaxy/webapps/galaxy/api/genomes.py
@@ -49,19 +49,14 @@
Download and/or index a genome.
Parameters::
-
- dbkey DB key of the build to download, ignored unless 'UCSC' is specified as the source
- ncbi_name NCBI's genome identifier, ignored unless NCBI is specified as the source
- ensembl_dbkey Ensembl's genome identifier, ignored unless Ensembl is specified as the source
- url_dbkey DB key to use for this build, ignored unless URL is specified as the source
- source Data source for this build. Can be: UCSC, Ensembl, NCBI, URL
+ liftover None or array of liftover url partial paths
+ dbkey DB key of the build to download
indexers POST array of indexers to run after downloading (indexers[] = first, indexers[] = second, ...)
+ longname a more descriptive name for the genome
func Allowed values:
'download' Download and index
'index' Index only
-
Returns::
-
If no error:
dict( status: 'ok', job: <job ID> )
@@ -69,6 +64,17 @@
dict( status: 'error', error: <error message> )
"""
+ #??: Planned?
+ #Parameters::
+ # dbkey DB key of the build to download, ignored unless 'UCSC' is specified as the source
+ # ncbi_name NCBI's genome identifier, ignored unless NCBI is specified as the source
+ # ensembl_dbkey Ensembl's genome identifier, ignored unless Ensembl is specified as the source
+ # url_dbkey DB key to use for this build, ignored unless URL is specified as the source
+ # source Data source for this build. Can be: UCSC, Ensembl, NCBI, URL
+ # indexers POST array of indexers to run after downloading (indexers[] = first, indexers[] = second, ...)
+ # func Allowed values:
+ # 'download' Download and index
+ # 'index' Index only
params = util.Params( payload )
from galaxy.web.controllers.data_admin import build_param_dict as massage
paramdict = massage( params, trans )
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.
1
0
commit/galaxy-central: carlfeberhard: History panel: disable (w/ message) display button for uploading files
by commits-noreply@bitbucket.org 23 Jul '13
by commits-noreply@bitbucket.org 23 Jul '13
23 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/547bfb9b7bbe/
Changeset: 547bfb9b7bbe
User: carlfeberhard
Date: 2013-07-23 15:32:22
Summary: History panel: disable (w/ message) display button for uploading files
Affected #: 2 files
diff -r 72cf2a3a6a2a5d476022072b6646dfbc1d519b09 -r 547bfb9b7bbe090f93dc4b0935522662bb9805b5 static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -235,6 +235,11 @@
displayBtnData.enabled = false;
displayBtnData.title = _l( 'Cannot display datasets removed from disk' );
+ // disable if still uploading
+ } else if( this.model.get( 'state' ) === HistoryDatasetAssociation.STATES.UPLOAD ){
+ displayBtnData.enabled = false;
+ displayBtnData.title = _l( 'This dataset must finish uploading before it can be viewed' );
+
} else {
displayBtnData.title = _l( 'View data' );
@@ -243,7 +248,14 @@
// add frame manager option onclick event
var self = this;
- displayBtnData.on_click = function() { parent.frame_manager.frame_new({title: "Data Viewer", type: "url", location: "center", content: self.urls.display }); };
+ displayBtnData.on_click = function(){
+ parent.frame_manager.frame_new({
+ title : "Data Viewer",
+ type : "url",
+ location: "center",
+ content : self.urls.display
+ });
+ };
}
this.displayButton = new IconButtonView({ model : new IconButton( displayBtnData ) });
diff -r 72cf2a3a6a2a5d476022072b6646dfbc1d519b09 -r 547bfb9b7bbe090f93dc4b0935522662bb9805b5 static/scripts/packed/mvc/dataset/hda-base.js
--- a/static/scripts/packed/mvc/dataset/hda-base.js
+++ b/static/scripts/packed/mvc/dataset/hda-base.js
@@ -1,1 +1,1 @@
-var HDABaseView=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"historyItemContainer",initialize:function(a){if(a.logger){this.logger=this.model.logger=a.logger}this.log(this+".initialize:",a);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];if(!a.urlTemplates){throw ("HDAView needs urlTemplates on initialize")}this.urlTemplates=a.urlTemplates;this.expanded=a.expanded||false;this.model.bind("change",function(c,d){var b=_.without(_.keys(d.changes),"display_apps","display_types");if(b.length){this.render()}else{if(this.expanded){this._render_displayApps()}}},this)},render:function(){var b=this,e=this.model.get("id"),c=this.model.get("state"),a=$("<div/>").attr("id","historyItem-"+e),d=(this.$el.children().size()===0);this.$el.attr("id","historyItemContainer-"+e);this.urls=this._renderUrls(this.urlTemplates,this.model.toJSON());a.addClass("historyItemWrapper").addClass("historyItem").addClass("historyItem-"+c);a.append(this._render_warnings());a.append(this._render_titleBar());this._setUpBehaviors(a);this.body=$(this._render_body());a.append(this.body);this.$el.fadeOut("fast",function(){b.$el.children().remove();b.$el.append(a).fadeIn("fast",function(){b.log(b+" rendered:",b.$el);var f="rendered";if(d){f+=":initial"}else{if(b.model.inReadyState()){f+=":ready"}}b.trigger(f)})});return this},_renderUrls:function(d,a){var b=this,c={};_.each(d,function(e,f){if(_.isObject(e)){c[f]=b._renderUrls(e,a)}else{if(f==="meta_download"){c[f]=b._renderMetaDownloadUrls(e,a)}else{try{c[f]=_.template(e,a)}catch(g){throw (b+"._renderUrls error: "+g+"\n rendering:"+e+"\n with "+JSON.stringify(a))}}}});return c},_renderMetaDownloadUrls:function(b,a){return _.map(a.meta_files,function(c){return{url:_.template(b,{id:a.id,file_type:c.file_type}),file_type:c.file_type}})},_setUpBehaviors:function(a){a=a||this.$el;make_popup_menus(a);a.find(".tooltip").tooltip({placement:"bottom"})},_render_warnings:function(){return $(jQuery.trim(HDABaseView.templates.messages(this.model.toJSON())))},_render_titleBar:function(){var a=$('<div class="historyItemTitleBar" style="overflow: hidden"></div>');a.append(this._render_titleButtons());a.append('<span class="state-icon"></span>');a.append(this._render_titleLink());return a},_render_titleButtons:function(){var a=$('<div class="historyItemButtons"></div>');a.append(this._render_displayButton());return a},_render_displayButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){this.displayButton=null;return null}var a={icon_class:"display",target:"galaxy_main"};if(this.model.get("purged")){a.enabled=false;a.title=_l("Cannot display datasets removed from disk")}else{a.title=_l("View data");a.href="javascript:parent.frame_manager.frame_new({title: 'Data Viewer', type: 'url', location: 'center', content: '"+this.urls.display+"'});"}this.displayButton=new IconButtonView({model:new IconButton(a)});return this.displayButton.render().$el},_render_titleLink:function(){return $(jQuery.trim(HDABaseView.templates.titleLink(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});return HDABaseView.templates.hdaSummary(a)},_render_primaryActionButtons:function(c){var a=this,b=$("<div/>").attr("id","primary-actions-"+this.model.get("id"));_.each(c,function(d){b.append(d.call(a))});return b},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var a=HDABaseView.templates.downloadLinks(_.extend(this.model.toJSON(),{urls:this.urls}));return $(a.trim())},_render_showParamsButton:function(){this.showParamsButton=new IconButtonView({model:new IconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",icon_class:"information"})});return this.showParamsButton.render().$el},_render_displayAppArea:function(){return $("<div/>").addClass("display-apps")},_render_displayApps:function(c){c=c||this.$el;var d=c.find("div.display-apps"),a=this.model.get("display_types"),b=this.model.get("display_apps");if((!this.model.hasData())||(!c||!c.length)||(!d.length)){return}d.html(null);if(!_.isEmpty(a)){d.append(HDABaseView.templates.displayApps({displayApps:a}))}if(!_.isEmpty(b)){d.append(HDABaseView.templates.displayApps({displayApps:b}))}},_render_peek:function(){var a=this.model.get("peek");if(!a){return null}return $("<div/>").append($("<pre/>").attr("id","peek"+this.model.get("id")).addClass("peek").append(a))},_render_body:function(){var a=$("<div/>").attr("id","info-"+this.model.get("id")).addClass("historyItemBody").attr("style","display: none");if(this.expanded){this._render_body_html(a);a.css("display","block")}return a},_render_body_html:function(a){a.html("");switch(this.model.get("state")){case HistoryDatasetAssociation.STATES.NEW:this._render_body_new(a);break;case HistoryDatasetAssociation.STATES.NOT_VIEWABLE:this._render_body_not_viewable(a);break;case HistoryDatasetAssociation.STATES.UPLOAD:this._render_body_uploading(a);break;case HistoryDatasetAssociation.STATES.PAUSED:this._render_body_paused(a);break;case HistoryDatasetAssociation.STATES.QUEUED:this._render_body_queued(a);break;case HistoryDatasetAssociation.STATES.RUNNING:this._render_body_running(a);break;case HistoryDatasetAssociation.STATES.ERROR:this._render_body_error(a);break;case HistoryDatasetAssociation.STATES.DISCARDED:this._render_body_discarded(a);break;case HistoryDatasetAssociation.STATES.SETTING_METADATA:this._render_body_setting_metadata(a);break;case HistoryDatasetAssociation.STATES.EMPTY:this._render_body_empty(a);break;case HistoryDatasetAssociation.STATES.FAILED_METADATA:this._render_body_failed_metadata(a);break;case HistoryDatasetAssociation.STATES.OK:this._render_body_ok(a);break;default:a.append($('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'))}a.append('<div style="clear: both"></div>');this._setUpBehaviors(a)},_render_body_new:function(b){var a=_l("This is a new dataset and not all of its data are available yet");b.append($("<div>"+_l(a)+"</div>"))},_render_body_not_viewable:function(a){a.append($("<div>"+_l("You do not have permission to view dataset")+"</div>"))},_render_body_uploading:function(a){a.append($("<div>"+_l("Dataset is uploading")+"</div>"))},_render_body_queued:function(a){a.append($("<div>"+_l("Job is waiting to run")+"</div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_paused:function(a){a.append($("<div>"+_l("Job is paused. Use the history menu to resume")+"</div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_running:function(a){a.append("<div>"+_l("Job is currently running")+"</div>");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_error:function(a){if(!this.model.get("purged")){a.append($("<div>"+this.model.get("misc_blurb")+"</div>"))}a.append((_l("An error occurred with this dataset")+": <i>"+$.trim(this.model.get("misc_info"))+"</i>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton])))},_render_body_discarded:function(a){a.append("<div>"+_l("The job creating this dataset was cancelled before completion")+".</div>");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_setting_metadata:function(a){a.append($("<div>"+_l("Metadata is being auto-detected")+".</div>"))},_render_body_empty:function(a){a.append($("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_failed_metadata:function(a){a.append($(HDABaseView.templates.failedMetadata(_.extend(this.model.toJSON(),{urls:this.urls}))));this._render_body_ok(a)},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));a.append('<div class="clear"/>');a.append(this._render_displayAppArea());this._render_displayApps(a);a.append(this._render_peek())},events:{"click .historyItemTitle":"toggleBodyVisibility"},toggleBodyVisibility:function(c,a){var b=this;this.expanded=(a===undefined)?(!this.body.is(":visible")):(a);if(this.expanded){b._render_body_html(b.body);this.body.slideDown("fast",function(){b.trigger("body-expanded",b.model.get("id"))})}else{this.body.slideUp("fast",function(){b.trigger("body-collapsed",b.model.get("id"))})}},remove:function(b){var a=this;this.$el.fadeOut("fast",function(){a.$el.remove();a.off();if(b){b()}})},toString:function(){var a=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+a+")"}});HDABaseView.templates={warningMsg:Handlebars.templates["template-warningmessagesmall"],messages:Handlebars.templates["template-hda-warning-messages"],titleLink:Handlebars.templates["template-hda-titleLink"],hdaSummary:Handlebars.templates["template-hda-hdaSummary"],downloadLinks:Handlebars.templates["template-hda-downloadLinks"],failedMetadata:Handlebars.templates["template-hda-failedMetadata"],displayApps:Handlebars.templates["template-hda-displayApps"]};
\ No newline at end of file
+var HDABaseView=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"historyItemContainer",initialize:function(a){if(a.logger){this.logger=this.model.logger=a.logger}this.log(this+".initialize:",a);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];if(!a.urlTemplates){throw ("HDAView needs urlTemplates on initialize")}this.urlTemplates=a.urlTemplates;this.expanded=a.expanded||false;this.model.bind("change",function(c,d){var b=_.without(_.keys(d.changes),"display_apps","display_types");if(b.length){this.render()}else{if(this.expanded){this._render_displayApps()}}},this)},render:function(){var b=this,e=this.model.get("id"),c=this.model.get("state"),a=$("<div/>").attr("id","historyItem-"+e),d=(this.$el.children().size()===0);this.$el.attr("id","historyItemContainer-"+e);this.urls=this._renderUrls(this.urlTemplates,this.model.toJSON());a.addClass("historyItemWrapper").addClass("historyItem").addClass("historyItem-"+c);a.append(this._render_warnings());a.append(this._render_titleBar());this._setUpBehaviors(a);this.body=$(this._render_body());a.append(this.body);this.$el.fadeOut("fast",function(){b.$el.children().remove();b.$el.append(a).fadeIn("fast",function(){b.log(b+" rendered:",b.$el);var f="rendered";if(d){f+=":initial"}else{if(b.model.inReadyState()){f+=":ready"}}b.trigger(f)})});return this},_renderUrls:function(d,a){var b=this,c={};_.each(d,function(e,f){if(_.isObject(e)){c[f]=b._renderUrls(e,a)}else{if(f==="meta_download"){c[f]=b._renderMetaDownloadUrls(e,a)}else{try{c[f]=_.template(e,a)}catch(g){throw (b+"._renderUrls error: "+g+"\n rendering:"+e+"\n with "+JSON.stringify(a))}}}});return c},_renderMetaDownloadUrls:function(b,a){return _.map(a.meta_files,function(c){return{url:_.template(b,{id:a.id,file_type:c.file_type}),file_type:c.file_type}})},_setUpBehaviors:function(a){a=a||this.$el;make_popup_menus(a);a.find(".tooltip").tooltip({placement:"bottom"})},_render_warnings:function(){return $(jQuery.trim(HDABaseView.templates.messages(this.model.toJSON())))},_render_titleBar:function(){var a=$('<div class="historyItemTitleBar" style="overflow: hidden"></div>');a.append(this._render_titleButtons());a.append('<span class="state-icon"></span>');a.append(this._render_titleLink());return a},_render_titleButtons:function(){var a=$('<div class="historyItemButtons"></div>');a.append(this._render_displayButton());return a},_render_displayButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){this.displayButton=null;return null}var b={icon_class:"display",target:"galaxy_main"};if(this.model.get("purged")){b.enabled=false;b.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===HistoryDatasetAssociation.STATES.UPLOAD){b.enabled=false;b.title=_l("This dataset must finish uploading before it can be viewed")}else{b.title=_l("View data");b.href=this.urls.display;var a=this;b.on_click=function(){parent.frame_manager.frame_new({title:"Data Viewer",type:"url",location:"center",content:a.urls.display})}}}this.displayButton=new IconButtonView({model:new IconButton(b)});return this.displayButton.render().$el},_render_titleLink:function(){return $(jQuery.trim(HDABaseView.templates.titleLink(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});return HDABaseView.templates.hdaSummary(a)},_render_primaryActionButtons:function(c){var a=this,b=$("<div/>").attr("id","primary-actions-"+this.model.get("id"));_.each(c,function(d){b.append(d.call(a))});return b},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var a=HDABaseView.templates.downloadLinks(_.extend(this.model.toJSON(),{urls:this.urls}));return $(a.trim())},_render_showParamsButton:function(){this.showParamsButton=new IconButtonView({model:new IconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",icon_class:"information"})});return this.showParamsButton.render().$el},_render_displayAppArea:function(){return $("<div/>").addClass("display-apps")},_render_displayApps:function(c){c=c||this.$el;var d=c.find("div.display-apps"),a=this.model.get("display_types"),b=this.model.get("display_apps");if((!this.model.hasData())||(!c||!c.length)||(!d.length)){return}d.html(null);if(!_.isEmpty(a)){d.append(HDABaseView.templates.displayApps({displayApps:a}))}if(!_.isEmpty(b)){d.append(HDABaseView.templates.displayApps({displayApps:b}))}},_render_peek:function(){var a=this.model.get("peek");if(!a){return null}return $("<div/>").append($("<pre/>").attr("id","peek"+this.model.get("id")).addClass("peek").append(a))},_render_body:function(){var a=$("<div/>").attr("id","info-"+this.model.get("id")).addClass("historyItemBody").attr("style","display: none");if(this.expanded){this._render_body_html(a);a.css("display","block")}return a},_render_body_html:function(a){a.html("");switch(this.model.get("state")){case HistoryDatasetAssociation.STATES.NEW:this._render_body_new(a);break;case HistoryDatasetAssociation.STATES.NOT_VIEWABLE:this._render_body_not_viewable(a);break;case HistoryDatasetAssociation.STATES.UPLOAD:this._render_body_uploading(a);break;case HistoryDatasetAssociation.STATES.PAUSED:this._render_body_paused(a);break;case HistoryDatasetAssociation.STATES.QUEUED:this._render_body_queued(a);break;case HistoryDatasetAssociation.STATES.RUNNING:this._render_body_running(a);break;case HistoryDatasetAssociation.STATES.ERROR:this._render_body_error(a);break;case HistoryDatasetAssociation.STATES.DISCARDED:this._render_body_discarded(a);break;case HistoryDatasetAssociation.STATES.SETTING_METADATA:this._render_body_setting_metadata(a);break;case HistoryDatasetAssociation.STATES.EMPTY:this._render_body_empty(a);break;case HistoryDatasetAssociation.STATES.FAILED_METADATA:this._render_body_failed_metadata(a);break;case HistoryDatasetAssociation.STATES.OK:this._render_body_ok(a);break;default:a.append($('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'))}a.append('<div style="clear: both"></div>');this._setUpBehaviors(a)},_render_body_new:function(b){var a=_l("This is a new dataset and not all of its data are available yet");b.append($("<div>"+_l(a)+"</div>"))},_render_body_not_viewable:function(a){a.append($("<div>"+_l("You do not have permission to view dataset")+"</div>"))},_render_body_uploading:function(a){a.append($("<div>"+_l("Dataset is uploading")+"</div>"))},_render_body_queued:function(a){a.append($("<div>"+_l("Job is waiting to run")+"</div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_paused:function(a){a.append($("<div>"+_l("Job is paused. Use the history menu to resume")+"</div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_running:function(a){a.append("<div>"+_l("Job is currently running")+"</div>");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_error:function(a){if(!this.model.get("purged")){a.append($("<div>"+this.model.get("misc_blurb")+"</div>"))}a.append((_l("An error occurred with this dataset")+": <i>"+$.trim(this.model.get("misc_info"))+"</i>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton])))},_render_body_discarded:function(a){a.append("<div>"+_l("The job creating this dataset was cancelled before completion")+".</div>");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_setting_metadata:function(a){a.append($("<div>"+_l("Metadata is being auto-detected")+".</div>"))},_render_body_empty:function(a){a.append($("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_failed_metadata:function(a){a.append($(HDABaseView.templates.failedMetadata(_.extend(this.model.toJSON(),{urls:this.urls}))));this._render_body_ok(a)},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));a.append('<div class="clear"/>');a.append(this._render_displayAppArea());this._render_displayApps(a);a.append(this._render_peek())},events:{"click .historyItemTitle":"toggleBodyVisibility"},toggleBodyVisibility:function(c,a){var b=this;this.expanded=(a===undefined)?(!this.body.is(":visible")):(a);if(this.expanded){b._render_body_html(b.body);this.body.slideDown("fast",function(){b.trigger("body-expanded",b.model.get("id"))})}else{this.body.slideUp("fast",function(){b.trigger("body-collapsed",b.model.get("id"))})}},remove:function(b){var a=this;this.$el.fadeOut("fast",function(){a.$el.remove();a.off();if(b){b()}})},toString:function(){var a=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+a+")"}});HDABaseView.templates={warningMsg:Handlebars.templates["template-warningmessagesmall"],messages:Handlebars.templates["template-hda-warning-messages"],titleLink:Handlebars.templates["template-hda-titleLink"],hdaSummary:Handlebars.templates["template-hda-hdaSummary"],downloadLinks:Handlebars.templates["template-hda-downloadLinks"],failedMetadata:Handlebars.templates["template-hda-failedMetadata"],displayApps:Handlebars.templates["template-hda-displayApps"]};
\ No newline at end of file
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.
1
0
commit/galaxy-central: carlfeberhard: API histories, delete: ensure HTTPExceptions are raised, better return values; API workflows delete: add code 400 to not found clause, change to code 403 for not accessible clause
by commits-noreply@bitbucket.org 22 Jul '13
by commits-noreply@bitbucket.org 22 Jul '13
22 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/72cf2a3a6a2a/
Changeset: 72cf2a3a6a2a
User: carlfeberhard
Date: 2013-07-22 23:04:52
Summary: API histories, delete: ensure HTTPExceptions are raised, better return values; API workflows delete: add code 400 to not found clause, change to code 403 for not accessible clause
Affected #: 2 files
diff -r 3a27539764348d4099669bc7fe94c9432e62aff0 -r 72cf2a3a6a2a5d476022072b6646dfbc1d519b09 lib/galaxy/webapps/galaxy/api/histories.py
--- a/lib/galaxy/webapps/galaxy/api/histories.py
+++ b/lib/galaxy/webapps/galaxy/api/histories.py
@@ -4,7 +4,7 @@
import pkg_resources
pkg_resources.require( "Paste" )
-from paste.httpexceptions import HTTPBadRequest, HTTPForbidden
+from paste.httpexceptions import HTTPBadRequest, HTTPForbidden, HTTPInternalServerError, HTTPException
from galaxy import web
from galaxy.util import string_as_bool, restore_text
@@ -124,6 +124,7 @@
if kwd.get( 'payload', None ):
purge = string_as_bool( kwd['payload'].get( 'purge', False ) )
+ rval = { 'id' : history_id }
try:
history = self.get_history( trans, history_id, check_ownership=True, check_accessible=False )
history.deleted = True
@@ -152,14 +153,24 @@
# Now mark the history as purged
history.purged = True
self.sa_session.add( history )
+ rval[ 'purged' ] = True
trans.sa_session.flush()
+ rval[ 'deleted' ] = True
- #TODO: better feedback than this...
- except Exception, e:
- return str( e )
+ except HTTPInternalServerError, http_server_err:
+ log.exception( 'Histories API, delete: uncaught HTTPInternalServerError: %s, %s\n%s',
+ history_id, str( kwd ), str( http_server_err ) )
+ raise
+ except HTTPException, http_exc:
+ raise
+ except Exception, exc:
+ log.exception( 'Histories API, delete: uncaught exception: %s, %s\n%s',
+ history_id, str( kwd ), str( exc ) )
+ trans.response.status = 500
+ rval.update({ 'error': str( exc ) })
- return 'OK'
+ return rval
@web.expose_api
def undelete( self, trans, id, **kwd ):
diff -r 3a27539764348d4099669bc7fe94c9432e62aff0 -r 72cf2a3a6a2a5d476022072b6646dfbc1d519b09 lib/galaxy/webapps/galaxy/api/workflows.py
--- a/lib/galaxy/webapps/galaxy/api/workflows.py
+++ b/lib/galaxy/webapps/galaxy/api/workflows.py
@@ -290,13 +290,14 @@
try:
stored_workflow = trans.sa_session.query(self.app.model.StoredWorkflow).get(trans.security.decode_id(workflow_id))
- except Exception,e:
+ except Exception, e:
+ trans.response.status = 400
return ("Workflow with ID='%s' can not be found\n Exception: %s") % (workflow_id, str( e ))
# check to see if user has permissions to selected workflow
if stored_workflow.user != trans.user and not trans.user_is_admin():
if trans.sa_session.query(trans.app.model.StoredWorkflowUserShareAssociation).filter_by(user=trans.user, stored_workflow=stored_workflow).count() == 0:
- trans.response.status = 400
+ trans.response.status = 403
return("Workflow is not owned by or shared with current user")
#Mark a workflow as deleted
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.
1
0