From 0f4f2dd6832a3d4b028fdfecc2ec09cf8545861a Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Wed, 4 Oct 2023 22:27:36 -0700 Subject: [PATCH] also list linkml versions in the available versions for a pydantic provider --- nwb_linkml/src/nwb_linkml/providers/schema.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/nwb_linkml/src/nwb_linkml/providers/schema.py b/nwb_linkml/src/nwb_linkml/providers/schema.py index a08ee35..3daf228 100644 --- a/nwb_linkml/src/nwb_linkml/providers/schema.py +++ b/nwb_linkml/src/nwb_linkml/providers/schema.py @@ -190,11 +190,20 @@ class Provider(ABC): namespace_path = module_path / 'models' / 'pydantic' builtin_namespaces = list(namespace_path.iterdir()) + + tmp_paths = [] try: - tmp_paths = list(self.path.iterdir()) + tmp_paths.extend(list(self.path.iterdir())) + if self.PROVIDES == 'pydantic': + # we also include versions that we just have the linkml version of + # because they are also available, we just have to build them. + # maybe the semantics of this property are getting overloaded tho + # and we need to separate the maintenance of the temporary directory + # from providing from it + tmp_paths.extend(list(LinkMLProvider(path=self.config.cache_dir).path.iterdir())) except FileNotFoundError: # fine, just return the builtins - tmp_paths = [] + pass for ns_dir in builtin_namespaces + tmp_paths: if not ns_dir.is_dir():