Skip to content

Commit ac4f828

Browse files
committed
Improvements to tool data table handling.
- Use sample if available (it won't have data but at least the tool will load). - Add command line option allowing one to specify path this file.
1 parent 834bfb2 commit ac4f828

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

planemo/commands/cmd_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
@options.galaxy_root_option()
8686
@options.install_galaxy_option()
8787
@options.test_data_option()
88+
@options.tool_data_table_option()
8889
@options.dependency_resolvers_option()
8990
@options.job_config_option()
9091
@options.tool_dependency_dir_option()

planemo/galaxy_config.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,14 @@ def __find_tool_data_table(path, test_data_dir, **kwds):
238238
if tool_data_table:
239239
return os.path.abspath(tool_data_table)
240240
else:
241+
extra_paths = [test_data_dir] if test_data_dir else []
241242
return __search_tool_path_for(
242243
path,
243244
"tool_data_table_conf.xml.test",
244-
[test_data_dir] if test_data_dir else [],
245+
extra_paths,
246+
) or __search_tool_path_for( # if all else fails just use sample
247+
path,
248+
"tool_data_table_conf.xml.sample"
245249
)
246250

247251

planemo/options.py

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ def test_data_option():
1212
)
1313

1414

15+
def tool_data_table_option():
16+
return click.option(
17+
"--tool_data_table",
18+
type=click.Path(exists=True, file_okay=True, resolve_path=True),
19+
help='tool_data_table_conf.xml file to for specified tool(s).'
20+
)
21+
22+
1523
def galaxy_root_option():
1624
return click.option(
1725
"--galaxy_root",

0 commit comments

Comments
 (0)