Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions template/config.public.mk.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ LINKML_GENERATORS_DOC_ARGS=

## pass args to workaround genowl rdfs config bug (linkml#1453)
## (i.e. --no-type-objects --no-metaclasses --metadata-profile=rdfs)
# LINKML_GENERATORS_OWL_ARGS="--no-type-objects --no-metaclasses --metadata-profile=rdfs"
LINKML_GENERATORS_OWL_ARGS=

## pass args to pydantic generator which isn't supported by gen-project
Expand Down
40 changes: 29 additions & 11 deletions template/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dest := "project"
pymodel := src / schema_name / "datamodel"
source_schema_path := source_schema_dir / schema_name + ".yaml"
docdir := "docs/elements" # Directory for generated documentation
merged_schema_path := "docs/schema" / schema_name + ".yaml"
distrib_schema_path := "docs/schema" # Directory for publishing schema artifacts

# ============== Project recipes ==============

Expand Down Expand Up @@ -92,9 +92,9 @@ test: _test-schema _test-python _test-examples
lint:
uv run linkml-lint {{source_schema_dir}}

# Generate md documentation for the schema
# Generate md documentation for the schema and add artifacts
[group('model development')]
gen-doc: _gen-yaml
gen-doc: _gen-yaml && _add-artifacts
uv run gen-doc {{gen_doc_args}} -d {{docdir}} {{source_schema_path}}

# Build docs and run test server
Expand All @@ -112,13 +112,19 @@ gen-project:
uv run gen-project {{config_yaml}} -d {{dest}} {{source_schema_path}}
mv {{dest}}/*.py {{pymodel}}
uv run gen-pydantic {{gen_pydantic_args}} {{source_schema_path}} > {{pymodel}}/{{schema_name}}_pydantic.py

@# Some generators ignore config_yaml or cannot create directories, so we run them separately.
uv run gen-java {{gen_java_args}} --output-directory {{dest}}/java/ {{source_schema_path}}
@if [ {{gen_owl_args}} ]; then \
echo "using gen-owl environment args (maybe for issue/1453)" && \
uv run gen-owl {{gen_owl_args}} {{source_schema_path}} > {{dest}}/owl/{{schema_name}}.owl.ttl || true ; \

@if [ ! -d "{{dest}}/typescript" ]; then \
mkdir -p {{dest}}/typescript ; \
fi
uv run gen-typescript {{gen_ts_args}} {{source_schema_path}} > {{dest}}/typescript/{{schema_name}}.ts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point, we should move uv run to ${RUN}? but not a blocker

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of || true feels like regression. My usage pattern is to use just setup many times during development because the non-just-setup workflow is unclear. See linkml/linkml-project-cookiecutter@887e10e

Copy link
Member Author

@dalito dalito Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. We may add || true back. Does it fail for other reasons than the missing dir which is added now? (in the part below)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reply @dalito
Actually ignore my comment.
I spent some time troubleshooting before I realized --vcs-ref main is needed - duh!! That keeps catching me.

Maybe the commit message should be changed but not failing now.

commit a32369546f2ac0346957182a80f07e44d429cbdf (HEAD -> main)
Author: noelmcloughlin <[email protected]>
Date:   Mon Dec 8 22:30:52 2025 +0000

    Initialise git with minimal project

commit 0dd78469240e4c6f70d6b39e931b821ea1a18b63
Author: noelmcloughlin <[email protected]>
Date:   Mon Dec 8 22:30:41 2025 +0000

    Initialise git with minimal project

commit 1f1ddd3fb3f1bee698144c6fbb15bbc51be5ad1f
Author: noelmcloughlin <[email protected]>
Date:   Mon Dec 8 22:30:22 2025 +0000

    Initialise git with minimal project


@if [ ! -d "{{dest}}/owl" ]; then \
mkdir -p {{dest}}/owl ; \
fi
mkdir -p {{dest}}/typescript
uv run gen-typescript {{gen_ts_args}} {{source_schema_path}} > {{dest}}/typescript/{{schema_name}}.ts || true
uv run gen-owl {{gen_owl_args}} {{source_schema_path}} > "{{dest}}/owl/{{schema_name}}.owl.ttl"

# ============== Migrations recipes for Copier ==============

Expand Down Expand Up @@ -196,10 +202,13 @@ _test-examples: _ensure_examples_output
--output-directory examples/output \
--schema {{source_schema_path}} > examples/output/README.md

# Generate merged model
# Add the merged model to docs/schema.
_gen-yaml:
-mkdir -p docs/schema
uv run gen-yaml {{source_schema_path}} > {{merged_schema_path}}
-mkdir -p {{distrib_schema_path}}
uv run gen-yaml {{source_schema_path}} > {{distrib_schema_path}}/{{schema_name}}.yaml

# Overridable recipe to add project-specific artifacts to the distribution schema path
_add-artifacts:

# Run documentation server
_serve:
Expand Down Expand Up @@ -246,3 +255,12 @@ _ensure_examples_output: # Ensure a clean examples/output directory exists
# ============== Include project-specific recipes ==============

import "project.justfile"

# ====== Override recipes from above with custom versions =======

# Uncomment the following line to allow duplicate recipe names
#set allow-duplicate-recipes

# Overriding recipes from the root justfile by adding a recipe with the same
# name in an imported file is not possible until a known issue in just is fixed,
# https://github.com/casey/just/issues/2540 - So we need to override them here.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

4 changes: 4 additions & 0 deletions template/project.justfile
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
## Add your own just recipes here. This is imported by the main justfile.

# Overriding recipes from the root justfile by adding a recipe with the same
# name in this file is not possible until a known issue in just is fixed,
# https://github.com/casey/just/issues/2540