diff --git a/stdlib/2.7/distutils/__init__.pyi b/stdlib/2.7/distutils/__init__.pyi index d4853fe8d517..e69de29bb2d1 100644 --- a/stdlib/2.7/distutils/__init__.pyi +++ b/stdlib/2.7/distutils/__init__.pyi @@ -1,7 +0,0 @@ -# Stubs for distutils (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -__revision__ = ... # type: Any diff --git a/stdlib/2.7/distutils/emxccompiler.pyi b/stdlib/2.7/distutils/emxccompiler.pyi new file mode 100644 index 000000000000..97e4a29adda8 --- /dev/null +++ b/stdlib/2.7/distutils/emxccompiler.pyi @@ -0,0 +1,5 @@ +# Stubs for emxccompiler + +from distutils.unixccompiler import UnixCCompiler + +class EMXCCompiler(UnixCCompiler): ... diff --git a/stdlib/2.7/distutils/version.pyi b/stdlib/2.7/distutils/version.pyi deleted file mode 100644 index a8501449116d..000000000000 --- a/stdlib/2.7/distutils/version.pyi +++ /dev/null @@ -1,23 +0,0 @@ -# Stubs for distutils.version (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -class Version: - def __init__(self, vstring=...) -> None: ... - -class StrictVersion(Version): - version_re = ... # type: Any - version = ... # type: Any - prerelease = ... # type: Any - def parse(self, vstring): ... - def __cmp__(self, other): ... - -class LooseVersion(Version): - component_re = ... # type: Any - def __init__(self, vstring=...) -> None: ... - vstring = ... # type: Any - version = ... # type: Any - def parse(self, vstring): ... - def __cmp__(self, other): ... diff --git a/stdlib/3/distutils/__init__.pyi b/stdlib/2and3/distutils/__init__.pyi similarity index 100% rename from stdlib/3/distutils/__init__.pyi rename to stdlib/2and3/distutils/__init__.pyi diff --git a/stdlib/2and3/distutils/archive_util.pyi b/stdlib/2and3/distutils/archive_util.pyi new file mode 100644 index 000000000000..12172f3f2b01 --- /dev/null +++ b/stdlib/2and3/distutils/archive_util.pyi @@ -0,0 +1,12 @@ +# Stubs for distutils.archive_util + +from typing import Optional + + +def make_archive(base_name: str, format: str, root_dir: Optional[str] = ..., + base_dir: Optional[str] = ..., verbose: int = ..., + dry_run: int = ...) -> str: ... +def make_tarball(base_name: str, base_dir: str, compress: Optional[str] = ..., + verbose: int = ..., dry_run: int = ...) -> str: ... +def make_zipfile(base_name: str, base_dir: str, verbose: int = ..., + dry_run: int = ...) -> str: ... diff --git a/stdlib/2and3/distutils/bcppcompiler.pyi b/stdlib/2and3/distutils/bcppcompiler.pyi new file mode 100644 index 000000000000..9f27a0ae0965 --- /dev/null +++ b/stdlib/2and3/distutils/bcppcompiler.pyi @@ -0,0 +1,6 @@ +# Stubs for distutils.bcppcompiler + +from distutils.ccompiler import CCompiler + + +class BCPPCompiler(CCompiler): ... diff --git a/stdlib/2and3/distutils/ccompiler.pyi b/stdlib/2and3/distutils/ccompiler.pyi new file mode 100644 index 000000000000..94fad8bacd00 --- /dev/null +++ b/stdlib/2and3/distutils/ccompiler.pyi @@ -0,0 +1,119 @@ +# Stubs for distutils.ccompiler + +from typing import Any, Callable, List, Optional, Tuple, Union + + +_Macro = Union[Tuple[str], Tuple[str, str]] + + +def gen_lib_options(compiler: CCompiler, library_dirs: List[str], + runtime_library_dirs: List[str], + libraries: List[str]) -> List[str]: ... +def gen_preprocess_options(macros: List[_Macro], + include_dirs: List[str]) -> List[str]: ... +def get_default_compiler(osname: Optional[str] = ..., + platform: Optional[str] = ...) -> str: ... +def new_compiler(plat: Optional[str] = ..., compiler: Optional[str] = ..., + verbose: int = ..., dry_run: int = ..., + force: int = ...) -> CCompiler: ... +def show_compilers() -> None: ... + +class CCompiler: + def __init__(self, verbose: int = ..., dry_run: int = ..., + force: int = ...) -> None: ... + def add_include_dir(self, dir: str) -> None: ... + def set_include_dirs(self, dirs: List[str]) -> None: ... + def add_library(self, libname: str) -> None: ... + def set_libraries(self, libnames: List[str]) -> None: ... + def add_library_dir(self, dir: str) -> None: ... + def set_library_dirs(self, dirs: List[str]) -> None: ... + def add_runtime_library_dir(self, dir: str) -> None: ... + def set_runtime_library_dirs(self, dirs: List[str]) -> None: ... + def define_macro(self, name: str, value: Optional[str] = ...) -> None: ... + def undefine_macro(self, name: str) -> None: ... + def add_link_object(self, object: str) -> None: ... + def set_link_objects(self, objects: List[str]) -> None: ... + def detect_language(self, sources: Union[str, List[str]]) -> Optional[str]: ... + def find_library_file(self, dirs: List[str], lib: str, + debug: bool = ...) -> Optional[str]: ... + def has_function(self, funcname: str, includes: Optional[List[str]] = ..., + include_dirs: Optional[List[str]] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ...) -> bool: ... + def library_dir_option(self, dir: str) -> str: ... + def library_option(self, lib: str) -> str: ... + def runtime_library_dir_option(self, dir: str) -> str: ... + def set_executables(self, **args: str) -> None: ... + def compile(self, sources: List[str], output_dir: Optional[str] = ..., + macros: Optional[_Macro] = ..., + include_dirs: Optional[List[str]] = ..., debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + depends: Optional[List[str]] = ...) -> List[str]: ... + def create_static_lib(self, objects: List[str], output_libname: str, + output_dir: Optional[str] = ..., debug: bool = ..., + target_lang: Optional[str] = ...) -> None: ... + def link(self, target_desc: str, objects: List[str], output_filename: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ...) -> None: ... + def link_executable(self, objects: List[str], output_progname: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + target_lang: Optional[str] = ...) -> None: ... + def link_shared_lib(self, objects: List[str], output_libname: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ...) -> None: ... + def link_shared_object(self, objects: List[str], output_filename: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ...) -> None: ... + def preprocess(self, source: str, output_file: Optional[str] = ..., + macros: Optional[List[_Macro]] = ..., + include_dirs: Optional[List[str]] = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ...) -> None: ... + def executable_filename(self, basename: str, strip_dir: int = ..., + output_dir: str = ...) -> str: ... + def library_filename(self, libname: str, lib_type: str = ..., + strip_dir: int = ..., + output_dir: str = ...) -> str: ... + def object_filenames(self, source_filenames: List[str], + strip_dir: int = ..., + output_dir: str = ...) -> List[str]: ... + def shared_object_filename(self, basename: str, strip_dir: int = ..., + output_dir: str = ...) -> str: ... + def execute(self, func: Callable[..., None], args: Tuple[Any, ...], + msg: Optional[str] = ..., level: int = ...) -> None: ... + def spawn(self, cmd: List[str]) -> None: ... + def mkpath(self, name: str, mode: int = ...) -> None: ... + def move_file(self, src: str, dst: str) -> str: ... + def announce(self, msg: str, level: int = ...) -> None: ... + def warn(self, msg: str) -> None: ... + def debug_print(self, msg: str) -> None: ... diff --git a/stdlib/2and3/distutils/cmd.pyi b/stdlib/2and3/distutils/cmd.pyi new file mode 100644 index 000000000000..126ef1599292 --- /dev/null +++ b/stdlib/2and3/distutils/cmd.pyi @@ -0,0 +1,15 @@ +# Stubs for distutils.cmd + +from typing import Callable, List, Tuple, Union +from abc import abstractmethod +from distutils.dist import Distribution + +class Command: + sub_commands = ... # type: List[Tuple[str, Union[Callable[[], bool], str, None]]] + def __init__(self, dist: Distribution) -> None: ... + @abstractmethod + def initialize_options(self) -> None: ... + @abstractmethod + def finalize_options(self) -> None: ... + @abstractmethod + def run(self) -> None: ... diff --git a/stdlib/2and3/distutils/command/__init__.pyi b/stdlib/2and3/distutils/command/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/bdist.pyi b/stdlib/2and3/distutils/command/bdist.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/bdist_dumb.pyi b/stdlib/2and3/distutils/command/bdist_dumb.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/bdist_msi.pyi b/stdlib/2and3/distutils/command/bdist_msi.pyi new file mode 100644 index 000000000000..3813699f5d25 --- /dev/null +++ b/stdlib/2and3/distutils/command/bdist_msi.pyi @@ -0,0 +1,5 @@ +# Stubs for distutils.command.bdist_msi + +from distutils.cmd import Command + +class bdist_msi(Command): ... diff --git a/stdlib/2and3/distutils/command/bdist_packager.pyi b/stdlib/2and3/distutils/command/bdist_packager.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/bdist_rpm.pyi b/stdlib/2and3/distutils/command/bdist_rpm.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/bdist_wininst.pyi b/stdlib/2and3/distutils/command/bdist_wininst.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/build.pyi b/stdlib/2and3/distutils/command/build.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/build_clib.pyi b/stdlib/2and3/distutils/command/build_clib.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/build_ext.pyi b/stdlib/2and3/distutils/command/build_ext.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/build_py.pyi b/stdlib/2and3/distutils/command/build_py.pyi new file mode 100644 index 000000000000..23b3f9e69b07 --- /dev/null +++ b/stdlib/2and3/distutils/command/build_py.pyi @@ -0,0 +1,8 @@ +# Stubs for distutils.command.bdist_msi + +from distutils.cmd import Command +import sys + +if sys.version_info >= (3,): + class build_py(Command): ... + class build_py_2to3(Command): ... diff --git a/stdlib/2and3/distutils/command/build_scripts.pyi b/stdlib/2and3/distutils/command/build_scripts.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/check.pyi b/stdlib/2and3/distutils/command/check.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/clean.pyi b/stdlib/2and3/distutils/command/clean.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/config.pyi b/stdlib/2and3/distutils/command/config.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/install.pyi b/stdlib/2and3/distutils/command/install.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/install_data.pyi b/stdlib/2and3/distutils/command/install_data.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/install_headers.pyi b/stdlib/2and3/distutils/command/install_headers.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/install_lib.pyi b/stdlib/2and3/distutils/command/install_lib.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/install_scripts.pyi b/stdlib/2and3/distutils/command/install_scripts.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/register.pyi b/stdlib/2and3/distutils/command/register.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/command/sdist.pyi b/stdlib/2and3/distutils/command/sdist.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/core.pyi b/stdlib/2and3/distutils/core.pyi new file mode 100644 index 000000000000..38d6a1a0f425 --- /dev/null +++ b/stdlib/2and3/distutils/core.pyi @@ -0,0 +1,35 @@ +# Stubs for distutils.core + +from typing import Any, List, Mapping, Optional, Tuple, Type, Union +from distutils.cmd import Command as Command +from distutils.dist import Distribution as Distribution +from distutils.extension import Extension as Extension + +def setup(name: str = ..., + version: str = ..., + description: str = ..., + long_description: str = ..., + author: str = ..., + author_email: str = ..., + maintainer: str = ..., + maintainer_email: str = ..., + url: str = ..., + download_url: str = ..., + packages: List[str] = ..., + py_modules: List[str] = ..., + scripts: List[str] = ..., + ext_modules: List[Extension] = ..., + classifiers: List[str] = ..., + distclass: Type[Distribution] = ..., + script_name: str = ..., + script_args: List[str] = ..., + options: Mapping[str, Any] = ..., + license: str = ..., + keywords: Union[List[str], str] = ..., + platforms: Union[List[str], str] = ..., + cmdclass: Mapping[str, Command] = ..., + data_files: List[Tuple[str, List[str]]] = ..., + package_dir: Mapping[str, str] = ...) -> None: ... +def run_setup(script_name: str, + script_args: Optional[List[str]] = ..., + stop_after: str = ...) -> Distribution: ... diff --git a/stdlib/2and3/distutils/cygwinccompiler.pyi b/stdlib/2and3/distutils/cygwinccompiler.pyi new file mode 100644 index 000000000000..1bfab90ead47 --- /dev/null +++ b/stdlib/2and3/distutils/cygwinccompiler.pyi @@ -0,0 +1,7 @@ +# Stubs for distutils.cygwinccompiler + +from distutils.unixccompiler import UnixCCompiler + + +class CygwinCCompiler(UnixCCompiler): ... +class Mingw32CCompiler(CygwinCCompiler): ... diff --git a/stdlib/2and3/distutils/debug.pyi b/stdlib/2and3/distutils/debug.pyi new file mode 100644 index 000000000000..c3a184999578 --- /dev/null +++ b/stdlib/2and3/distutils/debug.pyi @@ -0,0 +1,3 @@ +# Stubs for distutils.debug + +DEBUG = ... # type: bool diff --git a/stdlib/2and3/distutils/dep_util.pyi b/stdlib/2and3/distutils/dep_util.pyi new file mode 100644 index 000000000000..7df58478132d --- /dev/null +++ b/stdlib/2and3/distutils/dep_util.pyi @@ -0,0 +1,8 @@ +# Stubs for distutils.dep_util + +from typing import List, Tuple + +def newer(source: str, target: str) -> bool: ... +def newer_pairwise(sources: List[str], + targets: List[str]) -> List[Tuple[str, str]]: ... +def newer_group(sources: List[str], target: str, missing: str = ...) -> bool: ... diff --git a/stdlib/2and3/distutils/dir_util.pyi b/stdlib/2and3/distutils/dir_util.pyi new file mode 100644 index 000000000000..667ac2fe710a --- /dev/null +++ b/stdlib/2and3/distutils/dir_util.pyi @@ -0,0 +1,15 @@ +# Stubs for distutils.dir_util + +from typing import List + + +def mkpath(name: str, mode: int = ..., verbose: int = ..., + dry_run: int = ...) -> List[str]: ... +def create_tree(base_dir: str, files: List[str], mode: int = ..., + verbose: int = ..., dry_run: int = ...) -> None: ... +def copy_tree(src: str, dst: str, preserve_mode: int = ..., + preserve_times: int = ..., preserve_symlinks: int = ..., + update: int = ..., verbose: int = ..., + dry_run: int = ...) -> List[str]: ... +def remove_tree(directory: str, verbose: int = ..., + dry_run: int = ...) -> None: ... diff --git a/stdlib/2and3/distutils/dist.pyi b/stdlib/2and3/distutils/dist.pyi new file mode 100644 index 000000000000..2d9c16265c1b --- /dev/null +++ b/stdlib/2and3/distutils/dist.pyi @@ -0,0 +1,7 @@ +# Stubs for distutils.dist + +from typing import Any, Mapping, Optional + + +class Distribution: + def __init__(self, attrs: Optional[Mapping[str, Any]] = ...) -> None: ... diff --git a/stdlib/2and3/distutils/errors.pyi b/stdlib/2and3/distutils/errors.pyi new file mode 100644 index 000000000000..49ca06f016c2 --- /dev/null +++ b/stdlib/2and3/distutils/errors.pyi @@ -0,0 +1,4 @@ +# Stubs for distutils.errors + +class DistutilsExecError(Exception): ... +class DistutilsFileError(Exception): ... diff --git a/stdlib/2and3/distutils/extension.pyi b/stdlib/2and3/distutils/extension.pyi new file mode 100644 index 000000000000..81dae103fe89 --- /dev/null +++ b/stdlib/2and3/distutils/extension.pyi @@ -0,0 +1,39 @@ +# Stubs for distutils.extension + +from typing import List, Optional, Tuple +import sys + +class Extension: + if sys.version_info >= (3,): + def __init__(self, + *, name: str = ..., + sources: List[str] = ..., + include_dirs: List[str] = ..., + define_macros: List[Tuple[str, Optional[str]]] = ..., + undef_macros: List[str] = ..., + library_dirs: List[str] = ..., + libraries: List[str] = ..., + runtime_library_dirs: List[str] = ..., + extra_objects: List[str] = ..., + extra_compile_args: List[str] = ..., + extra_link_args: List[str] = ..., + export_symbols: List[str] = ..., + depends: List[str] = ..., + language: str = ..., + optional: bool = ...) -> None: ... + else: + def __init__(self, + *, name: str = ..., + sources: List[str] = ..., + include_dirs: List[str] = ..., + define_macros: List[Tuple[str, Optional[str]]] = ..., + undef_macros: List[str] = ..., + library_dirs: List[str] = ..., + libraries: List[str] = ..., + runtime_library_dirs: List[str] = ..., + extra_objects: List[str] = ..., + extra_compile_args: List[str] = ..., + extra_link_args: List[str] = ..., + export_symbols: List[str] = ..., + depends: List[str] = ..., + language: str = ...) -> None: ... diff --git a/stdlib/2and3/distutils/fancy_getopt.pyi b/stdlib/2and3/distutils/fancy_getopt.pyi new file mode 100644 index 000000000000..aa7e964b2fe5 --- /dev/null +++ b/stdlib/2and3/distutils/fancy_getopt.pyi @@ -0,0 +1,27 @@ +# Stubs for distutils.fancy_getopt + +from typing import ( + Any, List, Mapping, Optional, Tuple, Union, + TypeVar, overload, +) + +_Option = Tuple[str, str, str] +_GR = Tuple[List[str], OptionDummy] + +def fancy_getopt(options: List[_Option], + negative_opt: Mapping[_Option, _Option], + object: Any, + args: Optional[List[str]]) -> Union[List[str], _GR]: ... +def wrap_text(text: str, width: int) -> List[str]: ... + +class FancyGetopt: + def __init__(self, option_table: Optional[List[_Option]] = ...) -> None: ... + # TODO kinda wrong, `getopt(object=object())` is invalid + @overload + def getopt(self, args: Optional[List[str]] = ...) -> _GR: ... + @overload + def getopt(self, args: Optional[List[str]], object: Any) -> List[str]: ... + def get_option_order(self) -> List[Tuple[str, str]]: ... + def generate_help(self, header: Optional[str] = ...) -> List[str]: ... + +class OptionDummy: ... diff --git a/stdlib/2and3/distutils/file_util.pyi b/stdlib/2and3/distutils/file_util.pyi new file mode 100644 index 000000000000..6324d63d4b5d --- /dev/null +++ b/stdlib/2and3/distutils/file_util.pyi @@ -0,0 +1,12 @@ +# Stubs for distutils.file_util + +from typing import Optional, Sequence, Tuple + + +def copy_file(src: str, dst: str, preserve_mode: bool = ..., + preserve_times: bool = ..., update: bool = ..., + link: Optional[str] = ..., verbose: bool = ..., + dry_run: bool = ...) -> Tuple[str, str]: ... +def move_file(src: str, dst: str, verbose: bool = ..., + dry_run: bool = ...) -> str: ... +def write_file(filename: str, contents: Sequence[str]) -> None: ... diff --git a/stdlib/2and3/distutils/filelist.pyi b/stdlib/2and3/distutils/filelist.pyi new file mode 100644 index 000000000000..4ecaebaf714f --- /dev/null +++ b/stdlib/2and3/distutils/filelist.pyi @@ -0,0 +1,3 @@ +# Stubs for distutils.filelist + +class FileList: ... diff --git a/stdlib/2and3/distutils/log.pyi b/stdlib/2and3/distutils/log.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/2and3/distutils/msvccompiler.pyi b/stdlib/2and3/distutils/msvccompiler.pyi new file mode 100644 index 000000000000..ffc9e4490ce3 --- /dev/null +++ b/stdlib/2and3/distutils/msvccompiler.pyi @@ -0,0 +1,6 @@ +# Stubs for distutils.msvccompiler + +from distutils.ccompiler import CCompiler + + +class MSVCCompiler(CCompiler): ... diff --git a/stdlib/2and3/distutils/spawn.pyi b/stdlib/2and3/distutils/spawn.pyi new file mode 100644 index 000000000000..f8acb8a7fbeb --- /dev/null +++ b/stdlib/2and3/distutils/spawn.pyi @@ -0,0 +1,8 @@ +# Stubs for distutils.spawn + +from typing import Optional + +def spawn(cmd: List[str], search_path: bool = ..., + verbose: bool = ..., dry_run: bool = ...) -> None: ... +def find_executable(executable: str, + path: Optional[str] = ...) -> Optional[str]: ... diff --git a/stdlib/2and3/distutils/sysconfig.pyi b/stdlib/2and3/distutils/sysconfig.pyi new file mode 100644 index 000000000000..f87cd462b434 --- /dev/null +++ b/stdlib/2and3/distutils/sysconfig.pyi @@ -0,0 +1,19 @@ +# Stubs for distutils.sysconfig + +from typing import Mapping, Optional, Union +from distutils.ccompiler import CCompiler + +PREFIX = ... # type: str +EXEC_PREFIX = ... # type: str + +def get_config_var(name: str) -> Union[int, str, None]: ... +def get_config_vars(*args: str) -> Mapping[str, Union[int, str]]: ... +def get_config_h_filename() -> str: ... +def get_makefile_filename() -> str: ... +def get_python_inc(plat_specific: bool = ..., + prefix: Optional[str] = ...) -> str: ... +def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., + prefix: Optional[str] = ...) -> str: ... + +def customize_compiler(compiler: CCompiler) -> None: ... +def set_python_build() -> None: ... diff --git a/stdlib/2and3/distutils/text_file.pyi b/stdlib/2and3/distutils/text_file.pyi new file mode 100644 index 000000000000..b4fcb5952c29 --- /dev/null +++ b/stdlib/2and3/distutils/text_file.pyi @@ -0,0 +1,18 @@ +# Stubs for distutils.text_file + +from typing import IO, Optional, Tuple, Union + +class TextFile: + def __init__(self, filename: Optional[str] = ..., + file: Optional[IO[str]] = ..., + *, strip_comments: bool = ..., + lstrip_ws: bool = ..., rstrip_ws: bool = ..., + skip_blanks: bool = ..., join_lines: bool = ..., + collapse_join: bool = ...) -> None: ... + def open(self, filename: str) -> None: ... + def close(self) -> None: ... + def warn(self, msg: str, + line: Union[List[int], Tuple[int, int], int] = ...) -> None: ... + def readline(self) -> Optional[str]: ... + def readlines(self) -> List[str]: ... + def unreadline(self, line: str) -> str: ... diff --git a/stdlib/2and3/distutils/unixccompiler.pyi b/stdlib/2and3/distutils/unixccompiler.pyi new file mode 100644 index 000000000000..7ab7298bf4c6 --- /dev/null +++ b/stdlib/2and3/distutils/unixccompiler.pyi @@ -0,0 +1,6 @@ +# Stubs for distutils.unixccompiler + +from distutils.ccompiler import CCompiler + + +class UnixCCompiler(CCompiler): ... diff --git a/stdlib/2and3/distutils/util.pyi b/stdlib/2and3/distutils/util.pyi new file mode 100644 index 000000000000..97db9e03dba6 --- /dev/null +++ b/stdlib/2and3/distutils/util.pyi @@ -0,0 +1,20 @@ +# Stubs for distutils.util + +from typing import Any, Callable, Mapping, Optional, Tuple + + +def get_platform() -> str: ... +def convert_path(pathname: str) -> str: ... +def change_root(new_root: str, pathname: str) -> str: ... +def check_environ() -> None: ... +def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ... +def split_quoted(s: str) -> List[str]: ... +def execute(func: Callable[..., None], args: Tuple[Any, ...], + msg: Optional[str] = ..., verbose: bool = ..., + dry_run: bool = ...) -> None: ... +def strtobool(val: str) -> bool: ... +def byte_compile(py_files: List[str], optimize: int = ..., force: bool = ..., + prefix: Optional[str] = ..., base_dir: Optional[str] = ..., + verbose: bool = ..., dry_run: bool = ..., + direct: Optional[bool] = ...) -> None: ... +def rfc822_escape(header: str) -> str: ... diff --git a/stdlib/2and3/distutils/version.pyi b/stdlib/2and3/distutils/version.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stdlib/3/distutils/errors.pyi b/stdlib/3/distutils/errors.pyi deleted file mode 100644 index e5578f969067..000000000000 --- a/stdlib/3/distutils/errors.pyi +++ /dev/null @@ -1,4 +0,0 @@ -import typing - -class DistutilsError(Exception): ... -class DistutilsExecError(DistutilsError): ... diff --git a/stdlib/3/distutils/spawn.pyi b/stdlib/3/distutils/spawn.pyi deleted file mode 100644 index ac6eaf3fe383..000000000000 --- a/stdlib/3/distutils/spawn.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from typing import List - -# In Python, arguments have integer default values -def spawn(cmd: List[str], search_path: bool = ..., verbose: bool = ..., - dry_run: bool = ...) -> None: ... -def find_executable(executable: str, path: str = ...) -> str: ...