Skip to content

Commit

Permalink
Add schema submodule to handle OPTIMADE schema dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
rartino committed Jan 16, 2024
1 parent fc55ee0 commit 9ce80ba
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "tools/optimade-property-tools"]
path = tools/optimade-property-tools
path = dependencies/submodules/optimade-property-tools
url = https://github.com/Materials-Consortia/optimade-property-tools.git
[submodule "dependencies/submodules/schemas"]
path = dependencies/submodules/schemas
url = https://github.com/Materials-Consortia/schemas
27 changes: 19 additions & 8 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,31 @@
.PHONY: all
all: schemas

# You may need to edit these configuration options
###############################
# Basic configuration options #
###############################

# Path to the process_schemas program
PROCESS_SCHEMAS=tools/optimade-property-tools/bin/process_schemas
# Path to the OPTIMADE specification schemas folder
OPTIMADE_SCHEMAS_DIR=../OPTIMADE/schemas/output
PROCESS_SCHEMAS=dependencies/submodules/optimade-property-tools/bin/process_schemas
# The base of the URI for the generated property definitions
BASEID=https://schemas.optimade.org/namespaces/cheminformatics/v0.1/
# The versioned directory being processed
BASEDIR=src/v0.1.0

# You probably do not need to edit these
META_SCHEMA_PATH=$(OPTIMADE_SCHEMAS_DIR)/meta/v1.2
# The versions of the meta-schemas to use
META_SCHEMA_VER=v1.2

#################################
# Advanced configuation options #
#################################

# Path to the OPTIMADE schemas repo
OPTIMADE_SCHEMAS_DIR=dependencies/submodules/schemas
# Path to the meta-schemas to use
META_SCHEMA_PATH=$(OPTIMADE_SCHEMAS_DIR)/meta/$(META_SCHEMA_VER)
# Add the OPTIMADE schemas repo as a path relative to which resolve $$inherit
RESOLVE_PATHS_ARGS=--resolve-path $(OPTIMADE_SCHEMAS_DIR)


ifeq ($(origin schemas_html_pretty), undefined)
OPTIMADE_HTML_HEADER ?=
OPTIMADE_HTML_TOP ?=
Expand All @@ -42,7 +53,7 @@ else
SCHEMAS_HTML_EXT = .html
endif

EXT_SCHEMAS := $(filter-out tools/optimade-property-tools/external/json-schema/LICENSE, $(wildcard tools/optimade-property-tools/external/json-schema/*))
EXT_SCHEMAS := $(filter-out dependencies/submodules/optimade-property-tools/external/json-schema/LICENSE, $(wildcard dependencies/submodules/optimade-property-tools/external/json-schema/*))
EXT_SCHEMAS_ARGS := $(foreach schema,$(EXT_SCHEMAS),--schema $(schema))

META_SCHEMAS_JSON := $(wildcard $(META_SCHEMA_PATH)/optimade/*.json)
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Repository for the cheminformatics namespace.
```
git clone --recurse-submodules https://github.com/Materials-Consortia/namespace-cheminformatics.git
```
Or, if you have already cloned this repo without the submodules, init them with:
```
git submodule update --init --recursive
```

2. Run make.

Expand Down
1 change: 1 addition & 0 deletions dependencies/submodules/optimade-property-tools
1 change: 1 addition & 0 deletions dependencies/submodules/schemas
Submodule schemas added at 99fe1c
1 change: 0 additions & 1 deletion tools/optimade-property-tools
Submodule optimade-property-tools deleted from 11c5a0

0 comments on commit 9ce80ba

Please sign in to comment.