Skip to content

Commit

Permalink
plugins: add annotations to _list_plugin_filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
SnoopJ committed Nov 4, 2023
1 parent ce68ea8 commit ef1358c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sopel/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import itertools
import logging
import os
from typing import TYPE_CHECKING

# TODO: use stdlib importlib.metadata when possible, after dropping py3.9.
# Stdlib does not support `entry_points(group='filter')` until py3.10, but
Expand All @@ -42,10 +43,13 @@

from . import exceptions, handlers, rules # noqa

if TYPE_CHECKING:
from collections.abc import Iterable


LOGGER = logging.getLogger(__name__)

def _list_plugin_filenames(directory):
def _list_plugin_filenames(directory: str | os.PathLike) -> Iterable[tuple[str, str]]:
# list plugin filenames from a directory
# yield 2-value tuples: (name, absolute path)
base = os.path.abspath(directory)
Expand Down

0 comments on commit ef1358c

Please sign in to comment.