Skip to content

Commit 4048c28

Browse files
authored
Merge pull request #18 from biolink/patch-missing-justfile-make-targets
Patching justfile to include missing make targets
2 parents 67c2831 + ed977fd commit 4048c28

File tree

2 files changed

+51
-21
lines changed

2 files changed

+51
-21
lines changed

README.md

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pip install uv
6464

6565
### Getting Started
6666

67-
Note that the following commands assume you are in the project root directory, and the equivalent **`just`** commands may be substituted for **`make`** (namely `just test` instead of `make test`)
67+
Note that the following commands assume you are in the project root directory, and the equivalent **`just`** commands may be substituted for several **`make`** targets (namely `just test` instead of `make test`)
6868

6969
1. **Install dependencies:**
7070
```bash
@@ -73,38 +73,49 @@ Note that the following commands assume you are in the project root directory, a
7373

7474
2. **Run tests:**
7575
```bash
76-
make test
76+
make test # or just test
7777
```
7878

7979
3. **Generate documentation:**
8080
```bash
8181
make gendoc
8282
```
8383

84-
4. **Create a new RIG:**
85-
```bash
86-
make new-rig INFORES=infores:example NAME="Example Data Source"
87-
```
88-
8984
### Working with RIGs
9085

9186
#### Creating a New RIG
9287

9388
```bash
9489
# Create a new RIG from the template
95-
make new-rig INFORES=infores:mydatasource NAME="My Data Source RIG"
90+
make new-rig INFORES=infores:example NAME="Example Data Source"
9691

9792
# This creates src/docs/rigs/mydatasource_rig.yaml
9893
# Edit the file to fill in your specific information
9994
```
10095

96+
or using the equivalent **`just`** command:
97+
98+
```bash
99+
just INFORES=infores:example NAME="Example Data Source" new-rig
100+
```
101+
102+
Note that for the **`just`** command, the script variables must precede the just recipe ("target") name on the command line (reverse of the make command).
103+
101104
#### Validating RIGs
102105

103106
```bash
104107
# Validate all RIG files against the schema
105-
make validate-rigs
108+
make validate-rigs
109+
```
110+
111+
or
112+
113+
```bash
114+
just validate-rigs
115+
```
116+
To validate a specific RIG:
106117

107-
# Validate a specific RIG
118+
```bash
108119
uv run linkml-validate --schema src/resource_ingest_guide_schema/schema/resource_ingest_guide_schema.yaml src/docs/rigs/my_rig.yaml
109120
```
110121

@@ -139,10 +150,11 @@ make lint
139150

140151
Python utilities are in `src/scripts/`:
141152
- `create_rig.py`: Generate new RIG from template
142-
- `rig_to_markdown.py`: Convert RIG YAML to markdown
153+
- `rig_to_markdown.py`: Convert RIG YAML to Markdown
143154
- `generate_rig_index.py`: Create RIG index table
144155

145156
To test script changes:
157+
146158
```bash
147159
# Run scripts directly
148160
uv run python src/scripts/create_rig.py --help
@@ -163,6 +175,8 @@ make serve # or make testdoc
163175

164176
### Available Commands
165177

178+
Note: some **`make`** targets (like **`new-rig`** and **`validate-rigs`**) have **`just`** command equivalents (remember instead to put the just recipe target name _after_ any command line arguments)
179+
166180
| Command | Description |
167181
|---------|-------------|
168182
| `make help` | Show all available commands |

justfile

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ set dotenv-load := true
77
# set dotenv-filename := env_var_or_default("LINKML_ENVIRONMENT_FILENAME", "config.public.mk")
88
set dotenv-filename := x'${LINKML_ENVIRONMENT_FILENAME:-config.public.mk}'
99

10-
1110
# List all commands as default command. The prefix "_" hides the command.
1211
_default: _status
1312
@just --list
@@ -42,6 +41,9 @@ gen_owl_args := env_var_or_default("LINKML_GENERATORS_OWL_ARGS", "")
4241
gen_java_args := env_var_or_default("LINKML_GENERATORS_JAVA_ARGS", "")
4342
gen_ts_args := env_var_or_default("LINKML_GENERATORS_TYPESCRIPT_ARGS", "")
4443

44+
INFORES:= ""
45+
NAME := ""
46+
4547
# Directory variables
4648
src := "src"
4749
dest := "project"
@@ -123,7 +125,7 @@ _gen-project: _ensure_pymodel_dir _compile_sheets
123125
fi
124126

125127
# Run all tests
126-
test: _test-schema _test-python _test-examples
128+
test: _test-schema _test-python # _test-examples # the test examples are not properly set up yet
127129

128130
# Test schema generation
129131
_test-schema:
@@ -133,15 +135,18 @@ _test-schema:
133135
_test-python:
134136
{{run}} python -m pytest
135137

138+
#
139+
# the test examples are not yet properly set up
140+
#
136141
# Run example tests
137-
_test-examples: _ensure_examples_output
138-
{{run}} linkml-run-examples \
139-
--output-formats json \
140-
--output-formats yaml \
141-
--counter-example-input-directory src/data/examples/invalid \
142-
--input-directory src/data/examples/valid \
143-
--output-directory examples/output \
144-
--schema {{source_schema_path}} > examples/output/README.md
142+
#_test-examples: _ensure_examples_output
143+
# {{run}} linkml-run-examples \
144+
# --output-formats json \
145+
# --output-formats yaml \
146+
# --counter-example-input-directory src/data/examples/invalid \
147+
# --input-directory src/data/examples/valid \
148+
# --output-directory examples/output \
149+
# --schema {{source_schema_path}} > examples/output/README.md
145150

146151
# Run linting
147152
lint:
@@ -187,6 +192,17 @@ _git-commit:
187192
_git-status:
188193
git status
189194

195+
# Create a new RIG from template
196+
# Usage: just new-rig INFORES=infores:ctd NAME="CTD Chemical-Disease Associations"
197+
new-rig:
198+
@if [[ -z "{{INFORES}}" ]]; then \
199+
echo "INFORES is required. Usage: just new-rig INFORES=infores:example NAME='Example RIG'"; \
200+
elif [[ -z "{{NAME}}" ]]; then \
201+
echo "NAME is required. Usage: just new-rig INFORES=infores:example NAME='Example RIG'"; \
202+
else \
203+
{{run}} python {{src}}/scripts/create_rig.py --infores "{{INFORES}}" --name "{{NAME}}"; \
204+
fi
205+
190206
# Validate all RIG files against the schema
191207
validate-rigs:
192208
@echo "Validating RIG files against schema..."

0 commit comments

Comments
 (0)