Skip to content

Commit

Permalink
WIP re #39 - run dependency management during repository installation
Browse files Browse the repository at this point in the history
working:
	- fetching valid tool list
	- identifying unique requirements

not working:
	File '/Users/langhorst/src/galaxy_hackathon/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py', line 1138 in prepare_for_install
  [view.manager_dependency(req) for req in uniq_reqs.values()]
TypeError: manager_dependency() takes exactly 1 argument (2 given)
  • Loading branch information
bwlang authored and mvdbeek committed Jul 22, 2016
1 parent 4da167b commit fd9eb82
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,26 @@ def prepare_for_install( self, trans, **kwd ):
tool_panel_section_keys=tool_panel_section_keys,
tool_path=tool_path,
tool_shed_url=tool_shed_url )


#api call to get the tool requirements (from the <requirements> section of each valid tool)
reqs = []
for repository in created_or_updated_tool_shed_repositories:
response = util.url_get(tool_shed_url + "/api/repositories/get_repository_revision_install_info",None,None,
{"name": repository.name, "owner": repository.owner,
"changeset_revision": repository.changeset_revision})
json_response = json.loads(response)
reqs.extend([tool['requirements'] for tool in json_response[1]['valid_tools']][0])

#construct a list of unique requirements, name and version define uniqueness
uniq_reqs = dict()
for req in reqs:
uniq_reqs[(req['name'] + '_' + req['version'])] = {'name': req['name'], 'version': req['version']}

if install_tool_dependencies:
view = views.DependencyResolversView(self.app)
[view.manager_dependency(req) for req in uniq_reqs.values()] #not working yet...

encoded_kwd, query, tool_shed_repositories, encoded_repository_ids = \
install_repository_manager.initiate_repository_installation( installation_dict )
return trans.fill_template( 'admin/tool_shed_repository/initiate_repository_installation.mako',
Expand Down

0 comments on commit fd9eb82

Please sign in to comment.