Skip to content

Commit 4c0f2a1

Browse files
committedJan 11, 2025
justfile fixes after testing all commands
1 parent 7fbd295 commit 4c0f2a1

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed
 

‎{{cookiecutter.project_name}}/justfile

+6-7
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ sheet_ID := env_var_or_default("LINKML_SCHEMA_GOOGLE_SHEET_ID", "")
2929
sheet_tabs := env_var_or_default("LINKML_SCHEMA_GOOGLE_SHEET_TABS", "")
3030
sheet_module_path := source_schema_path / sheet_module + ".yaml"
3131

32-
config_yaml := if env_var_or_default("LINKML_GENERATORS_CONFIG_YAML", "") == "" {
32+
config_yaml := if env_var_or_default("LINKML_GENERATORS_CONFIG_YAML", "") != "" {
3333
"--config-file " + env_var_or_default("LINKML_GENERATORS_CONFIG_YAML", "")
3434
} else {
3535
""
@@ -106,11 +106,10 @@ _gen-examples:
106106

107107
# Generate project files
108108
_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}} && \
110110
mv {{dest}}/*.py {{pymodel}}
111-
poetry run gen-pydantic {{source_schema_path}} > "{{pymodel}}/{{schema_name}}_pydantic.py"
112111
@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 && \
114113
poetry run gen-owl {{gen_owl_args}} {{source_schema_path}} > {{dest}}/owl/{{schema_name}}.owl.ttl || true ; \
115114
fi
116115
@if [ ! ${{gen_java_args}} ]; then \
@@ -127,9 +126,9 @@ test: _test-schema _test-python _test-examples
127126
_test-schema:
128127
poetry run gen-project {{config_yaml}} -d tmp {{source_schema_path}}
129128

130-
# Run Python unit tests
129+
# Run Python unit tests with pytest
131130
_test-python:
132-
poetry run python -m unittest discover
131+
poetry run python -m pytest
133132

134133
# Run example tests
135134
_test-examples: _ensure_examples_output
@@ -139,7 +138,7 @@ _test-examples: _ensure_examples_output
139138
--counter-example-input-directory src/data/examples/invalid \
140139
--input-directory src/data/examples/valid \
141140
--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
143142

144143
# Run linting
145144
lint:

0 commit comments

Comments
 (0)