Skip to content

Commit b86efc7

Browse files
authored
Merge pull request #624 from common-workflow-language/codegen_docs
codegen: document examples, freshen argparse help
2 parents 3059ff0 + 363c79e commit b86efc7

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

README.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,27 @@ render as SVG::
9898

9999
$ schema-salad-tool --print-inheritance-dot myschema.yml | dot -Tsvg > myschema.svg
100100

101+
Codegen Examples
102+
----------------
103+
104+
These are helpful to see how to use the output of `schema-salad-tool --codegen`
105+
in different languages for loading and/or creating/editing/saving objects,
106+
using the `CWL v1.2 schema <https://github.com/common-workflow-language/cwl-v1.2/blob/1.2.1_proposed/CommonWorkflowLanguage.yml>`_
107+
as an example.
108+
109+
+-------------+---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
110+
| Language | Repository | Serializaton Example | Deserialization Example |
111+
+=============+=========================================================+======================================================================================================================================================+============================================================================================================================================================================+
112+
| Python | https://github.com/common-workflow-language/cwl-utils/ | `create_cwl_from_objects.py <https://github.com/common-workflow-language/cwl-utils/blob/main/create_cwl_from_objects.py>`_ | `load_document() <https://github.com/common-workflow-language/cwl-utils/blob/main/cwl_utils/parser/__init__.py#L93>`_ |
113+
+-------------+---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
114+
| Java | https://github.com/common-workflow-language/cwljava/ | (Not yet implemented) | `PackedWorkflowClassTest.java <https://github.com/common-workflow-language/cwljava/blob/cwl-1.2.0/src/test/java/org/w3id/cwl/cwl1_2/utils/PackedWorkflowClassTest.java>`_ |
115+
+-------------+---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
116+
| TypeScript | https://github.com/common-workflow-lab/cwl-ts-auto | `Creating, editing, and saving CWL docs with TypeScript <https://github.com/common-workflow-lab/cwl-ts-auto#creating-editing-and-saving-documents>`_ | `Loading CWL documents with TypeScript <https://github.com/common-workflow-lab/cwl-ts-auto#loading-documents>`_ |
117+
+-------------+---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
118+
| .Net | https://github.com/common-workflow-lab/CWLDotNet | `Creating, editing, and saving CWL docs with .Net <https://github.com/common-workflow-lab/CWLDotNet#creating-editing-and-serializing-documents>`_ | `Loading CWL documents with .Net <https://github.com/common-workflow-lab/CWLDotNet#loading-documents>`_ |
119+
+-------------+---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
120+
| C++ | https://github.com/common-workflow-lab/cwl-cpp-auto | `cwl_output_example.cpp <https://github.com/common-workflow-lab/cwl-cpp-auto/blob/main/cwl_output_example.cpp>`_ | (Not yet implemented) |
121+
+-------------+---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
101122

102123
Quick Start
103124
-----------

schema_salad/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,22 @@ def arg_parser() -> argparse.ArgumentParser:
9595
type=str,
9696
metavar="language",
9797
help="Generate classes in target language, currently supported: "
98-
"python, java, typescript, dotnet",
98+
"python, java, typescript, dotnet, cpp",
9999
)
100100

101101
parser.add_argument(
102102
"--codegen-target",
103103
type=str,
104104
default=None,
105-
help="Defaults to sys.stdout for python and ./ for Java",
105+
help="Defaults to sys.stdout for Python/C++ and ./ for " "Java/TypeScript/.Net",
106106
)
107107

108108
parser.add_argument(
109109
"--codegen-examples",
110110
type=str,
111111
metavar="directory",
112112
default=None,
113-
help="Directory of example documents for test case generation (Java only).",
113+
help="Directory of example documents for test case generation (Java/TypeScript/.Net only).",
114114
)
115115

116116
parser.add_argument(
@@ -119,7 +119,7 @@ def arg_parser() -> argparse.ArgumentParser:
119119
metavar="dotted.package",
120120
default=None,
121121
help="Optional override of the package name which is other derived "
122-
"from the base URL (Java only).",
122+
"from the base URL (Java/TypeScript/.Net only).",
123123
),
124124

125125
parser.add_argument(

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ skip_install = true
7878
[testenv:py310-lintreadme]
7979
description = Lint the README.rst->.md conversion
8080
commands =
81-
make dist
82-
twine check dist/*
81+
make clean dist
82+
twine check dist/schema[-_]salad*
8383
deps =
8484
twine
85-
wheel
85+
build
8686
readme_renderer[md]
8787
skip_install = true

0 commit comments

Comments
 (0)