@@ -29,7 +29,7 @@ sheet_ID := env_var_or_default("LINKML_SCHEMA_GOOGLE_SHEET_ID", "")
29
29
sheet_tabs := env_var_or_default (" LINKML_SCHEMA_GOOGLE_SHEET_TABS" , " " )
30
30
sheet_module_path := source_schema_path / sheet_module + " .yaml"
31
31
32
- config_yaml := if env_var_or_default (" LINKML_GENERATORS_CONFIG_YAML" , " " ) = = " " {
32
+ config_yaml := if env_var_or_default (" LINKML_GENERATORS_CONFIG_YAML" , " " ) ! = " " {
33
33
" --config-file " + env_var_or_default (" LINKML_GENERATORS_CONFIG_YAML" , " " )
34
34
} else {
35
35
" "
@@ -106,11 +106,10 @@ _gen-examples:
106
106
107
107
# Generate project files
108
108
_ gen-project : _ensure_pymodel_dir _compile_sheets
109
- poetry run gen-project {{ config_yaml}} -d {{ dest}} {{ source_schema_path}}
109
+ poetry run gen-project {{ config_yaml}} -d {{ dest}} {{ source_schema_path}} && \
110
110
mv {{ dest}} / *.py {{ pymodel}}
111
- poetry run gen-pydantic {{ source_schema_path}} > " {{ pymodel}} /{{ schema_name}} _pydantic.py"
112
111
@ if [ ! -z " ${{ gen_owl_args}} " ]; then \
113
- poetry run gen-owl {{ gen_owl_args }} {{ source_schema_path }} > {{ dest}} / owl/ {{ schema_name }} .owl.ttl || true && \
112
+ mkdir -p {{ dest}} / owl || true && \
114
113
poetry run gen-owl {{ gen_owl_args}} {{ source_schema_path}} > {{ dest}} / owl/ {{ schema_name}} .owl.ttl || true ; \
115
114
fi
116
115
@ if [ ! ${{ gen_java_args}} ]; then \
@@ -127,9 +126,9 @@ test: _test-schema _test-python _test-examples
127
126
_ test-schema :
128
127
poetry run gen-project {{ config_yaml}} -d tmp {{ source_schema_path}}
129
128
130
- # Run Python unit tests
129
+ # Run Python unit tests with pytest
131
130
_ test-python :
132
- poetry run python -m unittest discover
131
+ poetry run python -m pytest
133
132
134
133
# Run example tests
135
134
_ test-examples : _ensure_examples_output
@@ -139,7 +138,7 @@ _test-examples: _ensure_examples_output
139
138
- -counter-example-input-directory src/ data/ examples/ invalid \
140
139
- -input-directory src/ data/ examples/ valid \
141
140
- -output-directory examples/ output \
142
- - -schema src / pid4cat_model / schema / pid4cat_model.yaml > examples/ output/ README.md
141
+ - -schema {{ source_schema_path }} > examples/ output/ README.md
143
142
144
143
# Run linting
145
144
lint :
0 commit comments