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

`make test` fails when executed with steps in the README #11

Closed sierra-moxon closed 1 year ago

sierra-moxon commented 2 years ago

Sorry for the long output here; I think the tests should run out of the box, or we should remove that as a step in the template README? I haven't had a chance to debug - will take a look.

SMoxon@SMoxon-M82 cookies % poetry shell
Spawning shell within /Users/SMoxon/Documents/src/cookies/.venv
SMoxon@SMoxon-M82 cookies % . /Users/SMoxon/Documents/src/cookies/.venv/bin/activate
(.venv) SMoxon@SMoxon-M82 cookies % cruft create https://github.com/linkml/linkml-project-cookiecutter 
project_name [my-awesome-schema]: linkml-tutorial-schema
github_org [my-org]: linkml
project_description [This is the project description.]: A repostitory that walks through schema generation.           
full_name [My Name]: LinkML Team
email [my-name@my-org.org]: admin@linkml.org
Select license:
1 - MIT
2 - BSD-3
3 - GNU GPL v3.0
4 - Apache Software License 2.0
Choose from 1, 2, 3, 4 [1]: 1
google_analytics_gtag [G-2SYBSJVZ23]: 
main_schema_class [Person]: 
Select create_python_classes:
1 - Yes
2 - No
Choose from 1, 2 [1]: 1
Select use_schemasheets:
1 - No
2 - Yes
Choose from 1, 2 [1]: 2
google_sheet_id [1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ]: 
google_sheet_tabs [personinfo enums]: 
github_token_for_pypi_deployment [PYPI_PASSWORD]: 
** PROJECT CREATION COMPLETE **

Next steps:
cd linkml-tutorial-schema
make setup
(.venv) SMoxon@SMoxon-M82 cookies % 
(.venv) SMoxon@SMoxon-M82 cookies % 
(.venv) SMoxon@SMoxon-M82 cookies % 
(.venv) SMoxon@SMoxon-M82 cookies % cd linkml-tutorial-schema 
(.venv) SMoxon@SMoxon-M82 linkml-tutorial-schema % make setup
poetry install
Installing dependencies from lock file
Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.

