Update setuptools stubs (#8345)

setuptools now vendors `distutils` as `setuptools._distutils`.
This commit is contained in:
Sebastian Rittau
2022-07-20 18:44:22 +02:00
committed by GitHub
parent f178ae0d83
commit 73fbb53475
51 changed files with 1386 additions and 11 deletions

View File

@@ -26,3 +26,12 @@ pkg_resources.get_provider
pkg_resources.py31compat
pkg_resources.split_sections
pkg_resources.to_filename
# Only available on Windows
setuptools._distutils.command.bdist_msi
# Unclear import from stdlib/sub-classing related error
setuptools._distutils.core.Distribution.parse_config_files
# Only present if docutils is installed
setuptools._distutils.command.check.SilentReporter

View File

@@ -0,0 +1,20 @@
def make_archive(
base_name: str,
format: str,
root_dir: str | None = ...,
base_dir: str | None = ...,
verbose: int = ...,
dry_run: int = ...,
owner: str | None = ...,
group: str | None = ...,
) -> str: ...
def make_tarball(
base_name: str,
base_dir: str,
compress: str | None = ...,
verbose: int = ...,
dry_run: int = ...,
owner: str | None = ...,
group: str | None = ...,
) -> str: ...
def make_zipfile(base_name: str, base_dir: str, verbose: int = ..., dry_run: int = ...) -> str: ...

View File

@@ -0,0 +1,3 @@
from distutils.ccompiler import CCompiler
class BCPPCompiler(CCompiler): ...

View File

@@ -0,0 +1,152 @@
from collections.abc import Callable
from typing import Any, Union
from typing_extensions import TypeAlias
_Macro: TypeAlias = Union[tuple[str], tuple[str, str | None]]
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: str | None = ..., platform: str | None = ...) -> str: ...
def new_compiler(
plat: str | None = ..., compiler: str | None = ..., verbose: int = ..., dry_run: int = ..., force: int = ...
) -> CCompiler: ...
def show_compilers() -> None: ...
class CCompiler:
dry_run: bool
force: bool
verbose: bool
output_dir: str | None
macros: list[_Macro]
include_dirs: list[str]
libraries: list[str]
library_dirs: list[str]
runtime_library_dirs: list[str]
objects: list[str]
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: str | None = ...) -> 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: str | list[str]) -> str | None: ...
def find_library_file(self, dirs: list[str], lib: str, debug: bool = ...) -> str | None: ...
def has_function(
self,
funcname: str,
includes: list[str] | None = ...,
include_dirs: list[str] | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
) -> 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: str | None = ...,
macros: _Macro | None = ...,
include_dirs: list[str] | None = ...,
debug: bool = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
depends: list[str] | None = ...,
) -> list[str]: ...
def create_static_lib(
self,
objects: list[str],
output_libname: str,
output_dir: str | None = ...,
debug: bool = ...,
target_lang: str | None = ...,
) -> None: ...
def link(
self,
target_desc: str,
objects: list[str],
output_filename: str,
output_dir: str | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
export_symbols: list[str] | None = ...,
debug: bool = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
build_temp: str | None = ...,
target_lang: str | None = ...,
) -> None: ...
def link_executable(
self,
objects: list[str],
output_progname: str,
output_dir: str | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
debug: bool = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
target_lang: str | None = ...,
) -> None: ...
def link_shared_lib(
self,
objects: list[str],
output_libname: str,
output_dir: str | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
export_symbols: list[str] | None = ...,
debug: bool = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
build_temp: str | None = ...,
target_lang: str | None = ...,
) -> None: ...
def link_shared_object(
self,
objects: list[str],
output_filename: str,
output_dir: str | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
export_symbols: list[str] | None = ...,
debug: bool = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
build_temp: str | None = ...,
target_lang: str | None = ...,
) -> None: ...
def preprocess(
self,
source: str,
output_file: str | None = ...,
macros: list[_Macro] | None = ...,
include_dirs: list[str] | None = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
) -> 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[..., object], args: tuple[Any, ...], msg: str | None = ..., 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: ...

View File

