-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathtool_builder.py
879 lines (750 loc) · 24.1 KB
/
tool_builder.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
"""This module contains :func:`build` to build tool descriptions.
This class is used by the `tool_init` command and can be used to build
Galaxy and CWL tool descriptions.
"""
import os
import re
import shlex
import shutil
import subprocess
from collections import namedtuple
from planemo import io
from planemo import templates
REUSING_MACROS_MESSAGE = ("Macros file macros.xml already exists, assuming "
" it has relevant planemo-generated definitions.")
DEFAULT_CWL_VERSION = "v1.0"
TOOL_TEMPLATE = """<tool id="{{id}}" name="{{name}}" version="{{version}}">
{%- if description %}
<description>{{ description }}</description>
{%- endif %}
{%- if macros %}
<macros>
<import>macros.xml</import>
</macros>
<expand macro="requirements" />
{%- if version_command %}
<expand macro="version_command" />
{%- endif %}
{%- else %}
<requirements>
{%- for requirement in requirements %}
{{ requirement }}
{%- endfor %}
{%- for container in containers %}
{{ container }}
{%- endfor %}
</requirements>
{%- if version_command %}
<version_command>{{ version_command }}</version_command>
{%- endif %}
{%- endif %}
<command detect_errors="exit_code"><![CDATA[
{%- if command %}
{{ command }}
{%- else %}
TODO: Fill in command template.
{%- endif %}
]]></command>
<inputs>
{%- for input in inputs %}
{{ input }}
{%- endfor %}
</inputs>
<outputs>
{%- for output in outputs %}
{{ output }}
{%- endfor %}
</outputs>
{%- if tests %}
<tests>
{%- for test in tests %}
<test>
{%- for param in test.params %}
<param name="{{ param[0]}}" value="{{ param[1] }}"/>
{%- endfor %}
{%- for output in test.outputs %}
<output name="{{ output[0] }}" file="{{ output[1] }}"/>
{%- endfor %}
</test>
{%- endfor %}
</tests>
{%- endif %}
<help><![CDATA[
{%- if help %}
{{ help }}
{%- else %}
TODO: Fill in help.
{%- endif %}
]]></help>
{%- if macros %}
<expand macro="citations" />
{%- else %}
{%- if doi or bibtex_citations %}
<citations>
{%- for single_doi in doi %}
<citation type="doi">{{ single_doi }}</citation>
{%- endfor %}
{%- for bibtex_citation in bibtex_citations %}
<citation type="bibtex">{{ bibtex_citation }}</citation>
{%- endfor %}
</citations>
{%- endif %}
{%- endif %}
</tool>
"""
MACROS_TEMPLATE = """<macros>
<xml name="requirements">
<requirements>
{%- for requirement in requirements %}
{{ requirement }}
{%- endfor %}
<yield/>
{%- for container in containers %}
{{ container }}
{%- endfor %}
</requirements>
</xml>
<xml name="citations">
<citations>
{%- for single_doi in doi %}
<citation type="doi">{{ single_doi }}</citation>
{%- endfor %}
{%- for bibtex_citation in bibtex_citations %}
<citation type="bibtex">{{ bibtex_citation }}</citation>
{%- endfor %}
<yield />
</citations>
</xml>
{%- if version_command %}
<xml name="version_command">
<version_command>{{ version_command }}</version_command>
</xml>
{%- endif %}
</macros>
"""
CWL_TEMPLATE = """#!/usr/bin/env cwl-runner
cwlVersion: '{{cwl_version}}'
class: CommandLineTool
id: "{{id}}"
label: "{{label}}"
{%- if containers or requirements %}
hints:
{%- for container in containers %}
DockerRequirement:
dockerPull: {{ container.image_id }}
{%- endfor %}
{%- if requirements %}
SoftwareRequirement:
packages:
{%- for requirement in requirements %}
- package: {{ requirement.name }}
{%- if requirement.version %}
version:
- "{{ requirement.version }}"
{%- else %}
version: []
{%- endif %}
{%- endfor %}
{%- endif %}
{%- endif %}
{%- if inputs or outputs %}
inputs:
{%- for input in inputs %}
{{ input.id }}:
type: {{ input.type }}
doc: |
TODO
inputBinding:
position: {{ input.position }}
{%- if input.prefix %}
prefix: "{{input.prefix.prefix}}"
{%- if not input.prefix.separated %}
separate: false
{%- endif %}
{%- endif %}
{%- endfor %}
{%- for output in outputs %}
{%- if output.require_filename %}
{{ output.id }}:
type: string
doc: |
Filename for output {{ output.id }}
inputBinding:
position: {{ output.position }}
{%- if output.prefix %}
prefix: "{{output.prefix.prefix}}"
{%- if not output.prefix.separated %}
separate: false
{%- endif %}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- else %}
inputs: [] # TODO
{%- endif %}
{%- if outputs %}
outputs:
{%- for output in outputs %}
{{ output.id }}:
type: File
outputBinding:
glob: {{ output.glob }}
{%- endfor %}
{%- else %}
outputs: [] # TODO
{%- endif %}
{%- if base_command %}
baseCommand:
{%- for base_command_part in base_command %}
- "{{ base_command_part}}"
{%- endfor %}
{%- else %}
baseCommand: []
{%- endif %}
{%- if arguments %}
arguments:
{%- for argument in arguments %}
- valueFrom: "{{ argument.value }}"
position: {{ argument.position }}
{%- if argument.prefix %}
prefix: "{{argument.prefix.prefix}}"
{%- if not argument.prefix.separated %}
separate: false
{%- endif %}
{%- endif %}
{%- endfor %}
{%- else %}
arguments: []
{%- endif %}
{%- if stdout %}
stdout: {{ stdout }}
{%- endif %}
doc: |
{%- if help %}
{{ help|indent(2) }}
{%- else %}
TODO: Fill in description.
{%- endif %}
"""
CWL_TEST_TEMPLATE = """
- doc: test generated from example command
{%- if inputs %}
job:
{%- for input in inputs %}
{%- if input.type == "File" %}
{{ input.id }}:
class: File
path: test-data/{{ input.example_value }}
{%- else %}
{{ input.id }}: {{ input.example_value }}
{%- endif %}
{%- endfor %}
{%- else %}
job: TODO
{%- endif %}
{%- if outputs %}
outputs:
{%- for output in outputs %}
{{ output.id }}:
path: test-data/{{ output.example_value }}
{%- endfor %}
{%- else %}
outputs: TODO
{%- endif %}
"""
def build(**kwds):
"""Build up a :func:`ToolDescription` from supplid arguments."""
if kwds.get("cwl"):
builder = _build_cwl
else:
builder = _build_galaxy
return builder(**kwds)
def _build_cwl(**kwds):
_handle_help(kwds)
_handle_requirements(kwds)
assert len(kwds["containers"]) <= 1, kwds
command_io = CommandIO(**kwds)
render_kwds = {
"cwl_version": DEFAULT_CWL_VERSION,
"help": kwds.get("help", ""),
"containers": kwds.get("containers", []),
"requirements": kwds.get("requirements", []),
"id": kwds.get("id"),
"label": kwds.get("name"),
}
render_kwds.update(command_io.cwl_properties())
contents = _render(render_kwds, template_str=CWL_TEMPLATE)
test_contents = None
test_files = []
if kwds["test_case"]:
test_contents = _render(render_kwds, template_str=CWL_TEST_TEMPLATE)
for cwl_input in render_kwds["inputs"] or []:
if cwl_input.type == "File" and cwl_input.example_value:
test_files.append(cwl_input.example_value)
for cwl_output in render_kwds["outputs"] or []:
if cwl_output.example_value:
test_files.append(cwl_output.example_value)
return ToolDescription(
contents,
test_contents=test_contents,
test_files=test_files
)
def _build_galaxy(**kwds):
# Test case to build up from supplied inputs and outputs, ultimately
# ignored unless kwds["test_case"] is truthy.
_handle_help(kwds)
# process raw cite urls
cite_urls = kwds.get("cite_url", [])
del kwds["cite_url"]
citations = list(map(UrlCitation, cite_urls))
kwds["bibtex_citations"] = citations
# handle requirements and containers
_handle_requirements(kwds)
command_io = CommandIO(**kwds)
kwds["inputs"] = command_io.inputs
kwds["outputs"] = command_io.outputs
kwds["command"] = command_io.cheetah_template
test_case = command_io.test_case()
# finally wrap up tests
tests, test_files = _handle_tests(kwds, test_case)
kwds["tests"] = tests
# Render tool content from template.
contents = _render(kwds)
macro_contents = None
if kwds["macros"]:
macro_contents = _render(kwds, MACROS_TEMPLATE)
return ToolDescription(
contents,
macro_contents,
test_files=test_files
)
class CommandIO(object):
def __init__(self, **kwds):
command = _find_command(kwds)
cheetah_template = command
# process raw inputs
inputs = kwds.pop("input", [])
inputs = list(map(Input, inputs or []))
# alternatively process example inputs
example_inputs = kwds.pop("example_input", [])
for i, input_file in enumerate(example_inputs or []):
name = "input%d" % (i + 1)
inputs.append(Input(input_file, name=name, example=True))
cheetah_template = _replace_file_in_command(cheetah_template, input_file, name)
# handle raw outputs (from_work_dir ones) as well as named_outputs
outputs = kwds.pop("output", [])
outputs = list(map(Output, outputs or []))
named_outputs = kwds.pop("named_output", [])
for named_output in (named_outputs or []):
outputs.append(Output(name=named_output, example=False))
# handle example outputs
example_outputs = kwds.pop("example_output", [])
for i, output_file in enumerate(example_outputs or []):
name = "output%d" % (i + 1)
from_path = output_file
use_from_path = True
if output_file in cheetah_template:
# Actually found the file in the command, assume it can
# be specified directly and skip from_work_dir.
use_from_path = False
output = Output(name=name, from_path=from_path,
use_from_path=use_from_path, example=True)
outputs.append(output)
cheetah_template = _replace_file_in_command(cheetah_template, output_file, output.name)
self.inputs = inputs
self.outputs = outputs
self.command = command
self.cheetah_template = cheetah_template
def example_input_names(self):
for input in self.inputs:
if input.example:
yield input.input_description
def example_output_names(self):
for output in self.outputs:
if output.example:
yield output.example_path
def cwl_lex_list(self):
if not self.command:
return []
command_parts = shlex.split(self.command)
parse_list = []
input_count = 0
output_count = 0
index = 0
prefixed_parts = []
while index < len(command_parts):
value = command_parts[index]
eq_split = value.split("=")
prefix = None
if not _looks_like_start_of_prefix(index, command_parts):
index += 1
elif len(eq_split) == 2:
prefix = Prefix(eq_split[0] + "=", False)
value = eq_split[1]
index += 1
else:
prefix = Prefix(value, True)
value = command_parts[index + 1]
index += 2
prefixed_parts.append((prefix, value))
for position, (prefix, value) in enumerate(prefixed_parts):
if value in self.example_input_names():
input_count += 1
input = CwlInput(
"input%d" % input_count,
position,
prefix,
value,
)
parse_list.append(input)
elif value in self.example_output_names():
output_count += 1
output = CwlOutput(
"output%d" % output_count,
position,
prefix,
value,
)
parse_list.append(output)
elif prefix:
param_id = prefix.prefix.lower().rstrip("=")
type_ = param_type(value)
input = CwlInput(
param_id,
position,
prefix,
value,
type_=type_,
)
parse_list.append(input)
else:
part = CwlCommandPart(value, position, prefix)
parse_list.append(part)
return parse_list
def cwl_properties(self):
base_command = []
arguments = []
inputs = []
outputs = []
lex_list = self.cwl_lex_list()
index = 0
while index < len(lex_list):
token = lex_list[index]
if isinstance(token, CwlCommandPart):
base_command.append(token.value)
else:
break
index += 1
while index < len(lex_list):
token = lex_list[index]
if token.is_token(">"):
break
token.position = index - len(base_command) + 1
if isinstance(token, CwlCommandPart):
arguments.append(token)
elif isinstance(token, CwlInput):
inputs.append(token)
elif isinstance(token, CwlOutput):
token.glob = "$(inputs.%s)" % token.id
outputs.append(token)
index += 1
stdout = None
if index < len(lex_list):
token = lex_list[index]
if token.is_token(">") and (index + 1) < len(lex_list):
output_token = lex_list[index + 1]
if not isinstance(output_token, CwlOutput):
output_token = CwlOutput("std_out", None)
output_token.glob = "out"
output_token.require_filename = False
outputs.append(output_token)
stdout = "out"
index += 2
else:
io.warn("Example command too complex, you will need to build it up manually.")
return {
"inputs": inputs,
"outputs": outputs,
"arguments": arguments,
"base_command": base_command,
"stdout": stdout,
}
def test_case(self):
test_case = TestCase()
for input in self.inputs:
if input.example:
test_case.params.append((input.name, input.input_description))
for output in self.outputs:
if output.example:
test_case.outputs.append((output.name, output.example_path))
return test_case
def _looks_like_start_of_prefix(index, parts):
value = parts[index]
if len(value.split("=")) == 2:
return True
if index + 1 == len(parts):
return False
next_value = parts[index + 1]
next_value_is_not_start = (len(value.split("=")) != 2) and next_value[0] not in ["-", ">", "<", "|"]
return value.startswith("-") and next_value_is_not_start
Prefix = namedtuple("Prefix", ["prefix", "separated"])
class CwlCommandPart(object):
def __init__(self, value, position, prefix):
self.value = value
self.position = position
self.prefix = prefix
def is_token(self, value):
return self.value == value
class CwlInput(object):
def __init__(self, id, position, prefix, example_value, type_="File"):
self.id = id
self.position = position
self.prefix = prefix
self.example_value = example_value
self.type = type_
def is_token(self, value):
return False
class CwlOutput(object):
def __init__(self, id, position, prefix, example_value):
self.id = id
self.position = position
self.prefix = prefix
self.glob = None
self.example_value = example_value
self.require_filename = True
def is_token(self, value):
return False
def _render(kwds, template_str=TOOL_TEMPLATE):
""" Apply supplied template variables to TOOL_TEMPLATE to generate
the final tool.
"""
return templates.render(template_str, **kwds)
def _replace_file_in_command(command, specified_file, name):
""" Replace example file with cheetah variable name in supplied command
or command template. Be sure to quote the name.
"""
# TODO: check if the supplied variant was single quoted already.
if '"%s"' % specified_file in command:
# Sample command already wrapped filename in double quotes
command = command.replace(specified_file, '$%s' % name)
elif (" %s " % specified_file) in (" " + command + " "):
# In case of spaces, best to wrap filename in double quotes
command = command.replace(specified_file, '"$%s"' % name)
else:
command = command.replace(specified_file, '$%s' % name)
return command
def _handle_help(kwds):
""" Convert supplied help parameters into a help variable for template.
If help_text is supplied, use as is. If help is specified from a command,
run the command and use that help text.
"""
help_text = kwds.get("help_text")
if not help_text:
help_from_command = kwds.get("help_from_command")
if help_from_command:
p = subprocess.Popen(
help_from_command,
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True
)
help_text = p.communicate()[0]
del kwds["help_text"]
del kwds["help_from_command"]
kwds["help"] = help_text
def _handle_tests(kwds, test_case):
""" Given state built up from handling rest of arguments (test_case) and
supplied kwds - build tests for template and corresponding test files.
"""
test_files = []
if kwds["test_case"]:
tests = [test_case]
test_files.extend(map(lambda x: x[1], test_case.params))
test_files.extend(map(lambda x: x[1], test_case.outputs))
else:
tests = []
return tests, test_files
def _handle_requirements(kwds):
""" Convert requirements and containers specified from the command-line
into abstract format for consumption by the template.
"""
requirements = kwds["requirement"]
del kwds["requirement"]
requirements = list(map(Requirement, requirements or []))
container = kwds["container"]
del kwds["container"]
containers = list(map(Container, container or []))
kwds["requirements"] = requirements
kwds["containers"] = containers
def _find_command(kwds):
"""Find base command from supplied arguments or just return None.
If no such command was supplied (template will just replace this
with a TODO item).
"""
command = kwds.get("command")
if not command:
command = kwds.get("example_command", None)
if command:
del kwds["example_command"]
return command
class UrlCitation(object):
def __init__(self, url):
self.url = url
def __str__(self):
if "github.com" in self.url:
return self._github_str()
else:
return self._url_str()
def _github_str(self):
url = self.url
title = url.split("/")[-1]
return '''
@misc{github%s,
author = {LastTODO, FirstTODO},
year = {TODO},
title = {%s},
publisher = {GitHub},
journal = {GitHub repository},
url = {%s},
}''' % (title, title, url)
def _url_str(self):
url = self.url
return '''
@misc{renameTODO,
author = {LastTODO, FirstTODO},
year = {TODO},
title = {TODO},
url = {%s},
}''' % (url)
class ToolDescription(object):
"""An description of the tool and related files to create."""
def __init__(self, contents, macro_contents=None, test_contents=None, test_files=[]):
self.contents = contents
self.test_contents = test_contents
self.macro_contents = macro_contents
self.test_files = test_files
class Input(object):
def __init__(self, input_description, name=None, example=False):
parts = input_description.split(".")
name = name or parts[0]
if len(parts) > 0:
datatype = ".".join(parts[1:])
else:
datatype = "data"
self.input_description = input_description
self.example = example
self.name = name
self.datatype = datatype
def __str__(self):
template = '<param type="data" name="{0}" format="{1}" />'
self.datatype = self.datatype.split(".")[-1]
return template.format(self.name, self.datatype)
class Output(object):
def __init__(self, from_path=None, name=None, use_from_path=False, example=False):
if from_path:
parts = from_path.split(".")
name = name or parts[0]
if len(parts) > 1:
datatype = ".".join(parts[1:])
else:
datatype = "data"
else:
name = name
datatype = "data"
self.name = name
self.datatype = datatype
if use_from_path:
self.from_path = from_path
else:
self.from_path = None
self.example = example
if example:
self.example_path = from_path
def __str__(self):
if self.from_path:
return self._from_path_str()
else:
return self._named_str()
def _from_path_str(self):
template = '<data name="{0}" format="{1}" from_work_dir="{2}" />'
return template.format(self.name, self.datatype, self.from_path)
def _named_str(self):
template = '<data name="{0}" format="{1}" />'
return template.format(self.name, self.datatype)
class Requirement(object):
def __init__(self, requirement):
parts = requirement.split("@", 1)
if len(parts) > 1:
name = parts[0]
version = "@".join(parts[1:])
else:
name = parts[0]
version = None
self.name = name
self.version = version
def __str__(self):
base = '<requirement type="package"{0}>{1}</requirement>'
if self.version is not None:
attrs = ' version="{0}"'.format(self.version)
else:
attrs = ''
return base.format(attrs, self.name)
def param_type(value):
if re.match("^\d+$", value):
return "int"
elif re.match("^\d+?\.\d+?$", value):
return "float"
else:
return "string"
class Container(object):
def __init__(self, image_id):
self.type = "docker"
self.image_id = image_id
def __str__(self):
template = '<container type="{0}">{1}</container>'
return template.format(self.type, self.image_id)
class TestCase(object):
def __init__(self):
self.params = []
self.outputs = []
def write_tool_description(ctx, tool_description, **kwds):
"""Write a tool description to the file system guided by supplied CLI kwds."""
tool_id = kwds.get("id")
output = kwds.get("tool")
if not output:
extension = "cwl" if kwds.get("cwl") else "xml"
output = "%s.%s" % (tool_id, extension)
if not io.can_write_to_path(output, **kwds):
ctx.exit(1)
io.write_file(output, tool_description.contents)
io.info("Tool written to %s" % output)
test_contents = tool_description.test_contents
if test_contents:
sep = "-" if "-" in tool_id else "_"
tests_path = "%s%stests.yml" % (kwds.get("id"), sep)
if not io.can_write_to_path(tests_path, **kwds):
ctx.exit(1)
io.write_file(tests_path, test_contents)
io.info("Tool tests written to %s" % tests_path)
macros = kwds["macros"]
macros_file = "macros.xml"
if macros and not os.path.exists(macros_file):
io.write_file(macros_file, tool_description.macro_contents)
elif macros:
io.info(REUSING_MACROS_MESSAGE)
if tool_description.test_files:
if not os.path.exists("test-data"):
io.info("No test-data directory, creating one.")
os.makedirs('test-data')
for test_file in tool_description.test_files:
io.info("Copying test-file %s" % test_file)
try:
shutil.copy(test_file, 'test-data')
except Exception as e:
io.info("Copy of %s failed: %s" % (test_file, e))
__all__ = (
"build",
"ToolDescription",
"write_tool_description",
)