-
Notifications
You must be signed in to change notification settings - Fork 7
just improvements for overriding commands & generating owl #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
sierra-moxon
merged 1 commit into
linkml:main
from
dalito:just-cmd-improvements_java-and-override
Dec 5, 2025
+34
−11
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 ============== | ||
|
|
||
|
|
@@ -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 | ||
|
|
@@ -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 | ||
|
|
||
| @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 ============== | ||
|
|
||
|
|
@@ -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: | ||
|
|
@@ -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. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 runto${RUN}? but not a blockerThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of
|| truefeels like regression. My usage pattern is to usejust setupmany times during development because the non-just-setup workflow is unclear. See linkml/linkml-project-cookiecutter@887e10eUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. We may add
|| trueback. Does it fail for other reasons than the missing dir which is added now? (in the part below)There was a problem hiding this comment.
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 mainis needed - duh!! That keeps catching me.Maybe the commit message should be changed but not failing now.