@@ -0,0 +1,68 @@
from abc import abstractmethod
from collections.abc import Callable, Iterable
from distutils.dist import Distribution
from typing import Any
class Command:
sub_commands: list[tuple[str, Callable[[Command], bool] | None]]
def __init__(self, dist: Distribution) -> None: ...
@abstractmethod
def initialize_options(self) -> None: ...
@abstractmethod
def finalize_options(self) -> None: ...
@abstractmethod
def run(self) -> None: ...
def announce(self, msg: str, level: int = ...) -> None: ...
def debug_print(self, msg: str) -> None: ...
def ensure_string(self, option: str, default: str | None = ...) -> None: ...
def ensure_string_list(self, option: str | list[str]) -> None: ...
def ensure_filename(self, option: str) -> None: ...
def ensure_dirname(self, option: str) -> None: ...
def get_command_name(self) -> str: ...
def set_undefined_options(self, src_cmd: str, *option_pairs: tuple[str, str]) -> None: ...
def get_finalized_command(self, command: str, create: int = ...) -> Command: ...
def reinitialize_command(self, command: Command | str, reinit_subcommands: int = ...) -> Command: ...
def run_command(self, command: str) -> None: ...
def get_sub_commands(self) -> list[str]: ...
def warn(self, msg: str) -> None: ...
def execute(self, func: Callable[..., object], args: Iterable[Any], msg: str | None = ..., level: int = ...) -> None: ...
def mkpath(self, name: str, mode: int = ...) -> None: ...
def copy_file(
self,
infile: str,
outfile: str,
preserve_mode: int = ...,
preserve_times: int = ...,
link: str | None = ...,
level: Any = ...,
) -> tuple[str, bool]: ... # level is not used
def copy_tree(
self,
infile: str,
outfile: str,
preserve_mode: int = ...,
preserve_times: int = ...,
preserve_symlinks: int = ...,
level: Any = ...,
) -> list[str]: ... # level is not used
def move_file(self, src: str, dst: str, level: Any = ...) -> str: ... # level is not used
def spawn(self, cmd: Iterable[str], search_path: int = ..., level: Any = ...) -> None: ... # level is not used
def make_archive(
self,
base_name: str,
format: str,
root_dir: str | None = ...,
base_dir: str | None = ...,
owner: str | None = ...,
group: str | None = ...,
) -> str: ...
def make_file(
self,
infiles: str | list[str] | tuple[str, ...],
outfile: str,
func: Callable[..., object],
args: list[Any],
exec_msg: str | None = ...,
skip_msg: str | None = ...,
level: Any = ...,
) -> None: ... # level is not used

View File

@@ -0,0 +1,25 @@
from typing import Any
from ..cmd import Command
def show_formats() -> None: ...
class bdist(Command):
description: str
user_options: Any
boolean_options: Any
help_options: Any
no_format_option: Any
default_format: Any
format_commands: Any
format_command: Any
bdist_base: Any
plat_name: Any
formats: Any
dist_dir: Any
skip_build: int
group: Any
owner: Any
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...

View File

@@ -0,0 +1,21 @@
from typing import Any
from ..cmd import Command
class bdist_dumb(Command):
description: str
user_options: Any
boolean_options: Any
default_format: Any
bdist_dir: Any
plat_name: Any
format: Any
keep_temp: int
dist_dir: Any
skip_build: Any
relative: int
owner: Any
group: Any
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...

View File

@@ -0,0 +1,45 @@
import sys
from typing import Any
from ..cmd import Command
if sys.platform == "win32":
from msilib import Dialog
class PyDialog(Dialog):
def __init__(self, *args, **kw) -> None: ...
def title(self, title) -> None: ...
def back(self, title, next, name: str = ..., active: int = ...): ...
def cancel(self, title, next, name: str = ..., active: int = ...): ...
def next(self, title, next, name: str = ..., active: int = ...): ...
def xbutton(self, name, title, next, xpos): ...
class bdist_msi(Command):
description: str
user_options: Any
boolean_options: Any
all_versions: Any
other_version: str
if sys.version_info >= (3, 9):
def __init__(self, *args, **kw) -> None: ...
bdist_dir: Any
plat_name: Any
keep_temp: int
no_target_compile: int
no_target_optimize: int
target_version: Any
dist_dir: Any
skip_build: Any
install_script: Any
pre_install_script: Any
versions: Any
def initialize_options(self) -> None: ...
install_script_key: Any
def finalize_options(self) -> None: ...
db: Any
def run(self) -> None: ...
def add_files(self) -> None: ...
def add_find_python(self) -> None: ...
def add_scripts(self) -> None: ...
def add_ui(self) -> None: ...
def get_installer_filename(self, fullname): ...

View File

@@ -0,0 +1,52 @@
from typing import Any
from ..cmd import Command
class bdist_rpm(Command):
description: str
user_options: Any
boolean_options: Any
negative_opt: Any
bdist_base: Any
rpm_base: Any
dist_dir: Any
python: Any
fix_python: Any
spec_only: Any
binary_only: Any
source_only: Any
use_bzip2: Any
distribution_name: Any
group: Any
release: Any
serial: Any
vendor: Any
packager: Any
doc_files: Any
changelog: Any
icon: Any
prep_script: Any
build_script: Any
install_script: Any
clean_script: Any
verify_script: Any
pre_install: Any
post_install: Any
pre_uninstall: Any
post_uninstall: Any
prep: Any
provides: Any
requires: Any
conflicts: Any
build_requires: Any
obsoletes: Any
keep_temp: int
use_rpm_opt_flags: int
rpm3_mode: int
no_autoreq: int
force_arch: Any
quiet: int
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def finalize_package_data(self) -> None: ...
def run(self) -> None: ...

