linkml / linkml-project-cookiecutter

A cookiecutter for linkml projects. An equivalent of `linkml-ws new project-name`.
Creative Commons Zero v1.0 Universal
14 stars 16 forks source link

passing custom args to gen-xxx tools #51

Open noelmcloughlin opened 1 year ago

noelmcloughlin commented 1 year ago

There is no method to customize gen-xxx commands invoked by gen-project. For example, we cannot pass --no-metaclasses to gen-owl via the Makefile. Here in this project, I suggest solving the problem using environment variables like #43 as this scales well.

noelmcloughlin commented 1 year ago

See #52 for proposed solution (for gen-owl)

cmungall commented 1 year ago

Actually, there is a way to pass these in

Unfortunately it's not obvious as if you do gen-metadata from the command line the formatting is messed up; see:

So what you want is:

config.yaml:

generator_args: 
  owl: 
     metaclasses: false

the whole system is a little unsatisfying - in general in linkml we eat our own dogfood, and we would have a complete schema for all configuration. However, the click annotations are the source-of-truth for anything CLI, so the yaml here is a kind of jury rigged layer on top of multiple separate click files. I'm not sure there is a much better way to do it without a big revamp. But it could certainly be better documented!

noelmcloughlin commented 1 year ago

Thanks. Do you mean we can drop config.yaml into linkml-project-cookiecutter home directory (and github-actions workflow directory) and gen-xxx will read that file?