mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-04 12:35:49 +08:00
[setuptools] Add missing compilers (#15394)
This commit is contained in:
@@ -70,16 +70,16 @@ setuptools._distutils.command.install_headers
|
||||
setuptools._distutils.compat.numpy
|
||||
setuptools._distutils.compat.py39
|
||||
setuptools._distutils.core
|
||||
setuptools._distutils.cygwinccompiler
|
||||
setuptools._distutils.debug
|
||||
setuptools._distutils.dir_util
|
||||
setuptools._distutils.fancy_getopt
|
||||
setuptools._distutils.file_util
|
||||
setuptools._distutils.log
|
||||
setuptools._distutils.text_file
|
||||
setuptools._distutils.version
|
||||
setuptools._distutils.version.Version._cmp # abstract method
|
||||
setuptools._distutils.version.Version.parse # abstract method
|
||||
setuptools._distutils.version.suppress_known_deprecation
|
||||
setuptools._distutils.versionpredicate
|
||||
setuptools._distutils.zosccompiler
|
||||
|
||||
# Reexported from setuptools._distutils; problems should be fixed there
|
||||
distutils\..+
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
from setuptools._distutils.compilers.C.cygwin import *
|
||||
@@ -0,0 +1 @@
|
||||
from setuptools._distutils.compilers.C.zos import *
|
||||
@@ -0,0 +1 @@
|
||||
from setuptools._distutils.cygwinccompiler import *
|
||||
@@ -0,0 +1 @@
|
||||
from setuptools._distutils.version import *
|
||||
@@ -0,0 +1 @@
|
||||
from setuptools._distutils.zosccompiler import *
|
||||
@@ -2,7 +2,7 @@ from _typeshed import BytesPath, Incomplete, StrOrBytesPath, StrPath, Unused
|
||||
from collections.abc import Callable, Iterable, MutableSequence, Sequence
|
||||
from subprocess import _ENV
|
||||
from typing import ClassVar, Final, Literal, TypeVar, overload
|
||||
from typing_extensions import TypeAlias, TypeVarTuple, Unpack
|
||||
from typing_extensions import TypeAlias, TypeVarTuple, Unpack, deprecated
|
||||
|
||||
_Macro: TypeAlias = tuple[str] | tuple[str, str | None]
|
||||
_StrPathT = TypeVar("_StrPathT", bound=StrPath)
|
||||
@@ -53,6 +53,12 @@ class Compiler:
|
||||
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: ...
|
||||
@overload
|
||||
def has_function(
|
||||
self, funcname: str, libraries: list[str] | None = None, library_dirs: list[str] | tuple[str, ...] | None = None
|
||||
) -> bool: ...
|
||||
@overload
|
||||
@deprecated("The `includes`, `include_dirs` parameters are deprecated.")
|
||||
def has_function(
|
||||
self,
|
||||
funcname: str,
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
from _typeshed import StrPath
|
||||
from collections.abc import Callable, Iterable
|
||||
from shlex import _ShlexInstream
|
||||
from typing import ClassVar, Final, Literal, NoReturn
|
||||
from typing_extensions import Never, deprecated
|
||||
|
||||
from ...version import LooseVersion
|
||||
from . import unix
|
||||
|
||||
def get_msvcr() -> list[str]: ...
|
||||
|
||||
class Compiler(unix.Compiler):
|
||||
compiler_type: ClassVar[str]
|
||||
obj_extension: ClassVar[str]
|
||||
static_lib_extension: ClassVar[str]
|
||||
shared_lib_extension: ClassVar[str]
|
||||
dylib_lib_extension: ClassVar[str]
|
||||
static_lib_format: ClassVar[str]
|
||||
shared_lib_format: ClassVar[str]
|
||||
dylib_lib_format: ClassVar[str]
|
||||
exe_extension: ClassVar[str]
|
||||
cc: str
|
||||
cxx: str
|
||||
linker_dll: str
|
||||
linker_dll_cxx: str
|
||||
dll_libraries: list[str]
|
||||
def __init__(self, verbose: bool = False, force: bool = False) -> None: ...
|
||||
@property
|
||||
@deprecated(
|
||||
"gcc_version attribute of CygwinCCompiler is deprecated. "
|
||||
"Instead of returning actual gcc version a fixed value 11.2.0 is returned."
|
||||
)
|
||||
def gcc_version(self) -> LooseVersion: ...
|
||||
# `objects` and `libraries` uses list methods
|
||||
def link(
|
||||
self,
|
||||
target_desc: str,
|
||||
objects: list[str], # type: ignore[override]
|
||||
output_filename: str,
|
||||
output_dir: str | None = None,
|
||||
libraries: list[str] | None = None, # type: ignore[override]
|
||||
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: ...
|
||||
# cygwin doesn't support rpath; prints a warning and returns an empty list
|
||||
def runtime_library_dir_option(self, dir: str) -> list[Never]: ... # type: ignore[override]
|
||||
@property
|
||||
def out_extensions(self) -> dict[str, str]: ...
|
||||
|
||||
class MinGW32Compiler(Compiler):
|
||||
compiler_type: ClassVar[str]
|
||||
def __init__(self, verbose: bool = False, force: bool = False) -> None: ...
|
||||
def runtime_library_dir_option(self, dir: str) -> NoReturn: ...
|
||||
|
||||
CONFIG_H_OK: Final = "ok"
|
||||
CONFIG_H_NOTOK: Final = "not ok"
|
||||
CONFIG_H_UNCERTAIN: Final = "uncertain"
|
||||
|
||||
def check_config_h() -> tuple[Literal["ok", "not ok", "uncertain"], str]: ...
|
||||
def is_cygwincc(cc: str | _ShlexInstream) -> bool: ...
|
||||
|
||||
get_versions: Callable[[], tuple[LooseVersion | None, ...]] | None
|
||||
@@ -16,6 +16,7 @@ class Compiler(base.Compiler):
|
||||
static_lib_format = shared_lib_format
|
||||
exe_extension: ClassVar[str]
|
||||
initialized: bool
|
||||
plat_name: str | None
|
||||
def initialize(self, plat_name: str | None = None) -> None: ...
|
||||
@property
|
||||
def out_extensions(self) -> dict[str, str]: ...
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
from _typeshed import StrPath
|
||||
from collections.abc import Iterable
|
||||
from typing import ClassVar, Literal
|
||||
|
||||
from . import unix
|
||||
|
||||
class Compiler(unix.Compiler):
|
||||
src_extensions: ClassVar[list[str]]
|
||||
zos_compiler: Literal["ibm-openxl", "ibm-xlclang", "ibm-xlc"]
|
||||
def __init__(self, verbose: bool = False, force: bool = False) -> None: ...
|
||||
def runtime_library_dir_option(self, dir: str) -> str: ...
|
||||
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: ...
|
||||
@@ -0,0 +1,28 @@
|
||||
from collections.abc import Callable
|
||||
|
||||
from .compilers.C import cygwin
|
||||
from .compilers.C.cygwin import (
|
||||
CONFIG_H_NOTOK as CONFIG_H_NOTOK,
|
||||
CONFIG_H_OK as CONFIG_H_OK,
|
||||
CONFIG_H_UNCERTAIN as CONFIG_H_UNCERTAIN,
|
||||
check_config_h as check_config_h,
|
||||
get_msvcr as get_msvcr,
|
||||
is_cygwincc as is_cygwincc,
|
||||
)
|
||||
from .version import LooseVersion
|
||||
|
||||
__all__ = [
|
||||
"CONFIG_H_NOTOK",
|
||||
"CONFIG_H_OK",
|
||||
"CONFIG_H_UNCERTAIN",
|
||||
"CygwinCCompiler",
|
||||
"Mingw32CCompiler",
|
||||
"check_config_h",
|
||||
"get_msvcr",
|
||||
"is_cygwincc",
|
||||
]
|
||||
|
||||
CygwinCCompiler = cygwin.Compiler
|
||||
Mingw32CCompiler = cygwin.MinGW32Compiler
|
||||
|
||||
get_versions: Callable[[], tuple[LooseVersion | None, ...]] | None
|
||||
@@ -0,0 +1,35 @@
|
||||
from abc import abstractmethod
|
||||
from re import Pattern
|
||||
from typing_extensions import Self, deprecated
|
||||
|
||||
@deprecated("The `Version` class is deprecated. Use `packaging.version` instead.")
|
||||
class Version:
|
||||
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: ...
|
||||
@abstractmethod
|
||||
def __init__(self, vstring: str | None = None) -> None: ...
|
||||
@abstractmethod
|
||||
def parse(self, vstring: str) -> Self: ...
|
||||
@abstractmethod
|
||||
def _cmp(self, other: Self | str) -> bool: ...
|
||||
|
||||
@deprecated("The `StrictVersion` class is deprecated. Use `packaging.version` instead.")
|
||||
class StrictVersion(Version):
|
||||
version_re: Pattern[str]
|
||||
version: tuple[int, int, int]
|
||||
prerelease: tuple[str, int] | None
|
||||
def __init__(self, vstring: str | None = None) -> None: ...
|
||||
def parse(self, vstring: str) -> Self: ...
|
||||
def _cmp(self, other: Self | str) -> bool: ...
|
||||
|
||||
@deprecated("The `LooseVersion` class is deprecated. Use `packaging.version` instead.")
|
||||
class LooseVersion(Version):
|
||||
component_re: Pattern[str]
|
||||
vstring: str
|
||||
version: tuple[str | int, ...]
|
||||
def __init__(self, vstring: str | None = None) -> None: ...
|
||||
def parse(self, vstring: str) -> Self: ...
|
||||
def _cmp(self, other: Self | str) -> bool: ...
|
||||
@@ -0,0 +1,3 @@
|
||||
from .compilers.C import zos
|
||||
|
||||
zOSCCompiler = zos.Compiler
|
||||
Reference in New Issue
Block a user