View File

@@ -0,0 +1,16 @@
from _typeshed import StrOrBytesPath
from distutils.cmd import Command
from typing import Any, ClassVar
class bdist_wininst(Command):
description: ClassVar[str]
user_options: ClassVar[list[tuple[Any, ...]]]
boolean_options: ClassVar[list[str]]
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def get_inidata(self) -> str: ...
def create_exe(self, arcname: StrOrBytesPath, fullname: str, bitmap: StrOrBytesPath | None = ...) -> None: ...
def get_installer_filename(self, fullname: str) -> str: ...
def get_exe_bytes(self) -> bytes: ...

View File

@@ -0,0 +1,31 @@
from typing import Any
from ..cmd import Command
def show_compilers() -> None: ...
class build(Command):
description: str
user_options: Any
boolean_options: Any
help_options: Any
build_base: str
build_purelib: Any
build_platlib: Any
build_lib: Any
build_temp: Any
build_scripts: Any
compiler: Any
plat_name: Any
debug: Any
force: int
executable: Any
parallel: Any
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def has_pure_modules(self): ...
def has_c_libraries(self): ...
def has_ext_modules(self): ...
def has_scripts(self): ...
sub_commands: Any

View File

@@ -0,0 +1,27 @@
from typing import Any
from ..cmd import Command
def show_compilers() -> None: ...
class build_clib(Command):
description: str
user_options: Any
boolean_options: Any
help_options: Any
build_clib: Any
build_temp: Any
libraries: Any
include_dirs: Any
define: Any
undef: Any
debug: Any
force: int
compiler: Any
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def check_library_list(self, libraries) -> None: ...
def get_library_names(self): ...
def get_source_files(self): ...
def build_libraries(self, libraries) -> None: ...

View File

@@ -0,0 +1,50 @@
from typing import Any
from ..cmd import Command
extension_name_re: Any
def show_compilers() -> None: ...
class build_ext(Command):
description: str
sep_by: Any
user_options: Any
boolean_options: Any
help_options: Any
extensions: Any
build_lib: Any
plat_name: Any
build_temp: Any
inplace: int
package: Any
include_dirs: Any
define: Any
undef: Any
libraries: Any
library_dirs: Any
rpath: Any
link_objects: Any
debug: Any
force: Any
compiler: Any
swig: Any
swig_cpp: Any
swig_opts: Any
user: Any
parallel: Any
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def check_extensions_list(self, extensions) -> None: ...
def get_source_files(self): ...
def get_outputs(self): ...
def build_extensions(self) -> None: ...
def build_extension(self, ext) -> None: ...
def swig_sources(self, sources, extension): ...
def find_swig(self): ...
def get_ext_fullpath(self, ext_name): ...
def get_ext_fullname(self, ext_name): ...
def get_ext_filename(self, ext_name): ...
def get_export_symbols(self, ext): ...
def get_libraries(self, ext): ...

View File

@@ -0,0 +1,38 @@
from typing import Any
from ..cmd import Command
class build_py(Command):
description: str
user_options: Any
boolean_options: Any
negative_opt: Any
build_lib: Any
py_modules: Any
package: Any
package_data: Any
package_dir: Any
compile: int
optimize: int
force: Any
def initialize_options(self) -> None: ...
packages: Any
data_files: Any
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def get_data_files(self): ...
def find_data_files(self, package, src_dir): ...
def build_package_data(self) -> None: ...
def get_package_dir(self, package): ...
def check_package(self, package, package_dir): ...
def check_module(self, module, module_file): ...
def find_package_modules(self, package, package_dir): ...
def find_modules(self): ...
def find_all_modules(self): ...
def get_source_files(self): ...
def get_module_outfile(self, build_dir, package, module): ...
def get_outputs(self, include_bytecode: int = ...): ...
def build_module(self, module, module_file, package): ...
def build_modules(self) -> None: ...
def build_packages(self) -> None: ...
def byte_compile(self, files) -> None: ...

View File

@@ -0,0 +1,21 @@
from re import Pattern
from typing import Any
from ..cmd import Command
first_line_re: Pattern[str]
class build_scripts(Command):
description: str
user_options: Any
boolean_options: Any
build_dir: Any
scripts: Any
force: Any
executable: Any
outfiles: Any
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def get_source_files(self): ...
def run(self) -> None: ...
def copy_scripts(self): ...

View File

