diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index bbd45088c..2a67d9644 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -55,6 +55,7 @@ "stubs/redis", "stubs/requests", "stubs/selenium", + "stubs/Send2Trash", "stubs/simplejson", "stubs/slumber", "stubs/stripe", diff --git a/stubs/Send2Trash/METADATA.toml b/stubs/Send2Trash/METADATA.toml new file mode 100644 index 000000000..71d785350 --- /dev/null +++ b/stubs/Send2Trash/METADATA.toml @@ -0,0 +1 @@ +version = "1.8" diff --git a/stubs/Send2Trash/send2trash/__init__.pyi b/stubs/Send2Trash/send2trash/__init__.pyi new file mode 100644 index 000000000..5fa3c599c --- /dev/null +++ b/stubs/Send2Trash/send2trash/__init__.pyi @@ -0,0 +1,10 @@ +from _typeshed import StrOrBytesPath +from typing import Any + +from .exceptions import TrashPermissionError as TrashPermissionError + +# The list should be list[StrOrBytesPath] but that doesn't work because invariance +def send2trash(paths: list[Any] | StrOrBytesPath) -> None: ... + +# Marked as incomplete because there are platform-specific plat_foo modules +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/stubs/Send2Trash/send2trash/compat.pyi b/stubs/Send2Trash/send2trash/compat.pyi new file mode 100644 index 000000000..91e2bc4de --- /dev/null +++ b/stubs/Send2Trash/send2trash/compat.pyi @@ -0,0 +1,6 @@ +from typing import Any + +PY3: Any +text_type = str +binary_type = bytes +environb: Any diff --git a/stubs/Send2Trash/send2trash/exceptions.pyi b/stubs/Send2Trash/send2trash/exceptions.pyi new file mode 100644 index 000000000..7e2ca98b7 --- /dev/null +++ b/stubs/Send2Trash/send2trash/exceptions.pyi @@ -0,0 +1,2 @@ +class TrashPermissionError(PermissionError): + def __init__(self, filename) -> None: ... diff --git a/stubs/Send2Trash/send2trash/util.pyi b/stubs/Send2Trash/send2trash/util.pyi new file mode 100644 index 000000000..e23e382a3 --- /dev/null +++ b/stubs/Send2Trash/send2trash/util.pyi @@ -0,0 +1 @@ +def preprocess_paths(paths): ...