File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ import sys
2+ import yaml
3+
4+ from bioblend import toolshed
5+
6+ ts = toolshed .ToolShedInstance (url = 'https://toolshed.g2.bx.psu.edu' )
7+ fn = sys .argv [1 ]
8+
9+ # never mind about fancy yaml linting, let's just make sure the files are openable
10+ sys .stdout .write ('Checking modified yaml file {}...\n ' .format (fn ))
11+ with open (fn ) as f :
12+ yml = [n ['name' ] for n in yaml .safe_load (f )['tools' ]]
13+
14+ with open ('{}.lock' .format (fn )) as f :
15+ yml_lock = [n ['name' ] for n in yaml .safe_load (f )['tools' ]]
16+
17+ new_tools = [n for n in yml if n not in yml_lock ]
18+
19+ for tool in new_tools : # check all new tools are in the tool shed
20+ sys .stdout .write ('Checking new tool {} is in the toolshed...\n ' .format (tool ))
21+ search_hits = [hit ['repository' ]['name' ] for hit in ts .repositories .search_repositories (tool ,page_size = 600 )['hits' ]]
22+ assert tool in search_hits , '{} not in toolshed.' .format (tool )
You can’t perform that action at this time.
0 commit comments