@@ -0,0 +1,37 @@
from typing import Any
from typing_extensions import TypeAlias
from ..cmd import Command
_Reporter: TypeAlias = Any # really docutils.utils.Reporter
# Only defined if docutils is installed.
class SilentReporter(_Reporter):
messages: Any
def __init__(
self,
source,
report_level,
halt_level,
stream: Any | None = ...,
debug: int = ...,
encoding: str = ...,
error_handler: str = ...,
) -> None: ...
def system_message(self, level, message, *children, **kwargs): ...
HAS_DOCUTILS: bool
class check(Command):
description: str
user_options: Any
boolean_options: Any
restructuredtext: int
metadata: int
strict: int
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def warn(self, msg): ...
def run(self) -> None: ...
def check_metadata(self) -> None: ...
def check_restructuredtext(self) -> None: ...

View File

@@ -0,0 +1,17 @@
from typing import Any
from ..cmd import Command
class clean(Command):
description: str
user_options: Any
boolean_options: Any
build_base: Any
build_lib: Any
build_temp: Any
build_scripts: Any
bdist_base: Any
all: Any
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...

View File

@@ -0,0 +1,83 @@
from collections.abc import Sequence
from re import Pattern
from typing import Any
from ..ccompiler import CCompiler
from ..cmd import Command
LANG_EXT: dict[str, str]
class config(Command):
description: str
# Tuple is full name, short name, description
user_options: Sequence[tuple[str, str | None, str]]
compiler: str | CCompiler
cc: str | None
include_dirs: Sequence[str] | None
libraries: Sequence[str] | None
library_dirs: Sequence[str] | None
noisy: int
dump_source: int
temp_files: Sequence[str]
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def try_cpp(
self,
body: str | None = ...,
headers: Sequence[str] | None = ...,
include_dirs: Sequence[str] | None = ...,
lang: str = ...,
) -> bool: ...
def search_cpp(
self,
pattern: Pattern[str] | str,
body: str | None = ...,
headers: Sequence[str] | None = ...,
include_dirs: Sequence[str] | None = ...,
lang: str = ...,
) -> bool: ...
def try_compile(
self, body: str, headers: Sequence[str] | None = ..., include_dirs: Sequence[str] | None = ..., lang: str = ...
) -> bool: ...
def try_link(
self,
body: str,
headers: Sequence[str] | None = ...,
include_dirs: Sequence[str] | None = ...,
libraries: Sequence[str] | None = ...,
library_dirs: Sequence[str] | None = ...,
lang: str = ...,
) -> bool: ...
def try_run(
self,
body: str,
headers: Sequence[str] | None = ...,
include_dirs: Sequence[str] | None = ...,
libraries: Sequence[str] | None = ...,
library_dirs: Sequence[str] | None = ...,
lang: str = ...,
) -> bool: ...
def check_func(
self,
func: str,
headers: Sequence[str] | None = ...,
include_dirs: Sequence[str] | None = ...,
libraries: Sequence[str] | None = ...,
library_dirs: Sequence[str] | None = ...,
decl: int = ...,
call: int = ...,
) -> bool: ...
def check_lib(
self,
library: str,
library_dirs: Sequence[str] | None = ...,
headers: Sequence[str] | None = ...,
include_dirs: Sequence[str] | None = ...,
other_libraries: list[str] = ...,
) -> bool: ...
def check_header(
self, header: str, include_dirs: Sequence[str] | None = ..., library_dirs: Sequence[str] | None = ..., lang: str = ...
) -> bool: ...
def dump_file(filename: str, head: Any | None = ...) -> None: ...

View File

@@ -0,0 +1,63 @@
from typing import Any
from ..cmd import Command
HAS_USER_SITE: bool
SCHEME_KEYS: tuple[str, ...]
INSTALL_SCHEMES: dict[str, dict[Any, Any]]
class install(Command):
description: str
user_options: Any
boolean_options: Any
negative_opt: Any
prefix: str | None
exec_prefix: Any
home: str | None
user: bool
install_base: Any
install_platbase: Any
root: str | None
install_purelib: Any
install_platlib: Any
install_headers: Any
install_lib: str | None
install_scripts: Any
install_data: Any
install_userbase: Any
install_usersite: Any
compile: Any
optimize: Any
extra_path: Any
install_path_file: int
force: int
skip_build: int
warn_dir: int
build_base: Any
build_lib: Any
record: Any
def initialize_options(self) -> None: ...
config_vars: Any
install_libbase: Any
def finalize_options(self) -> None: ...
def dump_dirs(self, msg) -> None: ...
def finalize_unix(self) -> None: ...
def finalize_other(self) -> None: ...
def select_scheme(self, name) -> None: ...
def expand_basedirs(self) -> None: ...
def expand_dirs(self) -> None: ...
def convert_paths(self, *names) -> None: ...
path_file: Any
extra_dirs: Any
def handle_extra_path(self) -> None: ...
def change_roots(self, *names) -> None: ...
def create_home_path(self) -> None: ...
def run(self) -> None: ...
def create_path_file(self) -> None: ...
def get_outputs(self): ...
def get_inputs(self): ...
def has_lib(self): ...
def has_headers(self): ...
def has_scripts(self): ...
def has_data(self): ...
sub_commands: Any

