Skip to content

Commit

Permalink
Update template & use hash-spec in actions
Browse files Browse the repository at this point in the history
  • Loading branch information
dalito committed Dec 19, 2024
1 parent aa0ba24 commit a61d130
Show file tree
Hide file tree
Showing 22 changed files with 693 additions and 367 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/dalito/linkml-project-cookiecutter",
"commit": "d9b85bbbdcc49163416a3e3e18e23fe2ecce501b",
"commit": "21dc84dd378e7aade7affaa329956ce93d38202d",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
27 changes: 0 additions & 27 deletions .env.public

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:

- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: ${{ matrix.python-version }}

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: 3.9
python-version: 3.12

- name: Install Poetry
run: |
Expand All @@ -30,7 +30,7 @@ jobs:
run: poetry build

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@v1.12.2
uses: pypa/gh-action-pypi-publish@fb13cb306901256ace3dab689990e13a5550ffaa
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/docs/
/project/docs/
/tmp/
/local-js-pkgs

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SHELL := bash
ifdef LINKML_ENVIRONMENT_FILENAME
include ${LINKML_ENVIRONMENT_FILENAME}
else
include .env.public
include config.public.mk
endif

RUN = poetry run
Expand All @@ -22,35 +22,37 @@ SRC = src
DEST = project
PYMODEL = $(SRC)/$(SCHEMA_NAME)/datamodel
DOCDIR = docs
DOCTEMPLATES = $(SRC)/docs/templates
EXAMPLEDIR = examples
SHEET_MODULE = personinfo_enums
SHEET_ID = $(LINKML_SCHEMA_GOOGLE_SHEET_ID)
SHEET_TABS = $(LINKML_SCHEMA_GOOGLE_SHEET_TABS)
SHEET_MODULE_PATH = $(SOURCE_SCHEMA_DIR)/$(SHEET_MODULE).yaml

# Use += to append variables from the variables file
CONFIG_YAML =
ifdef LINKML_GENERATORS_CONFIG_YAML
CONFIG_YAML = ${LINKML_GENERATORS_CONFIG_YAML}
CONFIG_YAML += ${LINKML_GENERATORS_CONFIG_YAML}
endif

GEN_DOC_ARGS =
ifdef LINKML_GENERATORS_DOC_ARGS
GEN_DOC_ARGS = ${LINKML_GENERATORS_DOC_ARGS}
GEN_DOC_ARGS += ${LINKML_GENERATORS_DOC_ARGS}
endif

GEN_OWL_ARGS =
ifdef LINKML_GENERATORS_OWL_ARGS
GEN_OWL_ARGS = ${LINKML_GENERATORS_OWL_ARGS}
GEN_OWL_ARGS += ${LINKML_GENERATORS_OWL_ARGS}
endif

GEN_JAVA_ARGS =
ifdef LINKML_GENERATORS_JAVA_ARGS
GEN_JAVA_ARGS = ${LINKML_GENERATORS_JAVA_ARGS}
GEN_JAVA_ARGS += ${LINKML_GENERATORS_JAVA_ARGS}
endif

GEN_TS_ARGS =
ifdef LINKML_GENERATORS_TYPESCRIPT_ARGS
GEN_TS_ARGS = ${LINKML_GENERATORS_TYPESCRIPT_ARGS}
GEN_TS_ARGS += ${LINKML_GENERATORS_TYPESCRIPT_ARGS}
endif


