This commit is contained in:
sneakers-the-rat 2024-07-09 23:54:28 -07:00
parent 2f59f0a69b
commit bf7f62fd8f
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D
4 changed files with 14 additions and 5 deletions

View file

@ -18,6 +18,7 @@ for its domain.
- so **providers** are the things that manage the multistage build process given some cache of - so **providers** are the things that manage the multistage build process given some cache of
the stages so that you can go like "gimme model i want my model" and you will probably get it. the stages so that you can go like "gimme model i want my model" and you will probably get it.
""" """
# ruff: noqa: I001 - import order necessary to avoid circular imports :) # ruff: noqa: I001 - import order necessary to avoid circular imports :)
from nwb_linkml.providers.provider import Provider from nwb_linkml.providers.provider import Provider
from nwb_linkml.providers.linkml import LinkMLProvider from nwb_linkml.providers.linkml import LinkMLProvider

View file

@ -1,3 +1,7 @@
"""
Provider for LinkML schema built from NWB schema
"""
import shutil import shutil
from pathlib import Path from pathlib import Path
from typing import Dict, Optional, TypedDict from typing import Dict, Optional, TypedDict

View file

@ -1,3 +1,7 @@
"""
Base provider class
"""
import importlib import importlib
import os import os
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
@ -116,6 +120,7 @@ class Provider(ABC):
Dictionary mapping a namespace to a list of built versions Dictionary mapping a namespace to a list of built versions
""" """
from nwb_linkml.providers import LinkMLProvider from nwb_linkml.providers import LinkMLProvider
versions = {} # type: Dict[str, List[Path]] versions = {} # type: Dict[str, List[Path]]
# first get any builtins provided by the package itself # first get any builtins provided by the package itself
@ -159,5 +164,3 @@ class Provider(ABC):
for k, v_paths in versions.items() for k, v_paths in versions.items()
} }
return res return res

View file

@ -1,6 +1,7 @@
""" """
Provider for pydantic models. Provider for pydantic models.
""" """
import importlib import importlib
import sys import sys
from importlib.abc import MetaPathFinder from importlib.abc import MetaPathFinder
@ -201,7 +202,7 @@ class PydanticProvider(Provider):
return serialized return serialized
def _make_inits(self, out_file: Path): def _make_inits(self, out_file: Path) -> None:
""" """
Make __init__.py files for the directory a model is output to and its immediate parent. Make __init__.py files for the directory a model is output to and its immediate parent.
(ig this could be generalized in depth but lets not go nuts in here with the nesting) (ig this could be generalized in depth but lets not go nuts in here with the nesting)