View File

@@ -0,0 +1,19 @@
from typing import Any
from ..cmd import Command
class install_data(Command):
description: str
user_options: Any
boolean_options: Any
install_dir: Any
outfiles: Any
root: Any
force: int
data_files: Any
warn_dir: int
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def get_inputs(self): ...
def get_outputs(self): ...

View File

@@ -0,0 +1,18 @@
from typing import Any, ClassVar
from ..cmd import Command
class install_egg_info(Command):
description: ClassVar[str]
user_options: ClassVar[list[tuple[str, str | None, str]]]
install_dir: Any
def initialize_options(self) -> None: ...
target: Any
outputs: Any
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def get_outputs(self) -> list[str]: ...
def safe_name(name): ...
def safe_version(version): ...
def to_filename(name): ...

View File

@@ -0,0 +1,16 @@
from typing import Any
from ..cmd import Command
class install_headers(Command):
description: str
user_options: Any
boolean_options: Any
install_dir: Any
force: int
outfiles: Any
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def get_inputs(self): ...
def get_outputs(self): ...

View File

@@ -0,0 +1,25 @@
from typing import Any
from ..cmd import Command
PYTHON_SOURCE_EXTENSION: str
class install_lib(Command):
description: str
user_options: Any
boolean_options: Any
negative_opt: Any
install_dir: Any
build_dir: Any
force: int
compile: Any
optimize: Any
skip_build: Any
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def build(self) -> None: ...
def install(self): ...
def byte_compile(self, files) -> None: ...
def get_outputs(self): ...
def get_inputs(self): ...

View File

@@ -0,0 +1,18 @@
from typing import Any
from ..cmd import Command
class install_scripts(Command):
description: str
user_options: Any
boolean_options: Any
install_dir: Any
force: int
build_dir: Any
skip_build: Any
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
outfiles: Any
def run(self) -> None: ...
def get_inputs(self): ...
def get_outputs(self): ...

View File

@@ -0,0 +1,5 @@
from _typeshed import Incomplete
def compose(f1, f2): ...
pythonlib: Incomplete

View File

@@ -0,0 +1,18 @@
from typing import Any
from ..config import PyPIRCCommand
class register(PyPIRCCommand):
description: str
sub_commands: Any
list_classifiers: int
strict: int
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def check_metadata(self) -> None: ...
def classifiers(self) -> None: ...
def verify_metadata(self) -> None: ...
def send_metadata(self) -> None: ...
def build_post_data(self, action): ...
def post_to_server(self, data, auth: Any | None = ...): ...

View File

@@ -0,0 +1,42 @@
from typing import Any
from ..cmd import Command
def show_formats() -> None: ...
class sdist(Command):
description: str
def checking_metadata(self): ...
user_options: Any
boolean_options: Any
help_options: Any
negative_opt: Any
sub_commands: Any
READMES: Any
template: Any
manifest: Any
use_defaults: int
prune: int
manifest_only: int
force_manifest: int
formats: Any
keep_temp: int
dist_dir: Any
archive_files: Any
metadata_check: int
owner: Any
group: Any
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
filelist: Any
def run(self) -> None: ...
def check_metadata(self) -> None: ...
def get_file_list(self) -> None: ...
def add_defaults(self) -> None: ...
def read_template(self) -> None: ...
def prune_file_list(self) -> None: ...
def write_manifest(self) -> None: ...
def read_manifest(self) -> None: ...
def make_release_tree(self, base_dir, files) -> None: ...
def make_distribution(self) -> None: ...
def get_archive_files(self): ...

View File

@@ -0,0 +1,17 @@
from typing import Any, ClassVar
from ..config import PyPIRCCommand
class upload(PyPIRCCommand):
description: ClassVar[str]
username: str
password: str
show_response: int
sign: bool
identity: Any
def initialize_options(self) -> None: ...
repository: Any
realm: Any
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def upload_file(self, command: str, pyversion: str, filename: str) -> None: ...

View File

@@ -0,0 +1,17 @@
from abc import abstractmethod
from distutils.cmd import Command
from typing import ClassVar
DEFAULT_PYPIRC: str
class PyPIRCCommand(Command):
DEFAULT_REPOSITORY: ClassVar[str]
DEFAULT_REALM: ClassVar[str]
repository: None
realm: None
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
@abstractmethod
def run(self) -> None: ...

View File

