Skip to content

Commit b097ef5

Browse files
committed
chore: improve documentation for loading plugins from setuptools entry_points
1 parent 0c75633 commit b097ef5

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

simplug.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,14 @@ def load_entrypoints(
791791
group: str | None = None,
792792
only: str | Iterable[str] = (),
793793
) -> None:
794-
"""Load plugins from setuptools entry_points"""
794+
"""Load plugins from setuptools entry_points
795+
796+
Args:
797+
group: The group of the entry_points
798+
only: The names of the entry_points to load. If it's a str, it
799+
means only load this entry_point. If it's a list of str, it
800+
means load all the entry_points in the list.
801+
"""
795802
group = group or self.project
796803

797804
if isinstance(only, str):

tests/test_simplug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ def hook(arg):
11331133
f"{sys.executable} {plugin_dir}/setup.py "
11341134
f"install --install-lib {install_dir} 1>/dev/null 2>/dev/null"
11351135
)
1136-
simplug.load_entrypoints(only="None")
1136+
simplug.load_entrypoints(only="None") # Nothing loaded
11371137
assert simplug.hooks.hook(1) == [1]
11381138

11391139
simplug.load_entrypoints()

0 commit comments

Comments
 (0)