diff --git a/stubs/setuptools/@tests/stubtest_allowlist.txt b/stubs/setuptools/@tests/stubtest_allowlist.txt index fdcdd0a54fe0..d0cac99ae01e 100644 --- a/stubs/setuptools/@tests/stubtest_allowlist.txt +++ b/stubs/setuptools/@tests/stubtest_allowlist.txt @@ -23,13 +23,19 @@ pkg_resources.declare_namespace pkg_resources.fixup_namespace_packages pkg_resources.get_entry_map pkg_resources.get_provider -pkg_resources.py31compat pkg_resources.split_sections pkg_resources.to_filename -# Only present if docutils is installed -setuptools._distutils.command.check.SilentReporter +# Uncomment once ignore_missing_stub is turned off +# # Not supported by typeshed +# setuptools.py34compat -# Discrepancy in the value of the default -# between setuptools's version of distutils and the stdlib distutils -setuptools._distutils.core.Command.announce +# # Private modules +# setuptools.config._validate_pyproject.* +# setuptools.build_meta._BuildMetaBackend.* + +# # Vendored and modified version of stdlib's distutils. Basically implementation details +# setuptools._distutils.* +# # Other vendored code +# setuptools._vendor.* +# pkg_resources._vendor.* diff --git a/stubs/setuptools/METADATA.toml b/stubs/setuptools/METADATA.toml index f698ef877fd1..920cfb1db489 100644 --- a/stubs/setuptools/METADATA.toml +++ b/stubs/setuptools/METADATA.toml @@ -1,5 +1,4 @@ version = "67.4.*" -requires = ["types-docutils"] [tool.stubtest] ignore_missing_stub = true diff --git a/stubs/setuptools/pkg_resources/py31compat.pyi b/stubs/setuptools/pkg_resources/py31compat.pyi deleted file mode 100644 index 162da65e0e67..000000000000 --- a/stubs/setuptools/pkg_resources/py31compat.pyi +++ /dev/null @@ -1,5 +0,0 @@ -import os - -needs_makedirs: bool - -makedirs = os.makedirs diff --git a/stubs/setuptools/setuptools/__init__.pyi b/stubs/setuptools/setuptools/__init__.pyi index 7b3d04890f65..3111dd68069d 100644 --- a/stubs/setuptools/setuptools/__init__.pyi +++ b/stubs/setuptools/setuptools/__init__.pyi @@ -1,6 +1,5 @@ from abc import abstractmethod from collections.abc import Iterable, Mapping, Sequence -from distutils.core import Command as _Command from typing import Any from setuptools._deprecation_warning import SetuptoolsDeprecationWarning as SetuptoolsDeprecationWarning @@ -8,6 +7,8 @@ from setuptools.depends import Require as Require from setuptools.dist import Distribution as Distribution from setuptools.extension import Extension as Extension +from ._distutils.cmd import Command as _Command + __version__: str class PackageFinder: diff --git a/stubs/setuptools/setuptools/_distutils/__init__.pyi b/stubs/setuptools/setuptools/_distutils/__init__.pyi deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/stubs/setuptools/setuptools/_distutils/archive_util.pyi b/stubs/setuptools/setuptools/_distutils/archive_util.pyi deleted file mode 100644 index 38458fc0e003..000000000000 --- a/stubs/setuptools/setuptools/_distutils/archive_util.pyi +++ /dev/null @@ -1,20 +0,0 @@ -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: ... diff --git a/stubs/setuptools/setuptools/_distutils/bcppcompiler.pyi b/stubs/setuptools/setuptools/_distutils/bcppcompiler.pyi deleted file mode 100644 index 3e432f94b525..000000000000 --- a/stubs/setuptools/setuptools/_distutils/bcppcompiler.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from distutils.ccompiler import CCompiler - -class BCPPCompiler(CCompiler): ... diff --git a/stubs/setuptools/setuptools/_distutils/ccompiler.pyi b/stubs/setuptools/setuptools/_distutils/ccompiler.pyi deleted file mode 100644 index 96a756bb2cf8..000000000000 --- a/stubs/setuptools/setuptools/_distutils/ccompiler.pyi +++ /dev/null @@ -1,152 +0,0 @@ -from collections.abc import Callable -from typing import Any -from typing_extensions import TypeAlias - -_Macro: TypeAlias = 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: ... diff --git a/stubs/setuptools/setuptools/_distutils/cmd.pyi b/stubs/setuptools/setuptools/_distutils/cmd.pyi index e706bdbc5802..f319d699b673 100644 --- a/stubs/setuptools/setuptools/_distutils/cmd.pyi +++ b/stubs/setuptools/setuptools/_distutils/cmd.pyi @@ -1,10 +1,13 @@ +from _typeshed import Incomplete from abc import abstractmethod from collections.abc import Callable, Iterable -from distutils.dist import Distribution -from typing import Any +from typing import ClassVar +from typing_extensions import Self + +from .dist import Distribution class Command: - sub_commands: list[tuple[str, Callable[[Command], bool] | None]] + sub_commands: ClassVar[list[tuple[str, Callable[[Self], bool] | None]]] def __init__(self, dist: Distribution) -> None: ... @abstractmethod def initialize_options(self) -> None: ... @@ -25,7 +28,9 @@ class 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 execute( + self, func: Callable[..., object], args: Iterable[Incomplete], msg: str | None = ..., level: int = ... + ) -> None: ... def mkpath(self, name: str, mode: int = ...) -> None: ... def copy_file( self, @@ -34,7 +39,7 @@ class Command: preserve_mode: int = ..., preserve_times: int = ..., link: str | None = ..., - level: Any = ..., + level: int = ..., ) -> tuple[str, bool]: ... # level is not used def copy_tree( self, @@ -43,10 +48,10 @@ class Command: preserve_mode: int = ..., preserve_times: int = ..., preserve_symlinks: int = ..., - level: Any = ..., + level: int = ..., ) -> 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 move_file(self, src: str, dst: str, level: int = ...) -> str: ... # level is not used + def spawn(self, cmd: Iterable[str], search_path: int = ..., level: int = ...) -> None: ... # level is not used def make_archive( self, base_name: str, @@ -61,8 +66,8 @@ class Command: infiles: str | list[str] | tuple[str, ...], outfile: str, func: Callable[..., object], - args: list[Any], + args: list[Incomplete], exec_msg: str | None = ..., skip_msg: str | None = ..., - level: Any = ..., + level: int = ..., ) -> None: ... # level is not used diff --git a/stubs/setuptools/setuptools/_distutils/command/__init__.pyi b/stubs/setuptools/setuptools/_distutils/command/__init__.pyi deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/stubs/setuptools/setuptools/_distutils/command/bdist.pyi b/stubs/setuptools/setuptools/_distutils/command/bdist.pyi deleted file mode 100644 index e1f141d3a40f..000000000000 --- a/stubs/setuptools/setuptools/_distutils/command/bdist.pyi +++ /dev/null @@ -1,25 +0,0 @@ -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: ... diff --git a/stubs/setuptools/setuptools/_distutils/command/bdist_dumb.pyi b/stubs/setuptools/setuptools/_distutils/command/bdist_dumb.pyi deleted file mode 100644 index 74cca4d13cd0..000000000000 --- a/stubs/setuptools/setuptools/_distutils/command/bdist_dumb.pyi +++ /dev/null @@ -1,21 +0,0 @@ -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: ... diff --git a/stubs/setuptools/setuptools/_distutils/command/bdist_rpm.pyi b/stubs/setuptools/setuptools/_distutils/command/bdist_rpm.pyi deleted file mode 100644 index 76691310b599..000000000000 --- a/stubs/setuptools/setuptools/_distutils/command/bdist_rpm.pyi +++ /dev/null @@ -1,52 +0,0 @@ -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: ... diff --git a/stubs/setuptools/setuptools/_distutils/command/build.pyi b/stubs/setuptools/setuptools/_distutils/command/build.pyi deleted file mode 100644 index cf3c8a562ff3..000000000000 --- a/stubs/setuptools/setuptools/_distutils/command/build.pyi +++ /dev/null @@ -1,31 +0,0 @@ -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 diff --git a/stubs/setuptools/setuptools/_distutils/command/build_clib.pyi b/stubs/setuptools/setuptools/_distutils/command/build_clib.pyi index 32ab182b30d0..5a9b049ad429 100644 --- a/stubs/setuptools/setuptools/_distutils/command/build_clib.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/build_clib.pyi @@ -1,23 +1,21 @@ -from typing import Any +from _typeshed import Incomplete 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 + user_options: Incomplete + boolean_options: Incomplete + help_options: Incomplete + build_clib: Incomplete + build_temp: Incomplete + libraries: Incomplete + include_dirs: Incomplete + define: Incomplete + undef: Incomplete + debug: Incomplete force: int - compiler: Any + compiler: Incomplete def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... def run(self) -> None: ... diff --git a/stubs/setuptools/setuptools/_distutils/command/build_ext.pyi b/stubs/setuptools/setuptools/_distutils/command/build_ext.pyi index 80cd78936cb9..bdb3cefeb8ef 100644 --- a/stubs/setuptools/setuptools/_distutils/command/build_ext.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/build_ext.pyi @@ -1,38 +1,34 @@ -from typing import Any +from _typeshed import Incomplete 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 + sep_by: Incomplete + user_options: Incomplete + boolean_options: Incomplete + help_options: Incomplete + extensions: Incomplete + build_lib: Incomplete + plat_name: Incomplete + build_temp: Incomplete 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 + package: Incomplete + include_dirs: Incomplete + define: Incomplete + undef: Incomplete + libraries: Incomplete + library_dirs: Incomplete + rpath: Incomplete + link_objects: Incomplete + debug: Incomplete + force: Incomplete + compiler: Incomplete + swig: Incomplete + swig_cpp: Incomplete + swig_opts: Incomplete + user: Incomplete + parallel: Incomplete def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... def run(self) -> None: ... diff --git a/stubs/setuptools/setuptools/_distutils/command/build_py.pyi b/stubs/setuptools/setuptools/_distutils/command/build_py.pyi index f4803e30ef7f..b5bada6338fb 100644 --- a/stubs/setuptools/setuptools/_distutils/command/build_py.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/build_py.pyi @@ -1,23 +1,23 @@ -from typing import Any +from _typeshed import Incomplete 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 + user_options: Incomplete + boolean_options: Incomplete + negative_opt: Incomplete + build_lib: Incomplete + py_modules: Incomplete + package: Incomplete + package_data: Incomplete + package_dir: Incomplete compile: int optimize: int - force: Any + force: Incomplete def initialize_options(self) -> None: ... - packages: Any - data_files: Any + packages: Incomplete + data_files: Incomplete def finalize_options(self) -> None: ... def run(self) -> None: ... def get_data_files(self): ... diff --git a/stubs/setuptools/setuptools/_distutils/command/build_scripts.pyi b/stubs/setuptools/setuptools/_distutils/command/build_scripts.pyi deleted file mode 100644 index 9ce9d7b85fe3..000000000000 --- a/stubs/setuptools/setuptools/_distutils/command/build_scripts.pyi +++ /dev/null @@ -1,21 +0,0 @@ -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): ... diff --git a/stubs/setuptools/setuptools/_distutils/command/check.pyi b/stubs/setuptools/setuptools/_distutils/command/check.pyi deleted file mode 100644 index e788e6e5ad12..000000000000 --- a/stubs/setuptools/setuptools/_distutils/command/check.pyi +++ /dev/null @@ -1,35 +0,0 @@ -from _typeshed import Incomplete -from typing import Any - -import docutils.utils - -from ..cmd import Command - -# Only defined if docutils is installed. -class SilentReporter(docutils.utils.Reporter): - messages: Any - def __init__( - self, - source, - report_level, - halt_level, - stream: Incomplete | None = ..., - debug: int = ..., - encoding: str = ..., - error_handler: str = ..., - ) -> None: ... - def system_message(self, level, message, *children, **kwargs): ... - -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: ... diff --git a/stubs/setuptools/setuptools/_distutils/command/clean.pyi b/stubs/setuptools/setuptools/_distutils/command/clean.pyi deleted file mode 100644 index 99560aa8a716..000000000000 --- a/stubs/setuptools/setuptools/_distutils/command/clean.pyi +++ /dev/null @@ -1,17 +0,0 @@ -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: ... diff --git a/stubs/setuptools/setuptools/_distutils/command/config.pyi b/stubs/setuptools/setuptools/_distutils/command/config.pyi deleted file mode 100644 index 8dffeefdd0d0..000000000000 --- a/stubs/setuptools/setuptools/_distutils/command/config.pyi +++ /dev/null @@ -1,83 +0,0 @@ -from _typeshed import Incomplete -from collections.abc import Sequence -from re import Pattern - -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: Incomplete | None = ...) -> None: ... diff --git a/stubs/setuptools/setuptools/_distutils/command/install.pyi b/stubs/setuptools/setuptools/_distutils/command/install.pyi index 661d256e6f07..44f557e58314 100644 --- a/stubs/setuptools/setuptools/_distutils/command/install.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/install.pyi @@ -1,44 +1,40 @@ -from typing import Any +from _typeshed import Incomplete 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 + user_options: Incomplete + boolean_options: Incomplete + negative_opt: Incomplete prefix: str | None - exec_prefix: Any + exec_prefix: Incomplete home: str | None user: bool - install_base: Any - install_platbase: Any + install_base: Incomplete + install_platbase: Incomplete root: str | None - install_purelib: Any - install_platlib: Any - install_headers: Any + install_purelib: Incomplete + install_platlib: Incomplete + install_headers: Incomplete install_lib: str | None - install_scripts: Any - install_data: Any - install_userbase: Any - install_usersite: Any - compile: Any - optimize: Any - extra_path: Any + install_scripts: Incomplete + install_data: Incomplete + install_userbase: Incomplete + install_usersite: Incomplete + compile: Incomplete + optimize: Incomplete + extra_path: Incomplete install_path_file: int force: int skip_build: int warn_dir: int - build_base: Any - build_lib: Any - record: Any + build_base: Incomplete + build_lib: Incomplete + record: Incomplete def initialize_options(self) -> None: ... - config_vars: Any - install_libbase: Any + config_vars: Incomplete + install_libbase: Incomplete def finalize_options(self) -> None: ... def dump_dirs(self, msg) -> None: ... def finalize_unix(self) -> None: ... @@ -47,8 +43,8 @@ class install(Command): def expand_basedirs(self) -> None: ... def expand_dirs(self) -> None: ... def convert_paths(self, *names) -> None: ... - path_file: Any - extra_dirs: Any + path_file: Incomplete + extra_dirs: Incomplete def handle_extra_path(self) -> None: ... def change_roots(self, *names) -> None: ... def create_home_path(self) -> None: ... @@ -60,4 +56,3 @@ class install(Command): def has_headers(self): ... def has_scripts(self): ... def has_data(self): ... - sub_commands: Any diff --git a/stubs/setuptools/setuptools/_distutils/command/install_data.pyi b/stubs/setuptools/setuptools/_distutils/command/install_data.pyi deleted file mode 100644 index 6cc9b528ac9d..000000000000 --- a/stubs/setuptools/setuptools/_distutils/command/install_data.pyi +++ /dev/null @@ -1,19 +0,0 @@ -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): ... diff --git a/stubs/setuptools/setuptools/_distutils/command/install_egg_info.pyi b/stubs/setuptools/setuptools/_distutils/command/install_egg_info.pyi deleted file mode 100644 index 776eafc1de09..000000000000 --- a/stubs/setuptools/setuptools/_distutils/command/install_egg_info.pyi +++ /dev/null @@ -1,18 +0,0 @@ -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): ... diff --git a/stubs/setuptools/setuptools/_distutils/command/install_headers.pyi b/stubs/setuptools/setuptools/_distutils/command/install_headers.pyi deleted file mode 100644 index 795bd1cf8356..000000000000 --- a/stubs/setuptools/setuptools/_distutils/command/install_headers.pyi +++ /dev/null @@ -1,16 +0,0 @@ -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): ... diff --git a/stubs/setuptools/setuptools/_distutils/command/install_lib.pyi b/stubs/setuptools/setuptools/_distutils/command/install_lib.pyi index a6a5e4e73f4c..dee5fbdf6c16 100644 --- a/stubs/setuptools/setuptools/_distutils/command/install_lib.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/install_lib.pyi @@ -1,20 +1,18 @@ -from typing import Any +from _typeshed import Incomplete 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 + user_options: Incomplete + boolean_options: Incomplete + negative_opt: Incomplete + install_dir: Incomplete + build_dir: Incomplete force: int - compile: Any - optimize: Any - skip_build: Any + compile: Incomplete + optimize: Incomplete + skip_build: Incomplete def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... def run(self) -> None: ... diff --git a/stubs/setuptools/setuptools/_distutils/command/install_scripts.pyi b/stubs/setuptools/setuptools/_distutils/command/install_scripts.pyi index 92728a16a747..f57fcf8903a6 100644 --- a/stubs/setuptools/setuptools/_distutils/command/install_scripts.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/install_scripts.pyi @@ -1,18 +1,18 @@ -from typing import Any +from _typeshed import Incomplete from ..cmd import Command class install_scripts(Command): description: str - user_options: Any - boolean_options: Any - install_dir: Any + user_options: Incomplete + boolean_options: Incomplete + install_dir: Incomplete force: int - build_dir: Any - skip_build: Any + build_dir: Incomplete + skip_build: Incomplete def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... - outfiles: Any + outfiles: Incomplete def run(self) -> None: ... def get_inputs(self): ... def get_outputs(self): ... diff --git a/stubs/setuptools/setuptools/_distutils/command/py37compat.pyi b/stubs/setuptools/setuptools/_distutils/command/py37compat.pyi deleted file mode 100644 index 9d921db3d55f..000000000000 --- a/stubs/setuptools/setuptools/_distutils/command/py37compat.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from _typeshed import Incomplete - -def compose(f1, f2): ... - -pythonlib: Incomplete diff --git a/stubs/setuptools/setuptools/_distutils/command/register.pyi b/stubs/setuptools/setuptools/_distutils/command/register.pyi index f19dfcbf01df..891d6a2a5688 100644 --- a/stubs/setuptools/setuptools/_distutils/command/register.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/register.pyi @@ -1,11 +1,9 @@ from _typeshed import Incomplete -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: ... diff --git a/stubs/setuptools/setuptools/_distutils/command/sdist.pyi b/stubs/setuptools/setuptools/_distutils/command/sdist.pyi index 636c4a351d19..b724561ef153 100644 --- a/stubs/setuptools/setuptools/_distutils/command/sdist.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/sdist.pyi @@ -1,34 +1,31 @@ -from typing import Any +from _typeshed import Incomplete 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 + user_options: Incomplete + boolean_options: Incomplete + help_options: Incomplete + negative_opt: Incomplete + READMES: Incomplete + template: Incomplete + manifest: Incomplete use_defaults: int prune: int manifest_only: int force_manifest: int - formats: Any + formats: Incomplete keep_temp: int - dist_dir: Any - archive_files: Any + dist_dir: Incomplete + archive_files: Incomplete metadata_check: int - owner: Any - group: Any + owner: Incomplete + group: Incomplete def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... - filelist: Any + filelist: Incomplete def run(self) -> None: ... def check_metadata(self) -> None: ... def get_file_list(self) -> None: ... diff --git a/stubs/setuptools/setuptools/_distutils/command/upload.pyi b/stubs/setuptools/setuptools/_distutils/command/upload.pyi index e6b77825c5f5..afcfbaf48677 100644 --- a/stubs/setuptools/setuptools/_distutils/command/upload.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/upload.pyi @@ -1,4 +1,5 @@ -from typing import Any, ClassVar +from _typeshed import Incomplete +from typing import ClassVar from ..config import PyPIRCCommand @@ -8,10 +9,10 @@ class upload(PyPIRCCommand): password: str show_response: int sign: bool - identity: Any + identity: Incomplete def initialize_options(self) -> None: ... - repository: Any - realm: Any + repository: Incomplete + realm: Incomplete def finalize_options(self) -> None: ... def run(self) -> None: ... def upload_file(self, command: str, pyversion: str, filename: str) -> None: ... diff --git a/stubs/setuptools/setuptools/_distutils/config.pyi b/stubs/setuptools/setuptools/_distutils/config.pyi index 5814a82841cc..4dfa5e97fa35 100644 --- a/stubs/setuptools/setuptools/_distutils/config.pyi +++ b/stubs/setuptools/setuptools/_distutils/config.pyi @@ -1,8 +1,7 @@ from abc import abstractmethod -from distutils.cmd import Command from typing import ClassVar -DEFAULT_PYPIRC: str +from .cmd import Command class PyPIRCCommand(Command): DEFAULT_REPOSITORY: ClassVar[str] diff --git a/stubs/setuptools/setuptools/_distutils/core.pyi b/stubs/setuptools/setuptools/_distutils/core.pyi deleted file mode 100644 index 07334edc174f..000000000000 --- a/stubs/setuptools/setuptools/_distutils/core.pyi +++ /dev/null @@ -1,49 +0,0 @@ -from collections.abc import Mapping, Sequence -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: Sequence[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: ... diff --git a/stubs/setuptools/setuptools/_distutils/cygwinccompiler.pyi b/stubs/setuptools/setuptools/_distutils/cygwinccompiler.pyi deleted file mode 100644 index 1f85b254860b..000000000000 --- a/stubs/setuptools/setuptools/_distutils/cygwinccompiler.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from distutils.unixccompiler import UnixCCompiler - -class CygwinCCompiler(UnixCCompiler): ... -class Mingw32CCompiler(CygwinCCompiler): ... diff --git a/stubs/setuptools/setuptools/_distutils/debug.pyi b/stubs/setuptools/setuptools/_distutils/debug.pyi deleted file mode 100644 index 11f28a8bc8ae..000000000000 --- a/stubs/setuptools/setuptools/_distutils/debug.pyi +++ /dev/null @@ -1 +0,0 @@ -DEBUG: bool | None diff --git a/stubs/setuptools/setuptools/_distutils/dep_util.pyi b/stubs/setuptools/setuptools/_distutils/dep_util.pyi deleted file mode 100644 index 929d6ffd0c81..000000000000 --- a/stubs/setuptools/setuptools/_distutils/dep_util.pyi +++ /dev/null @@ -1,3 +0,0 @@ -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/stubs/setuptools/setuptools/_distutils/dir_util.pyi b/stubs/setuptools/setuptools/_distutils/dir_util.pyi deleted file mode 100644 index ffe5ff1cfbd4..000000000000 --- a/stubs/setuptools/setuptools/_distutils/dir_util.pyi +++ /dev/null @@ -1,13 +0,0 @@ -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/stubs/setuptools/setuptools/_distutils/dist.pyi b/stubs/setuptools/setuptools/_distutils/dist.pyi index fc1bce261e57..60365abc6a4a 100644 --- a/stubs/setuptools/setuptools/_distutils/dist.pyi +++ b/stubs/setuptools/setuptools/_distutils/dist.pyi @@ -1,7 +1,8 @@ -from _typeshed import FileDescriptorOrPath, SupportsWrite +from _typeshed import FileDescriptorOrPath, Incomplete, SupportsWrite from collections.abc import Iterable, Mapping -from distutils.cmd import Command -from typing import IO, Any +from typing import IO + +from .cmd import Command class DistributionMetadata: def __init__(self, path: FileDescriptorOrPath | None = ...) -> None: ... @@ -53,7 +54,7 @@ class DistributionMetadata: class Distribution: cmdclass: dict[str, type[Command]] metadata: DistributionMetadata - def __init__(self, attrs: Mapping[str, Any] | None = ...) -> None: ... + def __init__(self, attrs: Mapping[str, Incomplete] | 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: ... diff --git a/stubs/setuptools/setuptools/_distutils/errors.pyi b/stubs/setuptools/setuptools/_distutils/errors.pyi index e483362bfbf1..d19ac8b04eaa 100644 --- a/stubs/setuptools/setuptools/_distutils/errors.pyi +++ b/stubs/setuptools/setuptools/_distutils/errors.pyi @@ -1,19 +1 @@ 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): ... diff --git a/stubs/setuptools/setuptools/_distutils/fancy_getopt.pyi b/stubs/setuptools/setuptools/_distutils/fancy_getopt.pyi deleted file mode 100644 index 6a7124bd15ad..000000000000 --- a/stubs/setuptools/setuptools/_distutils/fancy_getopt.pyi +++ /dev/null @@ -1,24 +0,0 @@ -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: ... diff --git a/stubs/setuptools/setuptools/_distutils/file_util.pyi b/stubs/setuptools/setuptools/_distutils/file_util.pyi deleted file mode 100644 index b3127841bce8..000000000000 --- a/stubs/setuptools/setuptools/_distutils/file_util.pyi +++ /dev/null @@ -1,14 +0,0 @@ -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: ... diff --git a/stubs/setuptools/setuptools/_distutils/filelist.pyi b/stubs/setuptools/setuptools/_distutils/filelist.pyi index 1cfdcf08dca9..d242be1c3e58 100644 --- a/stubs/setuptools/setuptools/_distutils/filelist.pyi +++ b/stubs/setuptools/setuptools/_distutils/filelist.pyi @@ -36,16 +36,3 @@ class FileList: 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]: ... diff --git a/stubs/setuptools/setuptools/_distutils/log.pyi b/stubs/setuptools/setuptools/_distutils/log.pyi deleted file mode 100644 index 7f4020b3eb2d..000000000000 --- a/stubs/setuptools/setuptools/_distutils/log.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from typing import Any - -DEBUG: int -INFO: int -WARN: int -ERROR: int -FATAL: int - -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: ... diff --git a/stubs/setuptools/setuptools/_distutils/msvccompiler.pyi b/stubs/setuptools/setuptools/_distutils/msvccompiler.pyi deleted file mode 100644 index 80872a6b739f..000000000000 --- a/stubs/setuptools/setuptools/_distutils/msvccompiler.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from distutils.ccompiler import CCompiler - -class MSVCCompiler(CCompiler): ... diff --git a/stubs/setuptools/setuptools/_distutils/spawn.pyi b/stubs/setuptools/setuptools/_distutils/spawn.pyi deleted file mode 100644 index 2dc07dcd537e..000000000000 --- a/stubs/setuptools/setuptools/_distutils/spawn.pyi +++ /dev/null @@ -1,6 +0,0 @@ -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: ... diff --git a/stubs/setuptools/setuptools/_distutils/sysconfig.pyi b/stubs/setuptools/setuptools/_distutils/sysconfig.pyi deleted file mode 100644 index bf7db9c8f06b..000000000000 --- a/stubs/setuptools/setuptools/_distutils/sysconfig.pyi +++ /dev/null @@ -1,13 +0,0 @@ -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: ... diff --git a/stubs/setuptools/setuptools/_distutils/text_file.pyi b/stubs/setuptools/setuptools/_distutils/text_file.pyi deleted file mode 100644 index ace642e027cf..000000000000 --- a/stubs/setuptools/setuptools/_distutils/text_file.pyi +++ /dev/null @@ -1,21 +0,0 @@ -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: ... diff --git a/stubs/setuptools/setuptools/_distutils/unixccompiler.pyi b/stubs/setuptools/setuptools/_distutils/unixccompiler.pyi deleted file mode 100644 index e1d443471af3..000000000000 --- a/stubs/setuptools/setuptools/_distutils/unixccompiler.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from distutils.ccompiler import CCompiler - -class UnixCCompiler(CCompiler): ... diff --git a/stubs/setuptools/setuptools/_distutils/util.pyi b/stubs/setuptools/setuptools/_distutils/util.pyi deleted file mode 100644 index 6790712ffe25..000000000000 --- a/stubs/setuptools/setuptools/_distutils/util.pyi +++ /dev/null @@ -1,30 +0,0 @@ -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: ... diff --git a/stubs/setuptools/setuptools/_distutils/version.pyi b/stubs/setuptools/setuptools/_distutils/version.pyi deleted file mode 100644 index b6662d04f02f..000000000000 --- a/stubs/setuptools/setuptools/_distutils/version.pyi +++ /dev/null @@ -1,26 +0,0 @@ -from re import Pattern -from typing_extensions import Self - -class Version: - def __init__(self, vstring: str | None = ...) -> None: ... - def __eq__(self, other: object) -> bool: ... - def __lt__(self, other: Self | str) -> bool: ... - def __le__(self, other: Self | str) -> bool: ... - def __gt__(self, other: Self | str) -> bool: ... - def __ge__(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, vstring: str) -> Self: ... - def _cmp(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, vstring: str) -> Self: ... - def _cmp(self, other: Self | str) -> bool: ... diff --git a/stubs/setuptools/setuptools/archive_util.pyi b/stubs/setuptools/setuptools/archive_util.pyi index 86bb21a7fe3d..b550a6164396 100644 --- a/stubs/setuptools/setuptools/archive_util.pyi +++ b/stubs/setuptools/setuptools/archive_util.pyi @@ -1,7 +1,8 @@ from _typeshed import Incomplete -from distutils.errors import DistutilsError from typing import Any +from ._distutils.errors import DistutilsError + class UnrecognizedFormat(DistutilsError): ... def default_filter(src, dst): ... diff --git a/stubs/setuptools/setuptools/command/bdist_egg.pyi b/stubs/setuptools/setuptools/command/bdist_egg.pyi deleted file mode 100644 index fca2f7579a8a..000000000000 --- a/stubs/setuptools/setuptools/command/bdist_egg.pyi +++ /dev/null @@ -1,48 +0,0 @@ -from typing import Any - -from setuptools import Command - -def strip_module(filename): ... -def sorted_walk(dir) -> None: ... -def write_stub(resource, pyfile) -> None: ... - -class bdist_egg(Command): - description: str - user_options: Any - boolean_options: Any - bdist_dir: Any - plat_name: Any - keep_temp: int - dist_dir: Any - skip_build: int - egg_output: Any - exclude_source_files: Any - def initialize_options(self) -> None: ... - egg_info: Any - def finalize_options(self) -> None: ... - def do_install_data(self) -> None: ... - def get_outputs(self): ... - def call_command(self, cmdname, **kw): ... - stubs: Any - def run(self) -> None: ... - def zap_pyfiles(self) -> None: ... - def zip_safe(self): ... - def gen_header(self): ... - def copy_metadata_to(self, target_dir) -> None: ... - def get_ext_outputs(self): ... - -NATIVE_EXTENSIONS: Any - -def walk_egg(egg_dir) -> None: ... -def analyze_egg(egg_dir, stubs): ... -def write_safety_flag(egg_dir, safe) -> None: ... - -safety_flags: Any - -def scan_module(egg_dir, base, name, stubs): ... -def iter_symbols(code) -> None: ... -def can_scan(): ... - -INSTALL_DIRECTORY_ATTRS: Any - -def make_zipfile(zip_filename, base_dir, verbose: int = ..., dry_run: int = ..., compress: bool = ..., mode: str = ...): ... diff --git a/stubs/setuptools/setuptools/command/bdist_rpm.pyi b/stubs/setuptools/setuptools/command/bdist_rpm.pyi deleted file mode 100644 index 4942eafe98e8..000000000000 --- a/stubs/setuptools/setuptools/command/bdist_rpm.pyi +++ /dev/null @@ -1,4 +0,0 @@ -import distutils.command.bdist_rpm as orig - -class bdist_rpm(orig.bdist_rpm): - def run(self) -> None: ... diff --git a/stubs/setuptools/setuptools/command/build_clib.pyi b/stubs/setuptools/setuptools/command/build_clib.pyi index c088f7d790c3..a8fe07c51b73 100644 --- a/stubs/setuptools/setuptools/command/build_clib.pyi +++ b/stubs/setuptools/setuptools/command/build_clib.pyi @@ -1,4 +1,4 @@ -import distutils.command.build_clib as orig +from .._distutils.command import build_clib as orig class build_clib(orig.build_clib): def build_libraries(self, libraries) -> None: ... diff --git a/stubs/setuptools/setuptools/command/build_ext.pyi b/stubs/setuptools/setuptools/command/build_ext.pyi index b3475d897022..507718c27004 100644 --- a/stubs/setuptools/setuptools/command/build_ext.pyi +++ b/stubs/setuptools/setuptools/command/build_ext.pyi @@ -1,7 +1,8 @@ from _typeshed import Incomplete -from distutils.command.build_ext import build_ext as _build_ext from typing import Any +from .._distutils.command.build_ext import build_ext as _build_ext + have_rtld: bool use_stubs: bool libtype: str diff --git a/stubs/setuptools/setuptools/command/build_py.pyi b/stubs/setuptools/setuptools/command/build_py.pyi index 927206eb4db8..0e2fc54abfd2 100644 --- a/stubs/setuptools/setuptools/command/build_py.pyi +++ b/stubs/setuptools/setuptools/command/build_py.pyi @@ -1,6 +1,7 @@ -import distutils.command.build_py as orig from typing import Any +from .._distutils.command import build_py as orig + def make_writable(target) -> None: ... class build_py(orig.build_py): diff --git a/stubs/setuptools/setuptools/command/dist_info.pyi b/stubs/setuptools/setuptools/command/dist_info.pyi index aa9d3f40911d..d2501e80be41 100644 --- a/stubs/setuptools/setuptools/command/dist_info.pyi +++ b/stubs/setuptools/setuptools/command/dist_info.pyi @@ -1,6 +1,7 @@ -from distutils.core import Command from typing import Any +from .._distutils.cmd import Command + class dist_info(Command): description: str user_options: Any diff --git a/stubs/setuptools/setuptools/command/egg_info.pyi b/stubs/setuptools/setuptools/command/egg_info.pyi index 4d01d62c5ab7..931911f07149 100644 --- a/stubs/setuptools/setuptools/command/egg_info.pyi +++ b/stubs/setuptools/setuptools/command/egg_info.pyi @@ -1,9 +1,10 @@ -from distutils.filelist import FileList as _FileList from typing import Any from setuptools import Command, SetuptoolsDeprecationWarning from setuptools.command.sdist import sdist +from .._distutils.filelist import FileList as _FileList + def translate_pattern(glob): ... class InfoCommon: diff --git a/stubs/setuptools/setuptools/command/install.pyi b/stubs/setuptools/setuptools/command/install.pyi index 50594f2d3102..aa2aabf730c7 100644 --- a/stubs/setuptools/setuptools/command/install.pyi +++ b/stubs/setuptools/setuptools/command/install.pyi @@ -1,6 +1,7 @@ -import distutils.command.install as orig from typing import Any +from .._distutils.command import install as orig + class install(orig.install): user_options: Any boolean_options: Any diff --git a/stubs/setuptools/setuptools/command/install_lib.pyi b/stubs/setuptools/setuptools/command/install_lib.pyi index cd76c475216d..7cd28d8f1343 100644 --- a/stubs/setuptools/setuptools/command/install_lib.pyi +++ b/stubs/setuptools/setuptools/command/install_lib.pyi @@ -1,4 +1,4 @@ -import distutils.command.install_lib as orig +from .._distutils.command import install_lib as orig class install_lib(orig.install_lib): def run(self) -> None: ... diff --git a/stubs/setuptools/setuptools/command/install_scripts.pyi b/stubs/setuptools/setuptools/command/install_scripts.pyi index 354faa7f04a2..3dc4c1a1fb80 100644 --- a/stubs/setuptools/setuptools/command/install_scripts.pyi +++ b/stubs/setuptools/setuptools/command/install_scripts.pyi @@ -1,6 +1,7 @@ -import distutils.command.install_scripts as orig from typing import Any +from .._distutils.command import install_scripts as orig + class install_scripts(orig.install_scripts): no_ep: bool def initialize_options(self) -> None: ... diff --git a/stubs/setuptools/setuptools/command/py36compat.pyi b/stubs/setuptools/setuptools/command/py36compat.pyi deleted file mode 100644 index eac937030d12..000000000000 --- a/stubs/setuptools/setuptools/command/py36compat.pyi +++ /dev/null @@ -1 +0,0 @@ -class sdist_add_defaults: ... diff --git a/stubs/setuptools/setuptools/command/register.pyi b/stubs/setuptools/setuptools/command/register.pyi index 02c63f18e193..60a5f709483e 100644 --- a/stubs/setuptools/setuptools/command/register.pyi +++ b/stubs/setuptools/setuptools/command/register.pyi @@ -1,4 +1,4 @@ -import distutils.command.register as orig +from .._distutils.command import register as orig class register(orig.register): def run(self) -> None: ... diff --git a/stubs/setuptools/setuptools/command/sdist.pyi b/stubs/setuptools/setuptools/command/sdist.pyi index 0d150e7ee672..f544dbfc7cb8 100644 --- a/stubs/setuptools/setuptools/command/sdist.pyi +++ b/stubs/setuptools/setuptools/command/sdist.pyi @@ -1,11 +1,10 @@ -import distutils.command.sdist as orig from typing import Any -from .py36compat import sdist_add_defaults +from .._distutils.command import sdist as orig def walk_revctrl(dirname: str = ...) -> None: ... -class sdist(sdist_add_defaults, orig.sdist): +class sdist(orig.sdist): user_options: Any negative_opt: Any README_EXTENSIONS: Any diff --git a/stubs/setuptools/setuptools/command/upload.pyi b/stubs/setuptools/setuptools/command/upload.pyi index ea60d6e6b5ec..efffae3b72c0 100644 --- a/stubs/setuptools/setuptools/command/upload.pyi +++ b/stubs/setuptools/setuptools/command/upload.pyi @@ -1,4 +1,4 @@ -from distutils.command import upload as orig +from .._distutils.command import upload as orig class upload(orig.upload): def run(self) -> None: ... diff --git a/stubs/setuptools/setuptools/command/upload_docs.pyi b/stubs/setuptools/setuptools/command/upload_docs.pyi index 0660bff722dd..5f923d96ca66 100644 --- a/stubs/setuptools/setuptools/command/upload_docs.pyi +++ b/stubs/setuptools/setuptools/command/upload_docs.pyi @@ -1,4 +1,6 @@ +from collections.abc import Callable from typing import Any, ClassVar +from typing_extensions import Self from .upload import upload @@ -8,7 +10,8 @@ class upload_docs(upload): user_options: ClassVar[list[tuple[str, str | None, str]]] boolean_options: ClassVar[list[str]] def has_sphinx(self): ... - sub_commands: Any + # The callable parameter is self: Self, but using Self still trips up mypy + sub_commands: ClassVar[list[tuple[str, Callable[[Self], bool] | None]]] # type: ignore[misc, assignment] upload_dir: Any target_dir: Any def initialize_options(self) -> None: ... diff --git a/stubs/setuptools/setuptools/dist.pyi b/stubs/setuptools/setuptools/dist.pyi index b47795f820ea..0cd758671b96 100644 --- a/stubs/setuptools/setuptools/dist.pyi +++ b/stubs/setuptools/setuptools/dist.pyi @@ -1,8 +1,9 @@ from _typeshed import Incomplete -from distutils.core import Distribution as _Distribution from setuptools import SetuptoolsDeprecationWarning +from ._distutils.dist import Distribution as _Distribution + class Distribution(_Distribution): def patch_missing_pkg_info(self, attrs) -> None: ... package_data: Incomplete diff --git a/stubs/setuptools/setuptools/errors.pyi b/stubs/setuptools/setuptools/errors.pyi index 0791eeee9f47..2e31b89c8bf8 100644 --- a/stubs/setuptools/setuptools/errors.pyi +++ b/stubs/setuptools/setuptools/errors.pyi @@ -1,3 +1,3 @@ -from distutils.errors import DistutilsError +from ._distutils.errors import DistutilsError class RemovedCommandError(DistutilsError, RuntimeError): ... diff --git a/stubs/setuptools/setuptools/extension.pyi b/stubs/setuptools/setuptools/extension.pyi index ac7cf1c866b1..4895ad829a54 100644 --- a/stubs/setuptools/setuptools/extension.pyi +++ b/stubs/setuptools/setuptools/extension.pyi @@ -1,6 +1,7 @@ -from distutils.core import Extension as _Extension from typing import Any +from ._distutils.extension import Extension as _Extension + have_pyrex: Any class Extension(_Extension): diff --git a/stubs/setuptools/setuptools/sandbox.pyi b/stubs/setuptools/setuptools/sandbox.pyi index 790fe0464b9d..71fb7cf5cab6 100644 --- a/stubs/setuptools/setuptools/sandbox.pyi +++ b/stubs/setuptools/setuptools/sandbox.pyi @@ -1,8 +1,9 @@ -from distutils.errors import DistutilsError from types import TracebackType from typing import Any from typing_extensions import Literal +from ._distutils.errors import DistutilsError + class UnpickleableException(Exception): @staticmethod def dump(type, exc): ...