From 0ac4126f77310597f35f6a91f08dae8da9ef49b5 Mon Sep 17 00:00:00 2001 From: jorenham Date: Tue, 30 Dec 2025 00:28:32 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=BD=EF=B8=8F=20`testing.*`=20sync=20wi?= =?UTF-8?q?th=20upstream?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/numpy-stubs/testing/__init__.pyi | 3 ++- src/numpy-stubs/testing/_private/extbuild.pyi | 6 ++++++ src/numpy-stubs/testing/_private/utils.pyi | 7 ++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/numpy-stubs/testing/__init__.pyi b/src/numpy-stubs/testing/__init__.pyi index 6dc98930..684a7c36 100644 --- a/src/numpy-stubs/testing/__init__.pyi +++ b/src/numpy-stubs/testing/__init__.pyi @@ -1,6 +1,7 @@ from unittest import TestCase -from . import overrides +from . import _private as _private, overrides +from ._private import extbuild as extbuild from ._private.utils import ( BLAS_SUPPORTS_FPE, HAS_LAPACK64, diff --git a/src/numpy-stubs/testing/_private/extbuild.pyi b/src/numpy-stubs/testing/_private/extbuild.pyi index 4820f009..908c1647 100644 --- a/src/numpy-stubs/testing/_private/extbuild.pyi +++ b/src/numpy-stubs/testing/_private/extbuild.pyi @@ -13,6 +13,8 @@ def build_and_import_extension( include_dirs: Sequence[str] | None = None, more_init: str = "", ) -> types.ModuleType: ... + +# def compile_extension_module( name: str, builddir: pathlib.Path, @@ -21,6 +23,8 @@ def compile_extension_module( libraries: Sequence[str] | None = None, library_dirs: Sequence[str] | None = None, ) -> pathlib.Path: ... + +# def build( cfile: pathlib.Path, outputfilename: pathlib.Path, @@ -30,4 +34,6 @@ def build( libraries: object, # unused library_dirs: Iterable[str], ) -> pathlib.Path: ... # undocumented + +# def get_so_suffix() -> str: ... # undocumented diff --git a/src/numpy-stubs/testing/_private/utils.pyi b/src/numpy-stubs/testing/_private/utils.pyi index dc22aa66..5a5cfdc2 100644 --- a/src/numpy-stubs/testing/_private/utils.pyi +++ b/src/numpy-stubs/testing/_private/utils.pyi @@ -96,7 +96,6 @@ _Tss = ParamSpec("_Tss") _ET = TypeVar("_ET", bound=BaseException, default=BaseException) _FT = TypeVar("_FT", bound=Callable[..., object]) _W_co = TypeVar("_W_co", bound=_WarnLog | None, default=_WarnLog | None, covariant=True) -_T_or_bool = TypeVar("_T_or_bool", default=bool) _ExceptionSpec: TypeAlias = type[_ET] | tuple[type[_ET], ...] _WarningSpec: TypeAlias = type[Warning] @@ -130,7 +129,6 @@ NOGIL_BUILD: Final[bool] = ... class KnownFailureException(Exception): ... class IgnoreException(Exception): ... -# NOTE: `warnings.catch_warnings` is incorrectly defined as invariant in typeshed class clear_and_catch_warnings(warnings.catch_warnings[_W_co], Generic[_W_co]): class_modules: ClassVar[tuple[types.ModuleType, ...]] = () modules: Final[set[types.ModuleType]] @@ -371,9 +369,8 @@ def temppath( suffix: AnyStr, prefix: AnyStr | None = None, dir: GenericPath[AnyStr] | None = None, text: bool = False ) -> _GeneratorContextManager[AnyStr]: ... -# NOTE: It's current impossible to annotate without it causing a stubtest error, -# and is therefore added to the permanent allowlist (`.mypyignore`) -def check_support_sve(__cache: list[_T_or_bool] = []) -> _T_or_bool: ... # noqa: PYI063 +# +def check_support_sve(__cache: list[bool] = ..., /) -> bool: ... # stubdefaulter: ignore[missing-default] # def decorate_methods(