Skip to content
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

fix(setup): fixes for make setup #34

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,17 @@ See [linkml/linkml-project-cookiecutter](https://github.com/linkml/linkml-projec
Change to the folder your generated project is in

```bash
cd linkml-projects/my-awesome-schema # using the folder example above
cd my-awesome-schema # using the folder example above
```

Connect project to Git
```bash
git init
git remote add origin https://github.com/my-org/my-awesome-schema.git
```

Setup the LinkML project
```bash
make setup
```

Expand Down
14 changes: 7 additions & 7 deletions {{cookiecutter.project_name}}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ SHELL := bash

RUN = poetry run
# get values from about.yaml file
SCHEMA_NAME = $(shell sh ./utils/get-value.sh name)
SOURCE_SCHEMA_PATH = $(shell sh ./utils/get-value.sh source_schema_path)
SCHEMA_NAME = $(shell ${SHELL} ./utils/get-value.sh name)
SOURCE_SCHEMA_PATH = $(shell ${SHELL} ./utils/get-value.sh source_schema_path)
SOURCE_SCHEMA_DIR = $(dir $(SOURCE_SCHEMA_PATH))
SRC = src
DEST = project
PYMODEL = $(SRC)/$(SCHEMA_NAME)/datamodel
DOCDIR = docs
EXAMPLEDIR = examples
SHEET_MODULE = {{cookiecutter.__google_sheet_module}}
SHEET_ID = $(shell sh ./utils/get-value.sh google_sheet_id)
SHEET_TABS = $(shell sh ./utils/get-value.sh google_sheet_tabs)
SHEET_ID = $(shell ${SHELL} ./utils/get-value.sh google_sheet_id)
SHEET_TABS = $(shell ${SHELL} ./utils/get-value.sh google_sheet_tabs)
SHEET_MODULE_PATH = $(SOURCE_SCHEMA_DIR)/$(SHEET_MODULE).yaml

# basename of a YAML file in model/
Expand Down Expand Up @@ -97,19 +97,19 @@ gen-project: $(PYMODEL)

test: test-schema test-python
test-schema:
$(RUN) gen-project -d tmp $(SOURCE_SCHEMA_PATH)
$(RUN) gen-project -d tmp $(SOURCE_SCHEMA_PATH)

test-python:
$(RUN) python -m unittest discover

lint:
$(RUN) linkml-lint $(SOURCE_SCHEMA_PATH)
$(RUN) linkml-lint $(SOURCE_SCHEMA_PATH)

check-config:
@(grep my-datamodel about.yaml > /dev/null && printf "\n**Project not configured**:\n\n - Remember to edit 'about.yaml'\n\n" || exit 0)

convert-examples-to-%:
$(patsubst %, $(RUN) linkml-convert % -s $(SOURCE_SCHEMA_PATH) -C Person, $(shell find src/data/examples -name "*.yaml"))
$(patsubst %, $(RUN) linkml-convert % -s $(SOURCE_SCHEMA_PATH) -C Person, $(shell find src/data/examples -name "*.yaml"))

examples/%.yaml: src/data/examples/%.yaml
$(RUN) linkml-convert -s $(SOURCE_SCHEMA_PATH) -C Person $< -o $@
Expand Down