From 2a3f2251c17f09a6b494843aeda98a00f141b72f Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 5 Sep 2022 15:37:43 -0400 Subject: [PATCH] PyInstaller from https://github.com/pyinstaller/pyinstaller/pull/7068 https://github.com/Avasam/typeshed/pull/1 --- scripts/requirements.txt | 2 +- typings/PyInstaller/__init__.pyi | 9 --- typings/PyInstaller/__main__.pyi | 7 -- typings/PyInstaller/building/build_main.pyi | 24 ------ typings/PyInstaller/building/datastruct.pyi | 2 - typings/PyInstaller/compat.pyi | 81 ------------------- typings/PyInstaller/depend/imphookapi.pyi | 7 -- typings/PyInstaller/isolated/__init__.pyi | 1 - typings/PyInstaller/isolated/_parent.pyi | 14 ---- typings/PyInstaller/utils/__init__.pyi | 0 typings/PyInstaller/utils/hooks/__init__.pyi | 83 -------------------- typings/PyInstaller/utils/hooks/conda.pyi | 50 ------------ typings/PyInstaller/utils/hooks/win32.pyi | 3 - typings/pyi_splash/__init__.pyi | 12 --- 14 files changed, 1 insertion(+), 294 deletions(-) delete mode 100644 typings/PyInstaller/__init__.pyi delete mode 100644 typings/PyInstaller/__main__.pyi delete mode 100644 typings/PyInstaller/building/build_main.pyi delete mode 100644 typings/PyInstaller/building/datastruct.pyi delete mode 100644 typings/PyInstaller/compat.pyi delete mode 100644 typings/PyInstaller/depend/imphookapi.pyi delete mode 100644 typings/PyInstaller/isolated/__init__.pyi delete mode 100644 typings/PyInstaller/isolated/_parent.pyi delete mode 100644 typings/PyInstaller/utils/__init__.pyi delete mode 100644 typings/PyInstaller/utils/hooks/__init__.pyi delete mode 100644 typings/PyInstaller/utils/hooks/conda.pyi delete mode 100644 typings/PyInstaller/utils/hooks/win32.pyi delete mode 100644 typings/pyi_splash/__init__.pyi diff --git a/scripts/requirements.txt b/scripts/requirements.txt index 3ecf1bbe..7f3a9b59 100644 --- a/scripts/requirements.txt +++ b/scripts/requirements.txt @@ -29,5 +29,5 @@ winsdk>=v1.0.0b4 D3DShot # # Build and compile resources -PyInstaller +git+https://github.com/Avasam/pyinstaller.git@py.typed#egg=PyInstaller PySide6 diff --git a/typings/PyInstaller/__init__.pyi b/typings/PyInstaller/__init__.pyi deleted file mode 100644 index 2a281261..00000000 --- a/typings/PyInstaller/__init__.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from PyInstaller import compat as compat - -__all__ = ("HOMEPATH", "PLATFORM", "__version__", "DEFAULT_DISTPATH", "DEFAULT_SPECPATH", "DEFAULT_WORKPATH") -__version__: str -HOMEPATH: str -DEFAULT_SPECPATH: str -DEFAULT_DISTPATH: str -DEFAULT_WORKPATH: str -PLATFORM: str diff --git a/typings/PyInstaller/__main__.pyi b/typings/PyInstaller/__main__.pyi deleted file mode 100644 index 46a3774c..00000000 --- a/typings/PyInstaller/__main__.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from _typeshed import SupportsKeysAndGetItem -from collections.abc import Iterable - -def run( - pyi_args: Iterable[str] = ..., - pyi_config: SupportsKeysAndGetItem[str, bool | list[str] | None] | Iterable[tuple[str, bool | list[str] | None]] = ..., -) -> None: ... diff --git a/typings/PyInstaller/building/build_main.pyi b/typings/PyInstaller/building/build_main.pyi deleted file mode 100644 index 3bbdf21f..00000000 --- a/typings/PyInstaller/building/build_main.pyi +++ /dev/null @@ -1,24 +0,0 @@ -from _typeshed import StrOrBytesPath -from collections.abc import Iterable - -from PyInstaller.building.datastruct import Target # type: ignore[import] - -class Analysis(Target): - hooksconfig: dict[str, dict[str, list[str]]] - def __init__( - self, - scripts: Iterable[StrOrBytesPath], - pathex=..., - binaries=..., - datas=..., - hiddenimports=..., - hookspath=..., - hooksconfig: dict[str, dict[str, list[str]]] | None = ..., - excludes=..., - runtime_hooks=..., - cipher=..., - win_no_prefer_redirects=..., - win_private_assemblies=..., - noarchive: bool = ..., - module_collection_mode=..., - ) -> None: ... diff --git a/typings/PyInstaller/building/datastruct.pyi b/typings/PyInstaller/building/datastruct.pyi deleted file mode 100644 index 754ae711..00000000 --- a/typings/PyInstaller/building/datastruct.pyi +++ /dev/null @@ -1,2 +0,0 @@ -class Target: - invcnum: int = ... diff --git a/typings/PyInstaller/compat.pyi b/typings/PyInstaller/compat.pyi deleted file mode 100644 index c9151a89..00000000 --- a/typings/PyInstaller/compat.pyi +++ /dev/null @@ -1,81 +0,0 @@ -from _typeshed import StrOrBytesPath -from collections.abc import Iterable -from importlib.abc import _Path -from os import PathLike -from types import ModuleType -from typing import AnyStr, overload -from typing_extensions import Literal, TypeAlias - -_OpenFile: TypeAlias = StrOrBytesPath | int - -is_64bits: bool -is_py35: bool -is_py36: bool -is_py37: bool -is_py38: bool -is_py39: bool -is_py310: bool -is_win: bool -is_win_10: bool -is_win_wine: bool -is_cygwin: bool -is_darwin: bool -is_linux: bool -is_solar: bool -is_aix: bool -is_freebsd: bool -is_openbsd: bool -is_hpux: bool -is_unix: bool -is_musl: bool -is_macos_11_compat: bool -is_macos_11_native: bool -is_macos_11: bool -PYDYLIB_NAMES: set[str] -base_prefix: str -is_venv: bool -is_conda: bool -is_pure_conda: bool -python_executable: str -is_ms_app_store: bool -BYTECODE_MAGIC: bytes -EXTENSION_SUFFIXES: list[str] -ALL_SUFFIXES: list[str] - -architecture: Literal["64bit", "32bit"] -system: Literal["Cygwin", "Linux", "Darwin", "Java", "Windows"] -machine: Literal["sw_64", "loongarch64", "arm", "intel", "ppc", "mips", "riscv", "s390x", "unknown"] | None - -def is_wine_dll(filename: _OpenFile) -> bool: ... -@overload -def getenv(name: str, default: str = ...) -> str: ... -@overload -def getenv(name: str, default: None = ...) -> str | None: ... -def setenv(name: str, value: str) -> None: ... -def unsetenv(name: str) -> None: ... -def exec_command( - *cmdargs: str, encoding: str | None = ..., raise_enoent: bool | None = ..., **kwargs: int | bool | Iterable[int] | None -) -> str: ... -def exec_command_rc(*cmdargs: str, **kwargs: float | bool | Iterable[int] | None) -> int: ... -def exec_command_stdout( - *command_args: str, encoding: str | None = ..., **kwargs: float | str | bytes | bool | Iterable[int] | None -) -> str: ... -def exec_command_all( - *cmdargs: str, encoding: str | None = ..., **kwargs: int | bool | Iterable[int] | None -) -> tuple[int, str, str]: ... -def exec_python(*args: str, **kwargs: str | None) -> str: ... -def exec_python_rc(*args: str, **kwargs: str | None) -> int: ... -def expand_path(path: PathLike[AnyStr] | AnyStr) -> AnyStr: ... -def getsitepackages(prefixes: Iterable[str] | None = ...) -> list[str]: ... -def importlib_load_source(name: str, pathname: _Path) -> ModuleType: ... - -PY3_BASE_MODULES: set[str] -PURE_PYTHON_MODULE_TYPES: set[str] -SPECIAL_MODULE_TYPES: set[str] -BINARY_MODULE_TYPES: set[str] -VALID_MODULE_TYPES: set[str] -BAD_MODULE_TYPES: set[str] -ALL_MODULE_TYPES: set[str] -MODULE_TYPES_TO_TOC_DICT: dict[str, str] - -def check_requirements() -> None: ... diff --git a/typings/PyInstaller/depend/imphookapi.pyi b/typings/PyInstaller/depend/imphookapi.pyi deleted file mode 100644 index df409f32..00000000 --- a/typings/PyInstaller/depend/imphookapi.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from PyInstaller.building.build_main import Analysis # type: ignore[import] - -class PostGraphAPI: - @property - def __path__(self) -> tuple[str, ...] | None: ... - @property - def analysis(self) -> Analysis: ... diff --git a/typings/PyInstaller/isolated/__init__.pyi b/typings/PyInstaller/isolated/__init__.pyi deleted file mode 100644 index 67f623d3..00000000 --- a/typings/PyInstaller/isolated/__init__.pyi +++ /dev/null @@ -1 +0,0 @@ -from ._parent import Python as Python, call as call, decorate as decorate diff --git a/typings/PyInstaller/isolated/_parent.pyi b/typings/PyInstaller/isolated/_parent.pyi deleted file mode 100644 index bdc3f342..00000000 --- a/typings/PyInstaller/isolated/_parent.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from collections.abc import Callable -from functools import _AnyCallable -from typing import TypeVar -from typing_extensions import ParamSpec - -_AC = TypeVar("_AC", bound=_AnyCallable) -_R = TypeVar("_R", bound=_AnyCallable) -_P = ParamSpec("_P") - -class Python: - def call(self, function: Callable[_P, _R], *args: _P.args, **kwargs: _P.kwargs) -> _R: ... - -def call(function: Callable[_P, _R], *args: _P.args, **kwargs: _P.kwargs) -> _R: ... -def decorate(function: _AC) -> _AC: ... diff --git a/typings/PyInstaller/utils/__init__.pyi b/typings/PyInstaller/utils/__init__.pyi deleted file mode 100644 index e69de29b..00000000 diff --git a/typings/PyInstaller/utils/hooks/__init__.pyi b/typings/PyInstaller/utils/hooks/__init__.pyi deleted file mode 100644 index 59d3ed61..00000000 --- a/typings/PyInstaller/utils/hooks/__init__.pyi +++ /dev/null @@ -1,83 +0,0 @@ -import os -from _typeshed import AnyOrLiteralStr, GenericPath, StrOrBytesPath, SupportsKeysAndGetItem -from collections.abc import Callable, Iterable -from typing import Any, AnyStr -from typing_extensions import Literal - -import pkg_resources -from PyInstaller import isolated -from PyInstaller.depend.imphookapi import PostGraphAPI # type: ignore[import] -from PyInstaller.utils.hooks import conda as conda_support -from PyInstaller.utils.hooks.win32 import get_pywin32_module_file_attribute as get_pywin32_module_file_attribute - -PY_IGNORE_EXTENSIONS: set[str] -hook_variables: dict[str, str] - -def exec_statement(statement: str) -> str | int: ... -def exec_statement_rc(statement: str) -> str | int: ... -def exec_script( - script_filename: os.PathLike[AnyStr] | AnyOrLiteralStr, - *args: str, - env: SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]] = ..., -) -> str | int: ... -def exec_script_rc( - script_filename: os.PathLike[AnyStr] | AnyOrLiteralStr, - *args: str, - env: SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]] = ..., -) -> str | int: ... -def eval_statement(statement: str) -> Any | Literal[""]: ... -def eval_script( - scriptfilename: os.PathLike[AnyStr] | AnyOrLiteralStr, - *args: str, - env: SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]] = ..., -) -> Any | Literal[""]: ... -@isolated.decorate -def get_pyextension_imports(module_name: str) -> list[str]: ... -def get_homebrew_path(formula: str = ...) -> str | None: ... -def remove_prefix(string: str, prefix: str) -> str: ... -def remove_suffix(string: str, suffix: str) -> str: ... -def remove_file_extension(filename: str) -> str: ... -@isolated.decorate -def can_import_module(module_name: str) -> bool: ... -def get_module_attribute(module_name: str, attr_name: str) -> Any: ... -def get_module_file_attribute(package: str) -> str | None: ... -def is_module_satisfies( - requirements: str | Iterable[str] | pkg_resources.Requirement, - version: str | pkg_resources.Distribution = ..., - version_attr: str = ..., -) -> bool: ... -def is_package(module_name: str) -> bool: ... -def get_all_package_paths(package: str) -> list[str]: ... -def package_base_path(package_path: str, package: str) -> str: ... -def get_package_paths(package: str) -> tuple[str, str]: ... -def collect_submodules( - package: str, filter: Callable[[str], bool] = ..., on_error: Literal["ignore", "warn once", "warn", "raise"] = ... -) -> list[str]: ... -def is_module_or_submodule(name: str, mod_or_submod: str) -> bool: ... - -PY_DYLIB_PATTERNS: list[str] - -def collect_dynamic_libs(package: str, destdir: object | None = ...) -> list[tuple[str, str]]: ... -def collect_data_files( - package: str, - include_py_files: bool = ..., - subdir: StrOrBytesPath = ..., - excludes: Iterable[str] = ..., - includes: Iterable[str] = ..., -) -> list[tuple[str, str]]: ... -def collect_system_data_files( - path: GenericPath[AnyStr], destdir: StrOrBytesPath | None = ..., include_py_files: bool = ... -) -> list[tuple[str, str]]: ... -def copy_metadata(package_name: str, recursive: bool = ...) -> list[str]: ... -def get_installer(module: str) -> str | None: ... -def requirements_for_package(package_name: str) -> list[str]: ... -def collect_all( - package_name: str, - include_py_files: bool = ..., - filter_submodules: Callable[[str], bool] | None = ..., - exclude_datas: Iterable[str] | None = ..., - include_datas: Iterable[str] | None = ..., - on_error: Literal["ignore", "warn once", "warn", "raise"] = ..., -) -> tuple[list[str], list[tuple[str, str]], list[str]]: ... -def collect_entry_point(name: str) -> tuple[list[str], list[str]]: ... -def get_hook_config(hook_api: PostGraphAPI, module_name: str, key: str) -> None: ... diff --git a/typings/PyInstaller/utils/hooks/conda.pyi b/typings/PyInstaller/utils/hooks/conda.pyi deleted file mode 100644 index 06fca6c3..00000000 --- a/typings/PyInstaller/utils/hooks/conda.pyi +++ /dev/null @@ -1,50 +0,0 @@ -import sys -from _typeshed import StrOrBytesPath -from collections.abc import Sequence -from pathlib import Path, PurePath -from typing import Any -from typing_extensions import TypeAlias, TypedDict - -if sys.version_info >= (3, 8): - from importlib.metadata import PackagePath as _PackagePath -else: - _PackagePath: TypeAlias = Any - -CONDA_ROOT: Path -CONDA_META_DIR: Path -PYTHONPATH_PREFIXES: list[Path] - -class _RawDict(TypedDict): - name: str - version: str - files: list[StrOrBytesPath | PurePath] - depends: list[str] - -class Distribution: - raw: _RawDict - name: str - version: str - files: list[PackagePath] - dependencies: list[str] - packages: list[str | None] - def __init__(self, json_path: str) -> None: ... - @classmethod - def from_name(cls, name: str) -> Distribution: ... - @classmethod - def from_package_name(cls, name: str) -> Distribution: ... - -class PackagePath(_PackagePath): - def locate(self) -> Path: ... - -def walk_dependency_tree(initial: str, excludes: Sequence[str] | None = ...) -> dict[str, Distribution]: ... -def requires(name: str, strip_versions: bool = ...) -> list[str]: ... -def files(name: str, dependencies: bool = ..., excludes: Sequence[str] | None = ...) -> list[PackagePath]: ... - -lib_dir: PackagePath - -def collect_dynamic_libs( - name: str, dest: str = ..., dependencies: bool = ..., excludes: Sequence[str] | None = ... -) -> list[tuple[str, str]]: ... - -distributions: dict[str, Distribution] -distributions_by_package: dict[str | None, Distribution] diff --git a/typings/PyInstaller/utils/hooks/win32.pyi b/typings/PyInstaller/utils/hooks/win32.pyi deleted file mode 100644 index 1015f47e..00000000 --- a/typings/PyInstaller/utils/hooks/win32.pyi +++ /dev/null @@ -1,3 +0,0 @@ -def get_pywin32_module_file_attribute(module_name: str) -> str | int: ... - -__all__ = ("get_pywin32_module_file_attribute",) diff --git a/typings/pyi_splash/__init__.pyi b/typings/pyi_splash/__init__.pyi deleted file mode 100644 index 7fb0043b..00000000 --- a/typings/pyi_splash/__init__.pyi +++ /dev/null @@ -1,12 +0,0 @@ -# https://pyinstaller.org/en/stable/advanced-topics.html?highlight=pyi_splash#module-pyi_splash -# https://github.com/pyinstaller/pyinstaller/blob/develop/PyInstaller/fake-modules/pyi_splash.py -from typing_extensions import Literal - -__all__ = ["CLOSE_CONNECTION", "FLUSH_CHARACTER", "is_alive", "close", "update_text"] - -def is_alive() -> bool: ... -def update_text(msg: str) -> None: ... -def close() -> None: ... - -CLOSE_CONNECTION: Literal[b"\u0004"] -FLUSH_CHARACTER: Literal[b"\r"]