bridge2ai / standards-schemas

Data schema for Bridge2AI Standards.
https://bridge2ai.github.io/standards-schemas/
MIT License
2 stars 2 forks source link

Tests and site building don't work for multiple schemas #2

Closed caufieldjh closed 1 year ago

caufieldjh commented 1 year ago

The test scripts run through the Makefile (make test) assume there will be a direct path to a specific schema YAML. This isn't the case here - the linter is happy to operate on a directory, but the tests aren't.

The makefile runs the following:

poetry run gen-project -d tmp src/standards_schemas/schema/

but we get:

ALL_SCHEMAS = ['src/standards_schemas/schema/']
INFO:root:Generating: graphql
INFO:root: SCHEMA: src/standards_schemas/schema/
INFO:root: PARENT=tmp/graphql
IsADirectoryError: [Errno 21] Is a directory: '/home/harry/standards-schemas/src/standards_schemas/schema'
make: *** [Makefile:97: test-schema] Error 1
caufieldjh commented 1 year ago

Note this is after modifying the schema path in about.yaml.

caufieldjh commented 1 year ago

Producing other products also doesn't work:

$ make all
./utils/get-value.sh: 4: Bad substitution
./utils/get-value.sh: 4: Bad substitution
./utils/get-value.sh: 4: Bad substitution
./utils/get-value.sh: 4: Bad substitution
poetry run gen-project -d project src/standards_schemas/schema/ && mv project/*.py src/standards_schemas/datamodel
ALL_SCHEMAS = ['src/standards_schemas/schema/']
INFO:root:Generating: graphql
INFO:root: SCHEMA: src/standards_schemas/schema/
INFO:root: PARENT=project/graphql
IsADirectoryError: [Errno 21] Is a directory: '/home/harry/standards-schemas/src/standards_schemas/schema'
make: *** [Makefile:92: gen-project] Error 1

The issue is that linkml's gen-project is expecting a path to a single schema config.

caufieldjh commented 1 year ago

See potential solution here: https://github.com/linkml/linkml/blob/4189d082371efe78af3c7b751dc4847ccae253a6/docs/howtos/linkml-ws.md

tl;dr: import everything into one yaml and then point the about.yaml config to that new schema (some generators may work differently, of course - this was for the workspace generator)