Skip to content

fix: Ensure that repository access is resilient against namespace packages #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/firewheel/control/repository_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ def list_repositories(self):

# Add all model components that have been added via entry points
for entry in entry_points(group="firewheel.mc_repo"):
entries.append({"path": entry.load()[0]})
# Typically `entry` is a `__path__` attribute of a module; this attribute
# is defined as a sequence of strings enumerating the locations where the
# package's submodules will be found
# https://docs.python.org/3/reference/import.html#path-attributes-on-modules
for path in entry.load():
entries.append({"path": path})

return iter(entries)

Expand Down
Loading