Skip to content
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
3 changes: 2 additions & 1 deletion src/numpy-stubs/testing/__init__.pyi
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 6 additions & 0 deletions src/numpy-stubs/testing/_private/extbuild.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -30,4 +34,6 @@ def build(
libraries: object, # unused
library_dirs: Iterable[str],
) -> pathlib.Path: ... # undocumented

#
def get_so_suffix() -> str: ... # undocumented
7 changes: 2 additions & 5 deletions src/numpy-stubs/testing/_private/utils.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]]
Expand Down Expand Up @@ -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(
Expand Down