From a7cf6144deeb3f99570f8b97fb5f5ecf16f20c01 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 1 Nov 2022 14:37:21 +0300 Subject: [PATCH] Complete `passpy` stubs (#8959) --- stubs/passpy/@tests/stubtest_allowlist.txt | 6 ++++++ stubs/passpy/METADATA.toml | 3 +++ stubs/passpy/passpy/util.pyi | 12 ++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 stubs/passpy/@tests/stubtest_allowlist.txt diff --git a/stubs/passpy/@tests/stubtest_allowlist.txt b/stubs/passpy/@tests/stubtest_allowlist.txt new file mode 100644 index 000000000..f7e53b666 --- /dev/null +++ b/stubs/passpy/@tests/stubtest_allowlist.txt @@ -0,0 +1,6 @@ +passpy.__main__ + +# Uses `git` dependency: +passpy.git +# Uses `gpg` dependency: +passpy.gpg diff --git a/stubs/passpy/METADATA.toml b/stubs/passpy/METADATA.toml index f3e83f9c4..516f11f6b 100644 --- a/stubs/passpy/METADATA.toml +++ b/stubs/passpy/METADATA.toml @@ -1 +1,4 @@ version = "1.0.*" + +[tool.stubtest] +ignore_missing_stub = false diff --git a/stubs/passpy/passpy/util.pyi b/stubs/passpy/passpy/util.pyi index e76e8abca..4c10cdeaa 100644 --- a/stubs/passpy/passpy/util.pyi +++ b/stubs/passpy/passpy/util.pyi @@ -1 +1,13 @@ +from collections.abc import Callable +from typing import Any, TypeVar + +_C = TypeVar("_C", bound=Callable[..., Any]) + +# Technically, the first argument of `_C` must be `Store`, +# but for now we leave it simple: +def initialised(func: _C) -> _C: ... +def trap(path_index: str | int) -> Callable[[_C], _C]: ... def gen_password(length: int, symbols: bool = ...) -> str: ... +def copy_move( + src: str, dst: str, force: bool = ..., move: bool = ..., interactive: bool = ..., verbose: bool = ... +) -> str | None: ...