@@ -0,0 +1,49 @@
from collections.abc import Mapping
from distutils.cmd import Command as Command
from distutils.dist import Distribution as Distribution
from distutils.extension import Extension as Extension
from typing import Any
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: list[str] | str = ...,
platforms: list[str] | str = ...,
cmdclass: Mapping[str, type[Command]] = ...,
data_files: list[tuple[str, list[str]]] = ...,
package_dir: Mapping[str, str] = ...,
obsoletes: list[str] = ...,
provides: list[str] = ...,
requires: list[str] = ...,
command_packages: list[str] = ...,
command_options: Mapping[str, Mapping[str, tuple[Any, Any]]] = ...,
package_data: Mapping[str, list[str]] = ...,
include_package_data: bool = ...,
libraries: list[str] = ...,
headers: list[str] = ...,
ext_package: str = ...,
include_dirs: list[str] = ...,
password: str = ...,
fullname: str = ...,
**attrs: Any,
) -> None: ...
def run_setup(script_name: str, script_args: list[str] | None = ..., stop_after: str = ...) -> Distribution: ...

View File

@@ -0,0 +1,4 @@
from distutils.unixccompiler import UnixCCompiler
class CygwinCCompiler(UnixCCompiler): ...
class Mingw32CCompiler(CygwinCCompiler): ...

View File

@@ -0,0 +1 @@
DEBUG: bool | None

View File

@@ -0,0 +1,3 @@
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: ...

View File

@@ -0,0 +1,13 @@
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: ...

View File

@@ -0,0 +1,59 @@
from _typeshed import StrOrBytesPath, SupportsWrite
from collections.abc import Iterable, Mapping
from distutils.cmd import Command
from typing import IO, Any
class DistributionMetadata:
def __init__(self, path: int | StrOrBytesPath | None = ...) -> None: ...
name: str | None
version: str | None
author: str | None
author_email: str | None
maintainer: str | None
maintainer_email: str | None
url: str | None
license: str | None
description: str | None
long_description: str | None
keywords: str | list[str] | None
platforms: str | list[str] | None
classifiers: str | list[str] | None
download_url: str | None
provides: list[str] | None
requires: list[str] | None
obsoletes: list[str] | None
def read_pkg_file(self, file: IO[str]) -> None: ...
def write_pkg_info(self, base_dir: str) -> None: ...
def write_pkg_file(self, file: SupportsWrite[str]) -> None: ...
def get_name(self) -> str: ...
def get_version(self) -> str: ...
def get_fullname(self) -> str: ...
def get_author(self) -> str: ...
def get_author_email(self) -> str: ...
def get_maintainer(self) -> str: ...
def get_maintainer_email(self) -> str: ...
def get_contact(self) -> str: ...
def get_contact_email(self) -> str: ...
def get_url(self) -> str: ...
def get_license(self) -> str: ...
def get_licence(self) -> str: ...
def get_description(self) -> str: ...
def get_long_description(self) -> str: ...
def get_keywords(self) -> str | list[str]: ...
def get_platforms(self) -> str | list[str]: ...
def get_classifiers(self) -> str | list[str]: ...
def get_download_url(self) -> str: ...
def get_requires(self) -> list[str]: ...
def set_requires(self, value: Iterable[str]) -> None: ...
def get_provides(self) -> list[str]: ...
def set_provides(self, value: Iterable[str]) -> None: ...
def get_obsoletes(self) -> list[str]: ...
def set_obsoletes(self, value: Iterable[str]) -> None: ...
class Distribution:
cmdclass: dict[str, type[Command]]
metadata: DistributionMetadata
def __init__(self, attrs: Mapping[str, Any] | None = ...) -> None: ...
def get_option_dict(self, command: str) -> dict[str, tuple[str, str]]: ...
def parse_config_files(self, filenames: Iterable[str] | None = ...) -> None: ...
def get_command_obj(self, command: str, create: bool = ...) -> Command | None: ...

View File

@@ -0,0 +1,19 @@
class DistutilsError(Exception): ...
class DistutilsModuleError(DistutilsError): ...
class DistutilsClassError(DistutilsError): ...
class DistutilsGetoptError(DistutilsError): ...
class DistutilsArgError(DistutilsError): ...
class DistutilsFileError(DistutilsError): ...
class DistutilsOptionError(DistutilsError): ...
class DistutilsSetupError(DistutilsError): ...
class DistutilsPlatformError(DistutilsError): ...
class DistutilsExecError(DistutilsError): ...
class DistutilsInternalError(DistutilsError): ...
class DistutilsTemplateError(DistutilsError): ...
class DistutilsByteCompileError(DistutilsError): ...
class CCompilerError(Exception): ...
class PreprocessError(CCompilerError): ...
class CompileError(CCompilerError): ...
class LibError(CCompilerError): ...
class LinkError(CCompilerError): ...
class UnknownFileError(CCompilerError): ...

View File