Package operations: 113 installs, 2 updates, 0 removals

  • Updating certifi (2022.9.14 -> 2022.6.15)
  • Installing hbreader (0.9.1)
  • Updating idna (3.4 -> 3.3)
  • Installing isodate (0.6.1)
  • Installing pyasn1 (0.4.8)
  • Installing pyparsing (3.0.9)
  • Installing antlr4-python3-runtime (4.9.3)
  • Installing cachetools (5.2.0)
  • Installing jsonasobj (2.0.1)
  • Installing oauthlib (3.2.1)
  • Installing pyasn1-modules (0.2.8)
  • Installing rdflib (6.2.0)
  • Installing rsa (4.9)
  • Installing attrs (22.1.0)
  • Installing google-auth (2.11.0)
  • Installing mdurl (0.1.2)
  • Installing protobuf (4.21.5)
  • Installing pyjsg (0.11.10)
  • Installing pyrsistent (0.18.1)
  • Installing pytz (2022.2.1)
  • Installing rdflib-jsonld (0.6.1)
  • Installing requests-oauthlib (1.3.1)
  • Installing wrapt (1.14.1)
  • Installing zipp (3.8.1)
  • Installing alabaster (0.7.12)
  • Installing babel (2.10.3)
  • Installing decorator (5.1.1)
  • Installing deprecated (1.2.13)
  • Installing distlib (0.3.6)
  • Installing docutils (0.18.1)
  • Installing filelock (3.8.0)
  • Installing google-auth-oauthlib (0.5.2)
  • Installing googleapis-common-protos (1.56.4)
  • Installing httplib2 (0.20.4)
  • Installing imagesize (1.4.1)
  • Installing importlib-metadata (4.12.0)
  • Installing json-flattener (0.1.9)
  • Installing jsonasobj2 (1.0.4)
  • Installing jsonpointer (2.3)
  • Installing jsonschema (4.15.0)
  • Installing markdown-it-py (2.1.0)
  • Installing packaging (21.3)
  • Installing platformdirs (2.5.2)
  • Installing ply (3.11)
  • Installing prefixcommons (0.1.11)
  • Installing pygments (2.13.0)
  • Installing rdflib-shim (1.0.3)
  • Installing ruamel.yaml.clib (0.2.6)
  • Installing shexjsg (0.8.2)
  • Installing snowballstemmer (2.2.0)
  • Installing soupsieve (2.3.2.post1)
  • Installing sparqlwrapper (2.0.0)
  • Installing sphinxcontrib-applehelp (1.0.2)
  • Installing sphinxcontrib-devhelp (1.0.2)
  • Installing sphinxcontrib-htmlhelp (2.0.0)
  • Installing sphinxcontrib-jsmath (1.0.1)
  • Installing sphinxcontrib-serializinghtml (1.1.5)
  • Installing sphinxcontrib-qthelp (1.0.3)
  • Installing beautifulsoup4 (4.11.1)
  • Installing cfgraph (0.2.1)
  • Installing et-xmlfile (1.1.0)
  • Installing ghp-import (2.1.0)
  • Installing google-api-core (2.10.0)
  • Installing google-auth-httplib2 (0.1.0)
  • Installing greenlet (1.1.3)
  • Installing gspread (5.5.0)
  • Installing jsonpatch (1.32)
  • Installing jsonpath-ng (1.5.3)
  • Installing linkml-runtime (1.3.2)
  • Installing markdown (3.3.7)
  • Installing mdit-py-plugins (0.3.0)
  • Installing mergedeep (1.3.4)
  • Installing pluggy (1.0.0)
  • Installing py (1.11.0)
  • Installing pyshexc (0.9.1)
  • Installing pyyaml-env-tag (0.1)
  • Installing ruamel.yaml (0.17.21)
  • Installing sparqlslurper (0.5.1)
  • Installing sphinx (5.1.1)
  • Installing tomli (2.0.1)
  • Installing tqdm (4.64.1)
  • Installing typing-extensions (4.3.0)
  • Installing uritemplate (4.1.1)
  • Installing virtualenv (20.16.5)
  • Installing watchdog (2.1.9)
  • Installing daff (1.3.46)
  • Installing editorconfig (0.12.3)
  • Installing google (3.0.0)
  • Installing google-api-python-client (2.60.0)
  • Installing graphviz (0.20.1)
  • Installing gspread-formatting (1.0.6)
  • Installing linkml-dataops (0.1.0)
  • Installing mkdocs (1.3.1)
  • Installing mkdocs-material-extensions (1.0.3)
  • Installing more-click (0.1.1)
  • Installing myst-parser (0.18.0)
  • Installing openpyxl (3.0.10)
  • Installing parse (1.19.0)
  • Installing prefixmaps (0.1.3)
  • Installing pydantic (1.10.2)
  • Installing pymdown-extensions (9.5)
  • Installing pyshex (0.8.1)
  • Installing pystow (0.4.6)
  • Installing sphinx-click (4.3.0)
  • Installing sqlalchemy (1.4.40)
  • Installing tabulate (0.8.10)
  • Installing termcolor (1.1.0)
  • Installing tox (3.26.0)
  • Installing bioregistry (0.4.120)
  • Installing jsbeautifier (1.14.6)
  • Installing linkml (1.3.3)
  • Installing mkdocs-material (8.4.2)
  • Installing ontodev-cogs (0.3.3)
  • Installing mkdocs-mermaid2-plugin (0.6.0)
  • Installing schemasheets (0.1.14)

