Skip to content

Commit 667943c

Browse files
committed
--single-step to extract/run a single step
1 parent 828e48a commit 667943c

File tree

11 files changed

+327
-77
lines changed

11 files changed

+327
-77
lines changed

cwltool/argparser.py

Lines changed: 62 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ def arg_parser() -> argparse.ArgumentParser:
6464
dest="preserve_entire_environment",
6565
)
6666

67-
exgroup = parser.add_mutually_exclusive_group()
68-
exgroup.add_argument(
67+
containergroup = parser.add_mutually_exclusive_group()
68+
containergroup.add_argument(
6969
"--rm-container",
7070
action="store_true",
7171
default=True,
7272
help="Delete Docker container used by jobs after they exit (default)",
7373
dest="rm_container",
7474
)
7575

76-
exgroup.add_argument(
76+
containergroup.add_argument(
7777
"--leave-container",
7878
action="store_false",
7979
default=True,
@@ -123,16 +123,16 @@ def arg_parser() -> argparse.ArgumentParser:
123123
default=DEFAULT_TMP_PREFIX,
124124
)
125125

126-
exgroup = parser.add_mutually_exclusive_group()
127-
exgroup.add_argument(
126+
intgroup = parser.add_mutually_exclusive_group()
127+
intgroup.add_argument(
128128
"--tmp-outdir-prefix",
129129
type=str,
130130
help="Path prefix for intermediate output directories. Defaults to the "
131131
"value of --tmpdir-prefix.",
132132
default="",
133133
)
134134

135-
exgroup.add_argument(
135+
intgroup.add_argument(
136136
"--cachedir",
137137
type=str,
138138
default="",
@@ -141,25 +141,25 @@ def arg_parser() -> argparse.ArgumentParser:
141141
"troubleshooting of CWL documents.",
142142
)
143143

144-
exgroup = parser.add_mutually_exclusive_group()
145-
exgroup.add_argument(
144+
tmpgroup = parser.add_mutually_exclusive_group()
145+
tmpgroup.add_argument(
146146
"--rm-tmpdir",
147147
action="store_true",
148148
default=True,
149149
help="Delete intermediate temporary directories (default)",
150150
dest="rm_tmpdir",
151151
)
152152

153-
exgroup.add_argument(
153+
tmpgroup.add_argument(
154154
"--leave-tmpdir",
155155
action="store_false",
156156
default=True,
157157
help="Do not delete intermediate temporary directories",
158158
dest="rm_tmpdir",
159159
)
160160

161-
exgroup = parser.add_mutually_exclusive_group()
162-
exgroup.add_argument(
161+
outgroup = parser.add_mutually_exclusive_group()
162+
outgroup.add_argument(
163163
"--move-outputs",
164164
action="store_const",
165165
const="move",
@@ -169,7 +169,7 @@ def arg_parser() -> argparse.ArgumentParser:
169169
dest="move_outputs",
170170
)
171171

172-
exgroup.add_argument(
172+
outgroup.add_argument(
173173
"--leave-outputs",
174174
action="store_const",
175175
const="leave",
@@ -178,7 +178,7 @@ def arg_parser() -> argparse.ArgumentParser:
178178
dest="move_outputs",
179179
)
180180

181-
exgroup.add_argument(
181+
outgroup.add_argument(
182182
"--copy-outputs",
183183
action="store_const",
184184
const="copy",
@@ -188,16 +188,16 @@ def arg_parser() -> argparse.ArgumentParser:
188188
dest="move_outputs",
189189
)
190190

191-
exgroup = parser.add_mutually_exclusive_group()
192-
exgroup.add_argument(
191+
pullgroup = parser.add_mutually_exclusive_group()
192+
pullgroup.add_argument(
193193
"--enable-pull",
194194
default=True,
195195
action="store_true",
196196
help="Try to pull Docker images",
197197
dest="pull_image",
198198
)
199199

200-
exgroup.add_argument(
200+
pullgroup.add_argument(
201201
"--disable-pull",
202202
default=True,
203203
action="store_false",
@@ -280,65 +280,68 @@ def arg_parser() -> argparse.ArgumentParser:
280280
type=str,
281281
)
282282

283-
exgroup = parser.add_mutually_exclusive_group()
284-
exgroup.add_argument(
283+
printgroup = parser.add_mutually_exclusive_group()
284+
printgroup.add_argument(
285285
"--print-rdf",
286286
action="store_true",
287287
help="Print corresponding RDF graph for workflow and exit",
288288
)
289-
exgroup.add_argument(
289+
printgroup.add_argument(
290290
"--print-dot",
291291
action="store_true",
292292
help="Print workflow visualization in graphviz format and exit",
293293
)
294-
exgroup.add_argument(
294+
printgroup.add_argument(
295295
"--print-pre",
296296
action="store_true",
297297
help="Print CWL document after preprocessing.",
298298
)
299-
exgroup.add_argument(
299+
printgroup.add_argument(
300300
"--print-deps", action="store_true", help="Print CWL document dependencies."
301301
)
302-
exgroup.add_argument(
302+
printgroup.add_argument(
303303
"--print-input-deps",
304304
action="store_true",
305305
help="Print input object document dependencies.",
306306
)
307-
exgroup.add_argument(
307+
printgroup.add_argument(
308308
"--pack",
309309
action="store_true",
310310
help="Combine components into single document and print.",
311311
)
312-
exgroup.add_argument(
312+
printgroup.add_argument(
313313
"--version", action="store_true", help="Print version and exit"
314314
)
315-
exgroup.add_argument(
315+
printgroup.add_argument(
316316
"--validate", action="store_true", help="Validate CWL document only."
317317
)
318-
exgroup.add_argument(
318+
printgroup.add_argument(
319319
"--print-supported-versions",
320320
action="store_true",
321321
help="Print supported CWL specs.",
322322
)
323-
exgroup.add_argument(
323+
printgroup.add_argument(
324324
"--print-subgraph",
325325
action="store_true",
326326
help="Print workflow subgraph that will execute. Can combined with "
327-
"--target.",
327+
"--target or --single-step",
328328
)
329-
exgroup.add_argument(
329+
printgroup.add_argument(
330330
"--print-targets", action="store_true", help="Print targets (output parameters)"
331331
)
332+
printgroup.add_argument(
333+
"--make-template", action="store_true", help="Generate a template input object"
334+
)
332335

333-
exgroup = parser.add_mutually_exclusive_group()
334-
exgroup.add_argument(
336+
strictgroup = parser.add_mutually_exclusive_group()
337+
strictgroup.add_argument(
335338
"--strict",
336339
action="store_true",
337340
help="Strict validation (unrecognized or out of place fields are error)",
338341
default=True,
339342
dest="strict",
340343
)
341-
exgroup.add_argument(
344+
strictgroup.add_argument(
342345
"--non-strict",
343346
action="store_false",
344347
help="Lenient validation (ignore unrecognized fields)",
@@ -354,28 +357,30 @@ def arg_parser() -> argparse.ArgumentParser:
354357
dest="skip_schemas",
355358
)
356359

357-
exgroup = parser.add_mutually_exclusive_group()
358-
exgroup.add_argument(
360+
doccachegroup = parser.add_mutually_exclusive_group()
361+
doccachegroup.add_argument(
359362
"--no-doc-cache",
360363
action="store_false",
361364
help="Disable disk cache for documents loaded over HTTP",
362365
default=True,
363366
dest="doc_cache",
364367
)
365-
exgroup.add_argument(
368+
doccachegroup.add_argument(
366369
"--doc-cache",
367370
action="store_true",
368371
help="Enable disk cache for documents loaded over HTTP",
369372
default=True,
370373
dest="doc_cache",
371374
)
372375

373-
exgroup = parser.add_mutually_exclusive_group()
374-
exgroup.add_argument("--verbose", action="store_true", help="Default logging")
375-
exgroup.add_argument(
376+
volumegroup = parser.add_mutually_exclusive_group()
377+
volumegroup.add_argument("--verbose", action="store_true", help="Default logging")
378+
volumegroup.add_argument(
376379
"--quiet", action="store_true", help="Only print warnings and errors."
377380
)
378-
exgroup.add_argument("--debug", action="store_true", help="Print even more logging")
381+
volumegroup.add_argument(
382+
"--debug", action="store_true", help="Print even more logging"
383+
)
379384

380385
parser.add_argument(
381386
"--strict-memory-limit",
@@ -506,14 +511,14 @@ def arg_parser() -> argparse.ArgumentParser:
506511
default=False,
507512
)
508513

509-
exgroup = parser.add_mutually_exclusive_group()
510-
exgroup.add_argument(
514+
colorgroup = parser.add_mutually_exclusive_group()
515+
colorgroup.add_argument(
511516
"--enable-color",
512517
action="store_true",
513518
help="Enable logging color (default enabled)",
514519
default=not onWindows(),
515520
)
516-
exgroup.add_argument(
521+
colorgroup.add_argument(
517522
"--disable-color",
518523
action="store_false",
519524
dest="enable_color",
@@ -545,15 +550,15 @@ def arg_parser() -> argparse.ArgumentParser:
545550
help=argparse.SUPPRESS,
546551
)
547552

548-
exgroup = parser.add_mutually_exclusive_group()
549-
exgroup.add_argument(
553+
reggroup = parser.add_mutually_exclusive_group()
554+
reggroup.add_argument(
550555
"--enable-ga4gh-tool-registry",
551556
action="store_true",
552557
help="Enable tool resolution using GA4GH tool registry API",
553558
dest="enable_ga4gh_tool_registry",
554559
default=True,
555560
)
556-
exgroup.add_argument(
561+
reggroup.add_argument(
557562
"--disable-ga4gh-tool-registry",
558563
action="store_false",
559564
help="Disable tool resolution using GA4GH tool registry API",
@@ -579,15 +584,15 @@ def arg_parser() -> argparse.ArgumentParser:
579584
choices=("stop", "continue"),
580585
)
581586

582-
exgroup = parser.add_mutually_exclusive_group()
583-
exgroup.add_argument(
587+
checkgroup = parser.add_mutually_exclusive_group()
588+
checkgroup.add_argument(
584589
"--compute-checksum",
585590
action="store_true",
586591
default=True,
587592
help="Compute checksum of contents while collecting outputs",
588593
dest="compute_checksum",
589594
)
590-
exgroup.add_argument(
595+
checkgroup.add_argument(
591596
"--no-compute-checksum",
592597
action="store_false",
593598
help="Do not compute checksum of contents while collecting outputs",
@@ -602,9 +607,6 @@ def arg_parser() -> argparse.ArgumentParser:
602607
"spaces and hash characters.",
603608
dest="relax_path_checks",
604609
)
605-
exgroup.add_argument(
606-
"--make-template", action="store_true", help="Generate a template input object"
607-
)
608610

609611
parser.add_argument(
610612
"--force-docker-pull",
@@ -628,13 +630,21 @@ def arg_parser() -> argparse.ArgumentParser:
628630
help="Read process requirement overrides from file.",
629631
)
630632

631-
parser.add_argument(
633+
subgroup = parser.add_mutually_exclusive_group()
634+
subgroup.add_argument(
632635
"--target",
633636
"-t",
634637
action="append",
635638
help="Only execute steps that contribute to listed targets (can be "
636639
"provided more than once).",
637640
)
641+
subgroup.add_argument(
642+
"--single-step",
643+
type=str,
644+
default=None,
645+
help="Only executes a single step in a workflow. The input object must "
646+
"match that step's inputs. Can be combined with --print-subgraph.",
647+
)
638648

639649
parser.add_argument(
640650
"--mpi-config-file",

0 commit comments

Comments
 (0)