diff --git a/mknodes/info/folderinfo.py b/mknodes/info/folderinfo.py index c50befaa..442a74da 100644 --- a/mknodes/info/folderinfo.py +++ b/mknodes/info/folderinfo.py @@ -87,15 +87,15 @@ def __fspath__(self): @functools.cached_property def module(self) -> types.ModuleType: """Return the module itself.""" - mod_name = epregistry.distribution_to_package(self.git.repo_name) - return importlib.import_module(mod_name or self.git.repo_name) + mod_name = epregistry.distribution_to_package(self.git.repo_name, fallback=True) + return importlib.import_module(mod_name) @functools.cached_property def griffe_module(self) -> griffe.Module | Alias: """Return a griffe Module containing information about the module.""" # Long-term ideally we would pull all information from here. - mod_name = epregistry.distribution_to_package(self.git.repo_name) - return grifferegistry.get_module(mod_name or self.git.repo_name) + mod_name = epregistry.distribution_to_package(self.git.repo_name, fallback=True) + return grifferegistry.get_module(mod_name) def __repr__(self): return reprhelpers.get_repr(self, path=self.path) @@ -289,6 +289,6 @@ def context(self) -> contexts.PackageContext: if __name__ == "__main__": - info = FolderInfo("https://github.com/mkdocs/mkdocs.git") - print(info.context) - log.basic() + info = FolderInfo("https://github.com/phil65/mkdocs-mknodes") + # info = FolderInfo() + print(info.module)