From bfff27274d11fceb1bb4960cc6621491ca7ea9dd Mon Sep 17 00:00:00 2001 From: donBarbos Date: Sun, 23 Mar 2025 20:15:40 +0400 Subject: [PATCH 1/2] Add stubs for `appdirs` --- stubs/appdirs/METADATA.toml | 2 ++ stubs/appdirs/appdirs.pyi | 62 +++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 stubs/appdirs/METADATA.toml create mode 100644 stubs/appdirs/appdirs.pyi diff --git a/stubs/appdirs/METADATA.toml b/stubs/appdirs/METADATA.toml new file mode 100644 index 000000000000..236b9e93158c --- /dev/null +++ b/stubs/appdirs/METADATA.toml @@ -0,0 +1,2 @@ +version = "1.4.*" +upstream_repository = "https://github.com/ActiveState/appdirs" diff --git a/stubs/appdirs/appdirs.pyi b/stubs/appdirs/appdirs.pyi new file mode 100644 index 000000000000..ed34b096410b --- /dev/null +++ b/stubs/appdirs/appdirs.pyi @@ -0,0 +1,62 @@ +import sys +from _typeshed import StrPath +from typing import Final + +if sys.platform == "win32": + from ctypes import windll as windll + +__version__: Final[str] +__version_info__: Final[tuple[int, int, int]] +unicode = str +system: Final[str] + +def user_data_dir( + appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, roaming: bool = False +) -> StrPath: ... +def site_data_dir( + appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, roaming: bool = False +) -> StrPath: ... +def user_config_dir( + appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, roaming: bool = False +) -> StrPath: ... +def site_config_dir( + appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, roaming: bool = False +) -> StrPath: ... +def user_cache_dir( + appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, roaming: bool = False +) -> StrPath: ... +def user_state_dir( + appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, roaming: bool = False +) -> StrPath: ... +def user_log_dir( + appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, roaming: bool = False +) -> StrPath: ... + +class AppDirs: + appname: StrPath | None + appauthor: StrPath | None + version: StrPath | None + roaming: bool + multipath: bool + def __init__( + self, + appname: StrPath | None = None, + appauthor: StrPath | None = None, + version: StrPath | None = None, + roaming: bool = False, + multipath: bool = False, + ) -> None: ... + @property + def user_data_dir(self) -> StrPath: ... + @property + def site_data_dir(self) -> StrPath: ... + @property + def user_config_dir(self) -> StrPath: ... + @property + def site_config_dir(self) -> StrPath: ... + @property + def user_cache_dir(self) -> StrPath: ... + @property + def user_state_dir(self) -> StrPath: ... + @property + def user_log_dir(self) -> StrPath: ... From 156dc1a6037c50fd76760e3fa4deeb029d917f50 Mon Sep 17 00:00:00 2001 From: donBarbos Date: Sun, 23 Mar 2025 20:29:31 +0400 Subject: [PATCH 2/2] Update function args --- stubs/appdirs/appdirs.pyi | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/stubs/appdirs/appdirs.pyi b/stubs/appdirs/appdirs.pyi index ed34b096410b..86e9ed8e6518 100644 --- a/stubs/appdirs/appdirs.pyi +++ b/stubs/appdirs/appdirs.pyi @@ -1,6 +1,6 @@ import sys from _typeshed import StrPath -from typing import Final +from typing import Final, Literal if sys.platform == "win32": from ctypes import windll as windll @@ -9,27 +9,28 @@ __version__: Final[str] __version_info__: Final[tuple[int, int, int]] unicode = str system: Final[str] +PY3: Literal[True] def user_data_dir( appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, roaming: bool = False ) -> StrPath: ... def site_data_dir( - appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, roaming: bool = False + appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, multipath: bool = False ) -> StrPath: ... def user_config_dir( appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, roaming: bool = False ) -> StrPath: ... def site_config_dir( - appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, roaming: bool = False + appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, multipath: bool = False ) -> StrPath: ... def user_cache_dir( - appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, roaming: bool = False + appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, opinion: bool = True ) -> StrPath: ... def user_state_dir( appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, roaming: bool = False ) -> StrPath: ... def user_log_dir( - appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, roaming: bool = False + appname: StrPath | None = None, appauthor: StrPath | None = None, version: StrPath | None = None, opinion: bool = True ) -> StrPath: ... class AppDirs: