Skip to content

Commit

Permalink
minor fix in find_plugins to guard against None results
Browse files Browse the repository at this point in the history
  • Loading branch information
thrau committed May 14, 2024
1 parent 8804100 commit 2a7c1a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plux/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

name = "plux"

__version__ = "1.9.0"
__version__ = "1.10.0.dev2"

__all__ = [
"FunctionPlugin",
Expand Down
8 changes: 4 additions & 4 deletions plux/runtime/resolve.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Tools to resolve PluginSpec instances from entry points at runtime. Currently, stevedore does most of the heavy
lifting for us here (it caches entrypoints and can load them quickly)."""
"""Tools to resolve PluginSpec instances from entry points at runtime. The primary mechanism we use to do
that is ``importlib.metadata`` and a bit of caching."""

import logging
import typing as t
Expand All @@ -15,7 +15,7 @@

class MetadataPluginFinder(PluginFinder):
"""
This is a simple implementation of a PluginFinder that uses ``importlib.metadata`` directly, without caching, to resolve plugins. It also automatically follows `entry_point
This is a simple implementation of a PluginFinder that uses by default the ``EntryPointsCache`` singleton.
"""

def __init__(
Expand All @@ -33,7 +33,7 @@ def __init__(

def find_plugins(self) -> t.List[PluginSpec]:
specs = []
finds = self.entry_points_resolver.get_entry_points().get(self.namespace)
finds = self.entry_points_resolver.get_entry_points().get(self.namespace, [])
for ep in finds:
specs.append(self.to_plugin_spec(ep))
return specs
Expand Down

0 comments on commit 2a7c1a4

Please sign in to comment.