Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump setuptools to 76.0.0 #13614

Merged
merged 5 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions stubs/setuptools/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
setuptools.modified.newer_pairwise_group
setuptools._distutils._modified.newer_pairwise_group

# Runtime initializes to None, but this really should never be None when used
setuptools._distutils.compilers.C.base.Compiler.compiler_type

# Dynamically created in __init__
setuptools._distutils.dist.Distribution.get_name
setuptools._distutils.dist.Distribution.get_version
Expand All @@ -28,13 +31,6 @@ setuptools._distutils.dist.Distribution.get_obsoletes
# Missing objects from setuptools._distutils
setuptools._distutils.archive_util.ARCHIVE_FORMATS
setuptools._distutils.archive_util.check_archive_formats
setuptools._distutils.ccompiler.CCompiler.EXECUTABLE
setuptools._distutils.ccompiler.CCompiler.SHARED_LIBRARY
setuptools._distutils.ccompiler.CCompiler.SHARED_OBJECT
setuptools._distutils.ccompiler.CCompiler.compiler_type
setuptools._distutils.ccompiler.CCompiler.out_extensions
setuptools._distutils.ccompiler.CCompiler.set_executable
setuptools._distutils.ccompiler.compiler_class
setuptools._distutils.cmd.Command.dump_options
setuptools._distutils.command.build_clib.show_compilers
setuptools._distutils.command.build_ext.extension_name_re
Expand Down
2 changes: 1 addition & 1 deletion stubs/setuptools/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "~=75.8.2"
version = "~=76.0.0"
upstream_repository = "https://github.com/pypa/setuptools"
extra_description = """\
Given that `pkg_resources` is typed since `setuptools >= 71.1`, \
Expand Down
11 changes: 11 additions & 0 deletions stubs/setuptools/distutils/ccompiler.pyi
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
from setuptools._distutils.ccompiler import *
from setuptools._distutils.ccompiler import CCompiler as CCompiler

__all__ = [
"CompileError",
"LinkError",
"gen_lib_options",
"gen_preprocess_options",
"get_default_compiler",
"new_compiler",
"show_compilers",
]
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/compilers/C/base.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.compilers.C.base import *
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/compilers/C/errors.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.compilers.C.errors import *
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/compilers/C/msvc.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.compilers.C.msvc import *
23 changes: 2 additions & 21 deletions stubs/setuptools/setuptools/_distutils/_msvccompiler.pyi
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
from binascii import Incomplete
from typing import ClassVar, Final
from .compilers.C import msvc

from .ccompiler import CCompiler

PLAT_SPEC_TO_RUNTIME: Final[dict[str, str]]

class MSVCCompiler(CCompiler):
compiler_type: ClassVar[str]
executables: ClassVar[dict[Incomplete, Incomplete]]
src_extensions: ClassVar[list[str]]
res_extension: ClassVar[str]
obj_extension: ClassVar[str]
static_lib_extension: ClassVar[str]
shared_lib_extension: ClassVar[str]
shared_lib_format: ClassVar[str]
static_lib_format = shared_lib_format
exe_extension: ClassVar[str]
initialized: bool
def initialize(self, plat_name: str | None = None) -> None: ...
@property
def out_extensions(self) -> dict[str, str]: ...
MSVCCompiler = msvc.Compiler
191 changes: 13 additions & 178 deletions stubs/setuptools/setuptools/_distutils/ccompiler.pyi
Original file line number Diff line number Diff line change
@@ -1,180 +1,15 @@
from _typeshed import BytesPath, StrPath, Unused
from collections.abc import Callable, Iterable, MutableSequence, Sequence
from typing import ClassVar, Literal, TypeVar, overload
from typing_extensions import TypeAlias, TypeVarTuple, Unpack
from .compilers.C import base
from .compilers.C.base import gen_lib_options, gen_preprocess_options, get_default_compiler, new_compiler, show_compilers
from .compilers.C.errors import CompileError, LinkError

_Macro: TypeAlias = tuple[str] | tuple[str, str | None]
_StrPathT = TypeVar("_StrPathT", bound=StrPath)
_BytesPathT = TypeVar("_BytesPathT", bound=BytesPath)
_Ts = TypeVarTuple("_Ts")
__all__ = [
"CompileError",
"LinkError",
"gen_lib_options",
"gen_preprocess_options",
"get_default_compiler",
"new_compiler",
"show_compilers",
]

def gen_lib_options(
compiler: CCompiler, library_dirs: Iterable[str], runtime_library_dirs: Iterable[str], libraries: Iterable[str]
) -> list[str]: ...
def gen_preprocess_options(macros: Iterable[_Macro], include_dirs: Iterable[str]) -> list[str]: ...
def get_default_compiler(osname: str | None = None, platform: str | None = None) -> str: ...
def new_compiler(
plat: str | None = None, compiler: str | None = None, verbose: bool = False, dry_run: bool = False, force: bool = False
) -> CCompiler: ...
def show_compilers() -> None: ...

class CCompiler:
src_extensions: ClassVar[list[str] | None]
obj_extension: ClassVar[str | None]
static_lib_extension: ClassVar[str | None]
shared_lib_extension: ClassVar[str | None]
static_lib_format: ClassVar[str | None]
shared_lib_format: ClassVar[str | None]
exe_extension: ClassVar[str | None]
language_map: ClassVar[dict[str, str]]
language_order: ClassVar[list[str]]
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: bool = False, dry_run: bool = False, force: bool = False) -> 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) -> 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: Iterable[str], lib: str, debug: bool = False) -> str | None: ...
def has_function(
self,
funcname: str,
includes: Iterable[str] | None = None,
include_dirs: list[str] | tuple[str, ...] | None = None,
libraries: list[str] | None = None,
library_dirs: list[str] | tuple[str, ...] | None = 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, **kwargs: str) -> None: ...
def compile(
self,
sources: Sequence[StrPath],
output_dir: str | None = None,
macros: list[_Macro] | None = None,
include_dirs: list[str] | tuple[str, ...] | None = None,
debug: bool = False,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
depends: list[str] | tuple[str, ...] | None = None,
) -> list[str]: ...
def create_static_lib(
self,
objects: list[str] | tuple[str, ...],
output_libname: str,
output_dir: str | None = None,
debug: bool = False,
target_lang: str | None = None,
) -> None: ...
def link(
self,
target_desc: str,
objects: list[str] | tuple[str, ...],
output_filename: str,
output_dir: str | None = None,
libraries: list[str] | tuple[str, ...] | None = None,
library_dirs: list[str] | tuple[str, ...] | None = None,
runtime_library_dirs: list[str] | tuple[str, ...] | None = None,
export_symbols: Iterable[str] | None = None,
debug: bool = False,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
build_temp: StrPath | None = None,
target_lang: str | None = None,
) -> None: ...
def link_executable(
self,
objects: list[str] | tuple[str, ...],
output_progname: str,
output_dir: str | None = None,
libraries: list[str] | tuple[str, ...] | None = None,
library_dirs: list[str] | tuple[str, ...] | None = None,
runtime_library_dirs: list[str] | tuple[str, ...] | None = None,
debug: bool = False,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
target_lang: str | None = None,
) -> None: ...
def link_shared_lib(
self,
objects: list[str] | tuple[str, ...],
output_libname: str,
output_dir: str | None = None,
libraries: list[str] | tuple[str, ...] | None = None,
library_dirs: list[str] | tuple[str, ...] | None = None,
runtime_library_dirs: list[str] | tuple[str, ...] | None = None,
export_symbols: Iterable[str] | None = None,
debug: bool = False,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
build_temp: StrPath | None = None,
target_lang: str | None = None,
) -> None: ...
def link_shared_object(
self,
objects: list[str] | tuple[str, ...],
output_filename: str,
output_dir: str | None = None,
libraries: list[str] | tuple[str, ...] | None = None,
library_dirs: list[str] | tuple[str, ...] | None = None,
runtime_library_dirs: list[str] | tuple[str, ...] | None = None,
export_symbols: Iterable[str] | None = None,
debug: bool = False,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
build_temp: StrPath | None = None,
target_lang: str | None = None,
) -> None: ...
def preprocess(
self,
source: StrPath,
output_file: StrPath | None = None,
macros: list[_Macro] | None = None,
include_dirs: list[str] | tuple[str, ...] | None = None,
extra_preargs: list[str] | None = None,
extra_postargs: Iterable[str] | None = None,
) -> None: ...
@overload
def executable_filename(self, basename: str, strip_dir: Literal[False] = False, output_dir: StrPath = "") -> str: ...
@overload
def executable_filename(self, basename: StrPath, strip_dir: Literal[True], output_dir: StrPath = "") -> str: ...
def library_filename(
self, libname: str, lib_type: str = "static", strip_dir: bool = False, output_dir: StrPath = ""
) -> str: ...
def object_filenames(
self, source_filenames: Iterable[StrPath], strip_dir: bool = False, output_dir: StrPath | None = ""
) -> list[str]: ...
@overload
def shared_object_filename(self, basename: str, strip_dir: Literal[False] = False, output_dir: StrPath = "") -> str: ...
@overload
def shared_object_filename(self, basename: StrPath, strip_dir: Literal[True], output_dir: StrPath = "") -> str: ...
def execute(
self, func: Callable[[Unpack[_Ts]], Unused], args: tuple[Unpack[_Ts]], msg: str | None = None, level: int = 1
) -> None: ...
def spawn(self, cmd: MutableSequence[bytes | StrPath]) -> None: ...
def mkpath(self, name: str, mode: int = 0o777) -> None: ...
@overload
def move_file(self, src: StrPath, dst: _StrPathT) -> _StrPathT | str: ...
@overload
def move_file(self, src: BytesPath, dst: _BytesPathT) -> _BytesPathT | bytes: ...
def announce(self, msg: str, level: int = 1) -> None: ...
def warn(self, msg: str) -> None: ...
def debug_print(self, msg: str) -> None: ...
CCompiler = base.Compiler
Loading