Skip to content

Commit 668e6ca

Browse files
author
Peter Amstutz
committed
Fix --print-pre to print document prior to validation. Bump salad version for
bugfix. Passes draft-4.dev1 tests using new syntax.
1 parent 3121bcd commit 668e6ca

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

cwltool/load_tool.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def fetch_document(argsworkflow):
3535
return document_loader, workflowobj, uri
3636

3737

38-
def validate_document(document_loader, workflowobj, uri, enable_dev=False, strict=True):
38+
def validate_document(document_loader, workflowobj, uri,
39+
enable_dev=False, strict=True, preprocess_only=False):
3940
jobobj = None
4041
if "cwl:tool" in workflowobj:
4142
jobobj = workflowobj
@@ -67,7 +68,13 @@ def validate_document(document_loader, workflowobj, uri, enable_dev=False, stric
6768
raise avsc_names
6869

6970
workflowobj["id"] = fileuri
70-
processobj, metadata = schema.load_and_validate(document_loader, avsc_names, workflowobj, strict)
71+
processobj, metadata = document_loader.resolve_all(workflowobj, fileuri)
72+
73+
if preprocess_only:
74+
return document_loader, avsc_names, processobj, metadata, uri
75+
76+
document_loader.validate_links(processobj)
77+
schema.validate_doc(avsc_names, processobj, document_loader, strict)
7178

7279
if not metadata:
7380
metadata = {"$namespaces": processobj.get("$namespaces", {}),

cwltool/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,8 @@ def main(argsl=None,
469469
document_loader, avsc_names, processobj, metadata, uri = validate_document(document_loader,
470470
workflowobj, uri,
471471
enable_dev=args.enable_dev,
472-
strict=args.strict)
472+
strict=args.strict,
473+
preprocess_only=args.print_pre)
473474

474475
if args.print_pre:
475476
stdout.write(json.dumps(processobj, indent=4))

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
'rdflib >= 4.1.0',
4242
'rdflib-jsonld >= 0.3.0',
4343
'shellescape',
44-
'schema-salad==1.10.20160505185111',
44+
'schema-salad==1.11.20160506154702',
4545
'typing'
4646
],
4747
test_suite='tests',

0 commit comments

Comments
 (0)