Installing the current project: linkml_tutorial_schema (0.1.0)
poetry run sheets2linkml --gsheet-id 1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ personinfo enums > src/linkml_tutorial_schema/schema//personinfo_enums.yaml.tmp && mv src/linkml_tutorial_schema/schema//personinfo_enums.yaml.tmp src/linkml_tutorial_schema/schema//personinfo_enums.yaml
ERROR:root:Prefix TEMP not declared: using default
WARNING:root:Filling in missing prefix for: sdo => http://example.org/sdo/
WARNING:root:Filling in missing prefix for: wikidata => http://www.wikidata.org/entity/
poetry run gen-project -d project src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml && mv project/*.py src/linkml_tutorial_schema/datamodel
ALL_SCHEMAS = ['src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml']
INFO:root:Generating: graphql
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=project/graphql
# metamodel_version: 1.7.0
INFO:root: graphql ARGS: {'mergeimports': True}
INFO:root:  WRITING TO: project/graphql/linkml_tutorial_schema.graphql
INFO:root:Generating: jsonldcontext
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=project/jsonld
INFO:root: jsonldcontext ARGS: {'mergeimports': True}
INFO:root:  WRITING TO: project/jsonld/linkml_tutorial_schema.context.jsonld
INFO:root:Generating: jsonld
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=project/jsonld
INFO:root: jsonld ARGS: {'mergeimports': True, 'context': 'project/jsonld/linkml_tutorial_schema.context.jsonld'}
INFO:root:  WRITING TO: project/jsonld/linkml_tutorial_schema.jsonld
INFO:root:Generating: jsonschema
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=project/jsonschema
INFO:root: jsonschema ARGS: {'mergeimports': True}
INFO:root:Loading schema personinfo_enums from src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root:Loading schema https://w3id.org/linkml/types from src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root:  WRITING TO: project/jsonschema/linkml_tutorial_schema.schema.json
INFO:root:Generating: markdown
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=project/docs
INFO:root: markdown ARGS: {'mergeimports': True, 'directory': 'project/docs', 'index_file': 'linkml_tutorial_schema.md'}
WARNING:root:Instantiating generator with another generator is deprecated
WARNING:root:Instantiating generator with another generator is deprecated
WARNING:root:Instantiating generator with another generator is deprecated
WARNING:root:Instantiating generator with another generator is deprecated
WARNING:root:Instantiating generator with another generator is deprecated
WARNING:root:Instantiating generator with another generator is deprecated
INFO:root:Generating: owl
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=project/owl
INFO:root: owl ARGS: {'mergeimports': True}
INFO:root:  WRITING TO: project/owl/linkml_tutorial_schema.owl.ttl
INFO:root:Generating: prefixmap
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=project/prefixmap
INFO:root: prefixmap ARGS: {'mergeimports': True}
INFO:root:  WRITING TO: project/prefixmap/linkml_tutorial_schema.yaml
INFO:root:Generating: proto
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=project/protobuf
 syntax="proto3";
 package
// metamodel_version: 1.7.0
INFO:root: proto ARGS: {'mergeimports': True}
INFO:root:  WRITING TO: project/protobuf/linkml_tutorial_schema.proto
INFO:root:Generating: python
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=project
INFO:root: python ARGS: {'mergeimports': True}
INFO:root:  WRITING TO: project/linkml_tutorial_schema.py
INFO:root:Generating: shex
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=project/shex
# metamodel_version: 1.7.0
INFO:root: shex ARGS: {'mergeimports': True}
INFO:root:  WRITING TO: project/shex/linkml_tutorial_schema.shex
INFO:root:Generating: shacl
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=project/shacl
# metamodel_version: 1.7.0
INFO:root: shacl ARGS: {'mergeimports': True}
INFO:root:Loading schema personinfo_enums from src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root:Loading schema https://w3id.org/linkml/types from src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root:  WRITING TO: project/shacl/linkml_tutorial_schema.shacl.ttl
INFO:root:Generating: sqlddl
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=project/sqlschema
/* metamodel_version: 1.7.0 */
INFO:root: sqlddl ARGS: {'mergeimports': True}
WARNING:root:UNKNOWN: Decimal // <class 'linkml_runtime.utils.yamlutils.extended_str'>
WARNING:root:UNKNOWN: Decimal // <class 'linkml_runtime.utils.yamlutils.extended_str'>
INFO:root:  WRITING TO: project/sqlschema/linkml_tutorial_schema.sql
INFO:root:Generating: excel
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=project/excel
INFO:root: excel ARGS: {'mergeimports': True, 'output': 'project/excel/linkml_tutorial_schema.xlsx'}
cp src/data/examples/* examples
mkdir -p docs
cp src/docs/*md docs ; \
    poetry run gen-doc -d docs src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root:Loading schema personinfo_enums from src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root:Loading schema https://w3id.org/linkml/types from src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
None
git init
Initialized empty Git repository in /Users/SMoxon/Documents/src/cookies/linkml-tutorial-schema/.git/
git add .gitignore .github .cruft.json Makefile LICENSE *.md examples utils about.yaml mkdocs.yml poetry.lock project.Makefile pyproject.toml src/linkml_tutorial_schema/schema/*yaml src/*/datamodel/*py src/data src/docs tests
git add  project/sqlschema  project/shex  project/shacl  project/protobuf  project/prefixmap  project/owl  project/jsonschema  project/jsonld  project/graphql  project/excel
git commit -m 'Initial commit' -a
[main (root-commit) 4385c84] Initial commit
 37 files changed, 3943 insertions(+)
 create mode 100644 .cruft.json
 create mode 100644 .github/workflows/deploy-docs.yaml
 create mode 100644 .github/workflows/main.yaml
 create mode 100644 .github/workflows/pypi-publish.yaml
 create mode 100644 .gitignore
 create mode 100644 CODE_OF_CONDUCT.md
 create mode 100644 CONTRIBUTING.md
 create mode 100644 LICENSE
 create mode 100644 Makefile
 create mode 100644 README.md
 create mode 100644 about.yaml
 create mode 100644 examples/Person-001.yaml
 create mode 100644 examples/README.md
 create mode 100644 mkdocs.yml
 create mode 100644 poetry.lock
 create mode 100644 project.Makefile
 create mode 100644 project/excel/linkml_tutorial_schema.xlsx
 create mode 100644 project/graphql/linkml_tutorial_schema.graphql
 create mode 100644 project/jsonld/linkml_tutorial_schema.context.jsonld
 create mode 100644 project/jsonld/linkml_tutorial_schema.jsonld
 create mode 100644 project/jsonschema/linkml_tutorial_schema.schema.json
 create mode 100644 project/owl/linkml_tutorial_schema.owl.ttl
 create mode 100644 project/prefixmap/linkml_tutorial_schema.yaml
 create mode 100644 project/protobuf/linkml_tutorial_schema.proto
 create mode 100644 project/shacl/linkml_tutorial_schema.shacl.ttl
 create mode 100644 project/shex/linkml_tutorial_schema.shex
 create mode 100644 project/sqlschema/linkml_tutorial_schema.sql
 create mode 100644 pyproject.toml
 create mode 100644 src/data/examples/Person-001.yaml
 create mode 100644 src/docs/about.md
 create mode 100644 src/linkml_tutorial_schema/datamodel/__init__.py
 create mode 100644 src/linkml_tutorial_schema/datamodel/linkml_tutorial_schema.py
 create mode 100644 src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
 create mode 100644 src/linkml_tutorial_schema/schema/personinfo_enums.yaml
 create mode 100644 tests/__init__.py
 create mode 100644 tests/test_data.py
 create mode 100644 utils/get-value.sh
git status
On branch main
nothing to commit, working tree clean
(.venv) SMoxon@SMoxon-M82 linkml-tutorial-schema % 
(.venv) SMoxon@SMoxon-M82 linkml-tutorial-schema % 
**(.venv) SMoxon@SMoxon-M82 linkml-tutorial-schema % make test**
poetry run gen-project -d tmp src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml 
ALL_SCHEMAS = ['src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml']
INFO:root:Generating: graphql
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=tmp/graphql
# metamodel_version: 1.7.0
INFO:root: graphql ARGS: {'mergeimports': True}
INFO:root:  WRITING TO: tmp/graphql/linkml_tutorial_schema.graphql
INFO:root:Generating: jsonldcontext
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=tmp/jsonld
INFO:root: jsonldcontext ARGS: {'mergeimports': True}
INFO:root:  WRITING TO: tmp/jsonld/linkml_tutorial_schema.context.jsonld
INFO:root:Generating: jsonld
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=tmp/jsonld
INFO:root: jsonld ARGS: {'mergeimports': True, 'context': 'tmp/jsonld/linkml_tutorial_schema.context.jsonld'}
INFO:root:  WRITING TO: tmp/jsonld/linkml_tutorial_schema.jsonld
INFO:root:Generating: jsonschema
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=tmp/jsonschema
INFO:root: jsonschema ARGS: {'mergeimports': True}
INFO:root:Loading schema personinfo_enums from src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root:Loading schema https://w3id.org/linkml/types from src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root:  WRITING TO: tmp/jsonschema/linkml_tutorial_schema.schema.json
INFO:root:Generating: markdown
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=tmp/docs
INFO:root: markdown ARGS: {'mergeimports': True, 'directory': 'tmp/docs', 'index_file': 'linkml_tutorial_schema.md'}
WARNING:root:Instantiating generator with another generator is deprecated
WARNING:root:Instantiating generator with another generator is deprecated
WARNING:root:Instantiating generator with another generator is deprecated
WARNING:root:Instantiating generator with another generator is deprecated
WARNING:root:Instantiating generator with another generator is deprecated
WARNING:root:Instantiating generator with another generator is deprecated
INFO:root:Generating: owl
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=tmp/owl
INFO:root: owl ARGS: {'mergeimports': True}
INFO:root:  WRITING TO: tmp/owl/linkml_tutorial_schema.owl.ttl
INFO:root:Generating: prefixmap
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=tmp/prefixmap
INFO:root: prefixmap ARGS: {'mergeimports': True}
INFO:root:  WRITING TO: tmp/prefixmap/linkml_tutorial_schema.yaml
INFO:root:Generating: proto
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=tmp/protobuf
 syntax="proto3";
 package
// metamodel_version: 1.7.0
INFO:root: proto ARGS: {'mergeimports': True}
INFO:root:  WRITING TO: tmp/protobuf/linkml_tutorial_schema.proto
INFO:root:Generating: python
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=tmp
INFO:root: python ARGS: {'mergeimports': True}
INFO:root:  WRITING TO: tmp/linkml_tutorial_schema.py
INFO:root:Generating: shex
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=tmp/shex
# metamodel_version: 1.7.0
INFO:root: shex ARGS: {'mergeimports': True}
INFO:root:  WRITING TO: tmp/shex/linkml_tutorial_schema.shex
INFO:root:Generating: shacl
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=tmp/shacl
# metamodel_version: 1.7.0
INFO:root: shacl ARGS: {'mergeimports': True}
INFO:root:Loading schema personinfo_enums from src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root:Loading schema https://w3id.org/linkml/types from src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root:  WRITING TO: tmp/shacl/linkml_tutorial_schema.shacl.ttl
INFO:root:Generating: sqlddl
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=tmp/sqlschema
/* metamodel_version: 1.7.0 */
INFO:root: sqlddl ARGS: {'mergeimports': True}
WARNING:root:UNKNOWN: Decimal // <class 'linkml_runtime.utils.yamlutils.extended_str'>
WARNING:root:UNKNOWN: Decimal // <class 'linkml_runtime.utils.yamlutils.extended_str'>
INFO:root:  WRITING TO: tmp/sqlschema/linkml_tutorial_schema.sql
INFO:root:Generating: excel
INFO:root: SCHEMA: src/linkml_tutorial_schema/schema/linkml_tutorial_schema.yaml
INFO:root: PARENT=tmp/excel
INFO:root: excel ARGS: {'mergeimports': True, 'output': 'tmp/excel/linkml_tutorial_schema.xlsx'}
poetry run python -m unittest discover
E
======================================================================
ERROR: test_data (tests.test_data.TestData)
Date test.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/SMoxon/Documents/src/cookies/linkml-tutorial-schema/tests/test_data.py", line 20, in test_data
    obj = yaml_loader.load(path, target_class=Person)
  File "/Users/SMoxon/Documents/src/cookies/.venv/lib/python3.9/site-packages/linkml_runtime/loaders/loader_root.py", line 85, in load
    results = self.load_any(*args, **kwargs)
  File "/Users/SMoxon/Documents/src/cookies/.venv/lib/python3.9/site-packages/linkml_runtime/loaders/yaml_loader.py", line 25, in load_any
    return self.load_source(source, loader, target_class, accept_header="text/yaml, application/yaml;q=0.9",
  File "/Users/SMoxon/Documents/src/cookies/.venv/lib/python3.9/site-packages/linkml_runtime/loaders/loader_root.py", line 66, in load_source
    return target_class(**data_as_dict)
  File "<string>", line 8, in __init__
  File "/Users/SMoxon/Documents/src/cookies/linkml-tutorial-schema/src/linkml_tutorial_schema/datamodel/linkml_tutorial_schema.py", line 93, in __post_init__
    super().__post_init__(**kwargs)
  File "/Users/SMoxon/Documents/src/cookies/.venv/lib/python3.9/site-packages/linkml_runtime/utils/yamlutils.py", line 48, in __post_init__
    raise ValueError('\n'.join(messages))
ValueError: File "<file>", line 4, col 1:  Unknown argument: primary_email = 'foo.bar@example.com'
File "<file>", line 5, col 1:  Unknown argument: age_in_years = 33

----------------------------------------------------------------------
Ran 1 test in 0.001s
sierra-moxon commented 2 years ago

looks like the YAML generated as test data is malformated.

sierra-moxon commented 2 years ago

test data should look more like this:

entries:
  - id: P:001
    name: fred bloggs
    primary_email: fred.bloggs@example.com
    age_in_years: 33

and test_data.py should look more like this:

    def test_data(self):
        """Date test."""
        for path in EXAMPLE_FILES:
            obj = yaml_loader.load(path, target_class=PersonCollection)
            assert obj

Note: target_class=PersonCollection

turbomam commented 2 years ago

make test works for me now in a fresh cookiecutter repo now, but it doesn't in my new semantic-synbio/synbio-schema repo: https://github.com/semantic-synbio/synbio-schema/issues/2

I could use some help debugging that. I probably modified or deleted something that I shouldn't have.

sierra-moxon commented 1 year ago

Works for me; closing.