linkml / linkml-project-cookiecutter

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

python classes are not generated #17

Closed turbomam closed 2 years ago

turbomam commented 2 years ago

It looks like the Makefile is supposed to generate some *.py files in project/ when running the gen-project CLI tool as part of the gen-project rule. No gen-project --include or --exclude options are provided.

Then those Python files are supposed to be copied to the schema's datamodel directory.

Presumably, the Python files in the datamodel directory would then get published to PyPI as part of a GH release. But these Python files are never generated, moved or published.

DEST = project

PYMODEL = $(SRC)/$(SCHEMA_NAME)/datamodel

all: site
site: gen-project gendoc

gen-project: $(PYMODEL) compile-sheets
    $(RUN) gen-project -d $(DEST) $(SOURCE_SCHEMA_PATH) && mv $(DEST)/*.py $(PYMODEL)
turbomam commented 2 years ago

Although the logs make it seem like the python generation does happen:

INFO:root:Generating: python INFO:root: SCHEMA: src/synbio_schema/schema/synbio_schema.yaml INFO:root: PARENT=project INFO:root: python ARGS: {'mergeimports': True} INFO:root: WRITING TO: project/synbio_schema.py

Maybe something unexpected is happening during the mv step ?

turbomam commented 2 years ago

The Makefile rule expands to

poetry run gen-project -d project src/synbio_schema/schema/synbio_schema.yaml && mv project/*.py src/synbio_schema/datamodel
turbomam commented 2 years ago

And that does generate something along the lines of project/synbio_schema.py (depending on the repo of course)

turbomam commented 2 years ago

I can't recreate my own issue!

cmungall commented 2 years ago

To confirm your hypothesis that something is happening in the mv step can you should the full logging or at least the part with the mv step?

Note the cleanest thing to do here is for genp to just put things in the right place to start with

On Wed, Sep 21, 2022 at 6:31 AM Mark A. Miller @.***> wrote:

And that does generate something along the lines of project/synbio_schema.py (depending on the repo of course)

— Reply to this email directly, view it on GitHub https://github.com/linkml/linkml-project-cookiecutter/issues/17#issuecomment-1253716632, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAMMONMDN2MTSTXVT6PUADV7ME3XANCNFSM6AAAAAAQSCHHQA . You are receiving this because you were assigned.Message ID: @.***>

turbomam commented 2 years ago

Thanks, I will share logging later. I can recreate the issue in https://github.com/semantic-synbio/synbio-schema after all, just not in a totally fresh LinkML cookiecutter repo

I'm going to revisit the schemsheets slides now