Skip to content

Commit

Permalink
fix(FolderInfo): correct fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Nov 16, 2024
1 parent 12ec100 commit 2f37921
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions mknodes/info/folderinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

0 comments on commit 2f37921

Please sign in to comment.