@@ -0,0 +1,36 @@
class Extension:
name: str
sources: list[str]
include_dirs: list[str]
define_macros: list[tuple[str, str | None]]
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]
swig_opts: list[str]
depends: list[str]
language: str | None
optional: bool | None
def __init__(
self,
name: str,
sources: list[str],
include_dirs: list[str] | None = ...,
define_macros: list[tuple[str, str | None]] | None = ...,
undef_macros: list[str] | None = ...,
library_dirs: list[str] | None = ...,
libraries: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
extra_objects: list[str] | None = ...,
extra_compile_args: list[str] | None = ...,
extra_link_args: list[str] | None = ...,
export_symbols: list[str] | None = ...,
swig_opts: list[str] | None = ...,
depends: list[str] | None = ...,
language: str | None = ...,
optional: bool | None = ...,
) -> None: ...

View File

@@ -0,0 +1,24 @@
from collections.abc import Iterable, Mapping
from typing import Any, overload
from typing_extensions import TypeAlias
_Option: TypeAlias = tuple[str, str | None, str]
_GR: TypeAlias = tuple[list[str], OptionDummy]
def fancy_getopt(
options: list[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: list[str] | None
) -> list[str] | _GR: ...
def wrap_text(text: str, width: int) -> list[str]: ...
class FancyGetopt:
def __init__(self, option_table: list[_Option] | None = ...) -> None: ...
# TODO kinda wrong, `getopt(object=object())` is invalid
@overload
def getopt(self, args: list[str] | None = ...) -> _GR: ...
@overload
def getopt(self, args: list[str] | None, object: Any) -> list[str]: ...
def get_option_order(self) -> list[tuple[str, str]]: ...
def generate_help(self, header: str | None = ...) -> list[str]: ...
class OptionDummy:
def __init__(self, options: Iterable[str] = ...) -> None: ...

View File

@@ -0,0 +1,14 @@
from collections.abc import Sequence
def copy_file(
src: str,
dst: str,
preserve_mode: bool = ...,
preserve_times: bool = ...,
update: bool = ...,
link: str | None = ...,
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: ...

View File

@@ -0,0 +1,51 @@
from collections.abc import Iterable
from re import Pattern
from typing import overload
from typing_extensions import Literal
# class is entirely undocumented
class FileList:
allfiles: Iterable[str] | None
files: list[str]
def __init__(self, warn: None = ..., debug_print: None = ...) -> None: ...
def set_allfiles(self, allfiles: Iterable[str]) -> None: ...
def findall(self, dir: str = ...) -> None: ...
def debug_print(self, msg: str) -> None: ...
def append(self, item: str) -> None: ...
def extend(self, items: Iterable[str]) -> None: ...
def sort(self) -> None: ...
def remove_duplicates(self) -> None: ...
def process_template_line(self, line: str) -> None: ...
@overload
def include_pattern(
self, pattern: str, anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: Literal[0, False] = ...
) -> bool: ...
@overload
def include_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> bool: ...
@overload
def include_pattern(
self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ...
) -> bool: ...
@overload
def exclude_pattern(
self, pattern: str, anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: Literal[0, False] = ...
) -> bool: ...
@overload
def exclude_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> bool: ...
@overload
def exclude_pattern(
self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ...
) -> bool: ...
def findall(dir: str = ...) -> list[str]: ...
def glob_to_re(pattern: str) -> str: ...
@overload
def translate_pattern(
pattern: str, anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: Literal[False, 0] = ...
) -> Pattern[str]: ...
@overload
def translate_pattern(pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> Pattern[str]: ...
@overload
def translate_pattern(
pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ...
) -> Pattern[str]: ...

View File

@@ -0,0 +1,25 @@
from typing import Any
DEBUG: int
INFO: int
WARN: int
ERROR: int
FATAL: int
class Log:
def __init__(self, threshold: int = ...) -> None: ...
def log(self, level: int, msg: str, *args: Any) -> None: ...
def debug(self, msg: str, *args: Any) -> None: ...
def info(self, msg: str, *args: Any) -> None: ...
def warn(self, msg: str, *args: Any) -> None: ...
def error(self, msg: str, *args: Any) -> None: ...
def fatal(self, msg: str, *args: Any) -> None: ...
def log(level: int, msg: str, *args: Any) -> None: ...
def debug(msg: str, *args: Any) -> None: ...
def info(msg: str, *args: Any) -> None: ...
def warn(msg: str, *args: Any) -> None: ...
def error(msg: str, *args: Any) -> None: ...
def fatal(msg: str, *args: Any) -> None: ...
def set_threshold(level: int) -> int: ...
def set_verbosity(v: int) -> None: ...

View File

@@ -0,0 +1,3 @@
from distutils.ccompiler import CCompiler
class MSVCCompiler(CCompiler): ...

View File

@@ -0,0 +1,6 @@
from _typeshed import Incomplete
def spawn(
cmd: list[str], search_path: bool = ..., verbose: bool = ..., dry_run: bool = ..., env: Incomplete | None = ...
) -> None: ...
def find_executable(executable: str, path: str | None = ...) -> str | None: ...

View File

@@ -0,0 +1,13 @@
from collections.abc import Mapping
from distutils.ccompiler import CCompiler
PREFIX: str
EXEC_PREFIX: str
def get_config_var(name: str) -> int | str | None: ...
def get_config_vars(*args: str) -> Mapping[str, int | str]: ...
def get_config_h_filename() -> str: ...
def get_makefile_filename() -> str: ...
def get_python_inc(plat_specific: bool = ..., prefix: str | None = ...) -> str: ...
def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., prefix: str | None = ...) -> str: ...
def customize_compiler(compiler: CCompiler) -> None: ...

View File

@@ -0,0 +1,21 @@
from typing import IO
class TextFile:
def __init__(
self,
filename: str | None = ...,
file: IO[str] | None = ...,
*,
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: list[int] | tuple[int, int] | int | None = ...) -> None: ...
def readline(self) -> str | None: ...
def readlines(self) -> list[str]: ...
def unreadline(self, line: str) -> str: ...

View File

@@ -0,0 +1,3 @@
from distutils.ccompiler import CCompiler
class UnixCCompiler(CCompiler): ...

View File

@@ -0,0 +1,30 @@
from collections.abc import Callable, Mapping
from typing import Any
from typing_extensions import Literal
def get_host_platform() -> str: ...
def get_platform() -> str: ...
def get_macosx_target_ver_from_syscfg(): ...
def get_macosx_target_ver(): ...
def split_version(s: str) -> list[int]: ...
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 grok_environment_error(exc: object, prefix: str = ...) -> str: ...
def split_quoted(s: str) -> list[str]: ...
def execute(
func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., verbose: bool = ..., dry_run: bool = ...
) -> None: ...
def strtobool(val: str) -> Literal[0, 1]: ...
def byte_compile(
py_files: list[str],
optimize: int = ...,
force: bool = ...,
prefix: str | None = ...,
base_dir: str | None = ...,
verbose: bool = ...,
dry_run: bool = ...,
direct: bool | None = ...,
) -> None: ...
def rfc822_escape(header: str) -> str: ...

View File

@@ -0,0 +1,28 @@
from _typeshed import Self
from re import Pattern
class Version:
def __init__(self, vstring: str | None = ...) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __lt__(self: Self, other: Self | str) -> bool: ...
def __le__(self: Self, other: Self | str) -> bool: ...
def __gt__(self: Self, other: Self | str) -> bool: ...
def __ge__(self: Self, other: Self | str) -> bool: ...
class StrictVersion(Version):
version_re: Pattern[str]
version: tuple[int, int, int]
prerelease: tuple[str, int] | None
def __init__(self, vstring: str | None = ...) -> None: ...
def parse(self: Self, vstring: str) -> Self: ...
def __str__(self) -> str: ... # noqa: Y029
def _cmp(self: Self, other: Self | str) -> bool: ...
class LooseVersion(Version):
component_re: Pattern[str]
vstring: str
version: tuple[str | int, ...]
def __init__(self, vstring: str | None = ...) -> None: ...
def parse(self: Self, vstring: str) -> Self: ...
def __str__(self) -> str: ... # noqa: Y029
def _cmp(self: Self, other: Self | str) -> bool: ...

View File

@@ -1,19 +1,19 @@
from _typeshed import Incomplete
from distutils.core import Distribution as _Distribution
from typing import Any
from setuptools import SetuptoolsDeprecationWarning
class Distribution(_Distribution):
def patch_missing_pkg_info(self, attrs) -> None: ...
package_data: Any
dist_files: Any
src_root: Any
dependency_links: Any
setup_requires: Any
def __init__(self, attrs: Any | None = ...) -> None: ...
package_data: Incomplete
dist_files: Incomplete
src_root: Incomplete
dependency_links: Incomplete
setup_requires: Incomplete
def __init__(self, attrs: Incomplete | None = ...) -> None: ...
def warn_dash_deprecation(self, opt, section): ...
def make_option_lowercase(self, opt, section): ...
def parse_config_files(self, filenames: Any | None = ..., ignore_option_errors: bool = ...) -> None: ...
def parse_config_files(self, filenames: Incomplete | None = ..., ignore_option_errors: bool = ...) -> None: ...
def fetch_build_eggs(self, requires): ...
def finalize_options(self): ...
def get_egg_cache_dir(self): ...
@@ -22,9 +22,9 @@ class Distribution(_Distribution):
def print_commands(self): ...
def get_command_list(self): ...
def include(self, **attrs) -> None: ...
packages: Any
py_modules: Any
ext_modules: Any
packages: Incomplete
py_modules: Incomplete
ext_modules: Incomplete
def exclude_package(self, package) -> None: ...
def has_contents_for(self, package): ...
def exclude(self, **attrs) -> None: ...