Skip to content

Commit 68512ea

Browse files
author
GlassOfWhiskey
committed
Generate fast_parser.py with Schema SALAD codegen
This commit generates a cwltool-specific parser that understands its CWL extensions. The parser inherits from those defined within the `cwl-utils` package, allowing to reuse utility functions.
1 parent 10cabef commit 68512ea

8 files changed

Lines changed: 5193 additions & 15 deletions

File tree

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,16 @@ pyupgrade: $(PYSOURCES)
193193
pyupgrade --exit-zero-even-if-changed --py310-plus $^
194194
auto-walrus $^
195195

196+
cwltool/fast_parser.py: FORCE
197+
schema-salad-tool --codegen python \
198+
--codegen-parser-info "org.w3id.cwl.v1_2" \
199+
--codegen-parent "https://w3id.org/cwl/salad=schema_salad.metaschema" \
200+
--codegen-parent "https://w3id.org/cwl/cwl=cwl_utils.parser.cwl_v1_2" \
201+
https://github.com/common-workflow-language/cwl-v1.2/raw/codegen/extensions.yml \
202+
> $@
203+
204+
regen_fast_parser: cwltool/fast_parser.py
205+
196206
release-test: FORCE
197207
git diff-index --quiet HEAD -- || ( echo You have uncommitted changes, please commit them and try again; false )
198208
./release-test.sh

cwltool/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
if TYPE_CHECKING:
2323
from _typeshed import SupportsWrite
24-
from cwl_utils.parser.cwl_v1_2 import LoadingOptions
24+
from schema_salad.runtime import LoadingOptions
2525

2626
from .builder import Builder
2727
from .cwlprov.provenance_profile import ProvenanceProfile

0 commit comments

Comments
 (0)