Expand Down Expand Up @@ -124,7 +126,7 @@ gen-examples:
gen-project: $(PYMODEL)
$(RUN) gen-project ${CONFIG_YAML} -d $(DEST) $(SOURCE_SCHEMA_PATH) && mv $(DEST)/*.py $(PYMODEL)
# addition vs. template
$(RUN) gen-pydantic --pydantic-version 2 $(SOURCE_SCHEMA_PATH) > $(PYMODEL)/pid4cat_model_pydantic.py
$(RUN) gen-pydantic $(SOURCE_SCHEMA_PATH) > $(PYMODEL)/pid4cat_model_pydantic.py

# non-empty arg triggers owl (workaround https://github.com/linkml/linkml/issues/1453)
ifneq ($(strip ${GEN_OWL_ARGS}),)
Expand Down Expand Up @@ -193,7 +195,7 @@ $(DOCDIR):
mkdir -p $@

gendoc: $(DOCDIR)
cp -rf $(SRC)/docs/* $(DOCDIR) ; \
cp -rf $(SRC)/docs/files/* $(DOCDIR) ; \
$(RUN) gen-doc ${GEN_DOC_ARGS} -d $(DOCDIR) $(SOURCE_SCHEMA_PATH)

testdoc: gendoc serve
Expand Down
32 changes: 32 additions & 0 deletions config.public.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# config.public.mk

# This file is public in git. No sensitive info allowed.
# These variables are sourced in Makefile, following make-file conventions.
# Be aware that this file does not follow python or bash conventions, so may appear a little unfamiliar.

###### schema definition variables, used by makefile

# Note: makefile variables should not be quoted, as makefile handles quoting differently than bash
LINKML_SCHEMA_NAME=pid4cat_model
LINKML_SCHEMA_AUTHOR=David Linke <[email protected]>
LINKML_SCHEMA_DESCRIPTION=LinkML model for handle-based PIDs for resources in catalysis (PID4Cat)
LINKML_SCHEMA_SOURCE_PATH=src/pid4cat_model/schema/pid4cat_model.yaml
LINKML_SCHEMA_GOOGLE_SHEET_ID=1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ
LINKML_SCHEMA_GOOGLE_SHEET_TABS=personinfo enums

###### linkml generator variables, used by makefile

## gen-project configuration file
LINKML_GENERATORS_CONFIG_YAML= --config-file config.yaml

## pass args if gendoc ignores config.yaml (i.e. --no-mergeimports)
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=

## pass args to trigger experimental java/typescript generation
LINKML_GENERATORS_JAVA_ARGS=
LINKML_GENERATORS_TYPESCRIPT_ARGS=

4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ theme:
plugins:
- search
- mermaid2:
version: 10.9.0
version: 11.4.1
# if you want/have to use a local copy of the mermaid.js library, uncomment the next line
#javascript: local-js-pkgs/mermaid.min.js
nav:
# - Home: home.md
- Index: index.md
Expand Down
25 changes: 11 additions & 14 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified project/excel/pid4cat_model.xlsx
Binary file not shown.
72 changes: 72 additions & 0 deletions project/graphql/pid4cat_model.graphql
Original file line number Diff line number Diff line change
@@ -1,4 +1,76 @@
# metamodel_version: 1.7.0
enum ChangeLogField
{
STATUS
LANDING_PAGE
RESOURCE_INFO
RELATED_IDS
CONTACT
LICENSE
}

enum PID4CatAgentRole
{
TRUSTEE
OWNER
}

enum PID4CatStatus
{
SUBMITTED
REGISTERED
OBSOLETED
DEPRECATED
}

enum RelationType
{
IS_CITED_BY
CITES
IS_SUPPLEMENT_TO
IS_SUPPLEMENTED_BY
IS_CONTINUED_BY
CONTINUES
HAS_METADATA
IS_METADATA_FOR
HAS_VERSION
IS_VERSION_OF
IS_NEW_VERSION_OF
IS_PREVIOUS_VERSION_OF
IS_PART_OF
HAS_PART
IS_DESCRIBED_BY
DESCRIBES
IS_PUBLISHED_IN
IS_REFERENCED_BY
REFERENCES
IS_DOCUMENTED_BY
DOCUMENTS
IS_COMPILED_BY
COMPILES
IS_VARIANT_FORM_OF
IS_ORIGINAL_FORM_OF
IS_IDENTICAL_TO
IS_DERIVED_FROM
IS_SOURCE_OF
IS_COLLECTED_BY
COLLECTS
IS_REQUIRED_BY
REQUIRES
IS_OBSOLETED_BY
OBSOLETES
}

enum ResourceCategory
{
COLLECTION
SAMPLE
MATERIAL
DEVICE
DATA_OBJECT
DATA_SERVICE
}

type Agent
{
name: String
Expand Down
Loading

0 comments on commit a61d130

Please sign in to comment.