Skip to content

Commit

Permalink
Adds missing type hint for module functions on Api
Browse files Browse the repository at this point in the history
  • Loading branch information
Daverball committed Aug 22, 2024
1 parent 38cfcb7 commit 6fdb68c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/suitable/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

if TYPE_CHECKING:
from _typeshed import StrPath
from collections.abc import Generator, Iterable
from collections.abc import Callable, Generator, Iterable
from suitable.runner_results import RunnerResults
from suitable.types import Incomplete, ResultData, Verbosity


Expand All @@ -28,7 +29,7 @@
}


class Api(object):
class Api:
"""
Provides all available ansible modules as local functions::
Expand Down Expand Up @@ -279,6 +280,13 @@ def valid_return_codes(self, *codes: int) -> Generator[None, None, None]:

self._valid_return_codes = previous_codes

if TYPE_CHECKING:
# TODO: We could try to auto-generate stubs for the most common
# ansible module functions based on their docs, for now
# we just have a generic fallback to signify that there
# are many methods created through ModuleRunner.hookup
def __getattr__(self, key: str) -> Callable[..., RunnerResults]: ...


def install_strategy_plugins(directories: Iterable[StrPath] | str) -> None:
""" Loads the given strategy plugins, which is a list of directories,
Expand Down

0 comments on commit 6fdb68c

Please sign in to comment.