also list linkml versions in the available versions for a pydantic provider

This commit is contained in:
sneakers-the-rat 2023-10-04 22:27:36 -07:00
parent d46e86c676
commit 0f4f2dd683

View file

@ -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():