From 90a44124cdc76206552121334e3f48b440503d18 Mon Sep 17 00:00:00 2001 From: gentlegiantJGC Date: Thu, 11 Sep 2025 15:49:41 +0100 Subject: [PATCH 1/8] Remove deprecated python versions (#8) --- .github/workflows/ci.yml | 2 - .../demo/__init__.pyi | 41 ------ .../demo/_bindings/__init__.pyi | 35 ----- .../demo/_bindings/aliases/__init__.pyi | 53 -------- .../demo/_bindings/aliases/foreign_arg.pyi | 7 - .../demo/_bindings/aliases/foreign_attr.pyi | 6 - .../aliases/foreign_class_member.pyi | 12 -- .../_bindings/aliases/foreign_method_arg.pyi | 8 -- .../aliases/foreign_method_return.pyi | 9 -- .../demo/_bindings/aliases/foreign_return.pyi | 7 - .../_bindings/aliases/missing_self_arg.pyi | 8 -- .../demo/_bindings/classes.pyi | 57 -------- .../demo/_bindings/enum.pyi | 71 ---------- .../demo/_bindings/flawed_bindings.pyi | 23 ---- .../demo/_bindings/functions.pyi | 58 -------- .../demo/_bindings/issues.pyi | 37 ------ .../demo/_bindings/methods.pyi | 8 -- .../demo/_bindings/properties.pyi | 99 -------------- .../demo/_bindings/stl_bind.pyi | 124 ------------------ .../demo/_bindings/typing.pyi | 10 -- .../demo/_bindings/values.pyi | 36 ----- .../demo/core.pyi | 35 ----- .../demo/pure_python/__init__.pyi | 5 - .../demo/pure_python/classes.pyi | 21 --- .../demo/pure_python/functions.pyi | 26 ---- .../demo/pure_python/values.pyi | 4 - tests/stubs/python-3.7/requirements.txt | 6 - .../demo/__init__.pyi | 41 ------ .../demo/_bindings/__init__.pyi | 35 ----- .../demo/_bindings/aliases/__init__.pyi | 53 -------- .../demo/_bindings/aliases/foreign_arg.pyi | 7 - .../demo/_bindings/aliases/foreign_attr.pyi | 6 - .../aliases/foreign_class_member.pyi | 12 -- .../_bindings/aliases/foreign_method_arg.pyi | 8 -- .../aliases/foreign_method_return.pyi | 9 -- .../demo/_bindings/aliases/foreign_return.pyi | 7 - .../_bindings/aliases/missing_self_arg.pyi | 8 -- .../demo/_bindings/classes.pyi | 57 -------- .../demo/_bindings/eigen.pyi | 99 -------------- .../demo/_bindings/enum.pyi | 71 ---------- .../demo/_bindings/flawed_bindings.pyi | 23 ---- .../demo/_bindings/functions.pyi | 58 -------- .../demo/_bindings/issues.pyi | 37 ------ .../demo/_bindings/methods.pyi | 8 -- .../demo/_bindings/numpy.pyi | 26 ---- .../demo/_bindings/properties.pyi | 99 -------------- .../demo/_bindings/stl.pyi | 26 ---- .../demo/_bindings/stl_bind.pyi | 124 ------------------ .../demo/_bindings/typing.pyi | 10 -- .../demo/_bindings/values.pyi | 36 ----- .../demo/core.pyi | 35 ----- .../demo/pure_python/__init__.pyi | 5 - .../demo/pure_python/classes.pyi | 21 --- .../demo/pure_python/functions.pyi | 29 ---- .../demo/pure_python/functions_3_8_plus.pyi | 15 --- .../demo/pure_python/values.pyi | 4 - tests/stubs/python-3.8/requirements.txt | 6 - 57 files changed, 1783 deletions(-) delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/__init__.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/__init__.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_arg.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_arg.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_return.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_return.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/missing_self_arg.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/functions.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/methods.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/typing.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/core.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/__init__.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/classes.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi delete mode 100644 tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/values.pyi delete mode 100644 tests/stubs/python-3.7/requirements.txt delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/__init__.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/__init__.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_arg.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_arg.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_return.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_return.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/missing_self_arg.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/functions.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/methods.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/typing.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/core.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/__init__.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/classes.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi delete mode 100644 tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/values.pyi delete mode 100644 tests/stubs/python-3.8/requirements.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9082e1ea..63c2de07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,6 @@ jobs: - "3.11" - "3.10" - "3.9" - - "3.8" numpy-format: - "numpy-array-wrap-with-annotated" include: @@ -128,7 +127,6 @@ jobs: - "3.11" - "3.10" - "3.9" - - "3.8" steps: - uses: actions/checkout@v4 diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/__init__.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/__init__.pyi deleted file mode 100644 index 86fb6b84..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/__init__.pyi +++ /dev/null @@ -1,41 +0,0 @@ -from __future__ import annotations - -from demo._bindings import ( - aliases, - classes, - eigen, - enum, - flawed_bindings, - functions, - issues, - methods, - numpy, - properties, - stl, - stl_bind, - typing, - values, -) - -from . import _bindings, core, pure_python - -__all__: list[str] = [ - "aliases", - "classes", - "core", - "eigen", - "enum", - "flawed_bindings", - "functions", - "issues", - "methods", - "numpy", - "properties", - "pure_python", - "stl", - "stl_bind", - "typing", - "values", - "version", -] -version: str = "0.0.0" diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/__init__.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/__init__.pyi deleted file mode 100644 index c263078f..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/__init__.pyi +++ /dev/null @@ -1,35 +0,0 @@ -from __future__ import annotations - -from . import ( - aliases, - classes, - eigen, - enum, - flawed_bindings, - functions, - issues, - methods, - numpy, - properties, - stl, - stl_bind, - typing, - values, -) - -__all__: list[str] = [ - "aliases", - "classes", - "eigen", - "enum", - "flawed_bindings", - "functions", - "issues", - "methods", - "numpy", - "properties", - "stl", - "stl_bind", - "typing", - "values", -] diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi deleted file mode 100644 index 93963f4b..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi +++ /dev/null @@ -1,53 +0,0 @@ -from __future__ import annotations - -import typing - -import numpy -from numpy import random - -import demo._bindings.enum -from demo._bindings.aliases.foreign_method_arg import Bar2 as foreign_type_alias -from demo._bindings.aliases.foreign_return import get_foo as foreign_class_alias - -from . import ( - foreign_arg, - foreign_attr, - foreign_class_member, - foreign_method_arg, - foreign_method_return, - foreign_return, - missing_self_arg, -) - -__all__: list[str] = [ - "Color", - "Dummy", - "foreign_arg", - "foreign_attr", - "foreign_class_alias", - "foreign_class_member", - "foreign_enum_default", - "foreign_method_arg", - "foreign_method_return", - "foreign_return", - "foreign_type_alias", - "func", - "local_func_alias", - "local_type_alias", - "missing_self_arg", - "random", -] - -class Color: - pass - -class Dummy: - linalg = numpy.linalg - -def foreign_enum_default( - color: typing.Any = demo._bindings.enum.ConsoleForegroundColor.Blue, -) -> None: ... -def func(arg0: int) -> int: ... - -local_func_alias = func -local_type_alias = Color diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_arg.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_arg.pyi deleted file mode 100644 index de75e6fb..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_arg.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from __future__ import annotations - -import demo._bindings.classes - -__all__: list[str] = ["set_foo"] - -def set_foo(arg0: demo._bindings.classes.Foo) -> int: ... diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi deleted file mode 100644 index 10c4a712..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from __future__ import annotations - -import demo._bindings.classes - -__all__: list[str] = ["value"] -value: demo._bindings.classes.Foo # value = diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi deleted file mode 100644 index 497a4e2a..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from __future__ import annotations - -import typing - -import demo._bindings.classes - -__all__: list[str] = ["Bar1"] - -class Bar1: - foo: typing.ClassVar[ - demo._bindings.classes.Foo - ] # value = diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_arg.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_arg.pyi deleted file mode 100644 index 8d4ed4ac..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_arg.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from __future__ import annotations - -import demo._bindings.classes - -__all__: list[str] = ["Bar2"] - -class Bar2: - def set_foo(self, arg0: demo._bindings.classes.Foo) -> int: ... diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_return.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_return.pyi deleted file mode 100644 index 95d218e1..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_return.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from __future__ import annotations - -import demo._bindings.classes - -__all__: list[str] = ["Bar3"] - -class Bar3: - @staticmethod - def get_foo() -> demo._bindings.classes.Foo: ... diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_return.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_return.pyi deleted file mode 100644 index 7b5b428f..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_return.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from __future__ import annotations - -import demo._bindings.classes - -__all__: list[str] = ["get_foo"] - -def get_foo() -> demo._bindings.classes.Foo: ... diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/missing_self_arg.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/missing_self_arg.pyi deleted file mode 100644 index ee1a09ee..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/missing_self_arg.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from __future__ import annotations - -import demo._bindings.classes - -__all__: list[str] = ["Bar4"] - -class Bar4: - def set_foo(self: demo._bindings.classes.Foo) -> int: ... diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi deleted file mode 100644 index ea36dda6..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi +++ /dev/null @@ -1,57 +0,0 @@ -from __future__ import annotations - -import typing - -__all__: list[str] = ["Base", "CppException", "Derived", "Foo", "Outer"] - -class Base: - class Inner: - pass - name: str - -class CppException(Exception): - pass - -class Derived(Base): - count: int - -class Foo: - class FooChild: - def __init__(self) -> None: ... - def g(self) -> None: ... - - def __init__(self) -> None: ... - def f(self) -> None: ... - -class Outer: - class Inner: - class NestedEnum: - """ - Members: - - ONE - - TWO - """ - - ONE: typing.ClassVar[Outer.Inner.NestedEnum] # value = - TWO: typing.ClassVar[Outer.Inner.NestedEnum] # value = - __members__: typing.ClassVar[ - dict[str, Outer.Inner.NestedEnum] - ] # value = {'ONE': , 'TWO': } - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - value: Outer.Inner.NestedEnum - inner: Outer.Inner diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi deleted file mode 100644 index 57aba5b9..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi +++ /dev/null @@ -1,71 +0,0 @@ -from __future__ import annotations - -import typing - -__all__: list[str] = [ - "Blue", - "ConsoleForegroundColor", - "Green", - "Magenta", - "None_", - "Yellow", - "accept_defaulted_enum", -] - -class ConsoleForegroundColor: - """ - Members: - - Green - - Yellow - - Blue - - Magenta - - None_ - """ - - Blue: typing.ClassVar[ - ConsoleForegroundColor - ] # value = - Green: typing.ClassVar[ - ConsoleForegroundColor - ] # value = - Magenta: typing.ClassVar[ - ConsoleForegroundColor - ] # value = - None_: typing.ClassVar[ - ConsoleForegroundColor - ] # value = - Yellow: typing.ClassVar[ - ConsoleForegroundColor - ] # value = - __members__: typing.ClassVar[ - dict[str, ConsoleForegroundColor] - ] # value = {'Green': , 'Yellow': , 'Blue': , 'Magenta': , 'None_': } - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -def accept_defaulted_enum( - color: ConsoleForegroundColor = ConsoleForegroundColor.None_, -) -> None: ... - -Blue: ConsoleForegroundColor # value = -Green: ConsoleForegroundColor # value = -Magenta: ConsoleForegroundColor # value = -None_: ConsoleForegroundColor # value = -Yellow: ConsoleForegroundColor # value = diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi deleted file mode 100644 index 4f3886ea..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from __future__ import annotations - -__all__: list[str] = [ - "Enum", - "Unbound", - "accept_unbound_enum", - "accept_unbound_enum_defaulted", - "accept_unbound_type", - "accept_unbound_type_defaulted", - "get_unbound_type", -] - -class Enum: - pass - -class Unbound: - pass - -def accept_unbound_enum(arg0: ...) -> int: ... -def accept_unbound_enum_defaulted(x: Enum = ...) -> int: ... -def accept_unbound_type(arg0: tuple[..., int]) -> int: ... -def accept_unbound_type_defaulted(x: Unbound = ...) -> int: ... -def get_unbound_type() -> ...: ... diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/functions.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/functions.pyi deleted file mode 100644 index eebf4a5c..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/functions.pyi +++ /dev/null @@ -1,58 +0,0 @@ -from __future__ import annotations - -import typing - -__all__: list[str] = [ - "Foo", - "accept_annotated_callable", - "accept_callable", - "accept_frozenset", - "accept_py_handle", - "accept_py_object", - "accept_set", - "add", - "default_custom_arg", - "default_int_arg", - "default_list_arg", - "default_optional_arg", - "func_w_anon_args", - "func_w_named_pos_args", - "generic", - "mul", - "pass_callback", - "pos_kw_only_mix", - "pos_kw_only_variadic_mix", -] - -class Foo: - def __init__(self, arg0: int) -> None: ... - -def accept_annotated_callable(arg0: typing.Callable[[int, int], int]) -> typing.Any: ... -def accept_callable(arg0: typing.Callable) -> typing.Any: ... -def accept_frozenset(arg0: frozenset) -> None: ... -def accept_py_handle(arg0: typing.Any) -> str: ... -def accept_py_object(arg0: typing.Any) -> str: ... -def accept_set(arg0: set) -> None: ... -def add(arg0: int, arg1: int) -> int: ... -def default_custom_arg(foo: Foo = Foo(5)) -> None: ... -def default_int_arg(n: int = 5) -> None: ... -def default_list_arg(l: list = [1, 2, 6, 18]) -> None: ... -def default_optional_arg(n: int | None = None) -> None: ... -def func_w_anon_args(arg0: int, arg1: int, arg2: int) -> None: ... -def func_w_named_pos_args(x: int, y: int, z: int) -> None: ... -def generic(*args, **kwargs) -> None: ... -@typing.overload -def mul(x: int, y: int) -> int: - """ - Multiply x and y (int) - """ - -@typing.overload -def mul(p: float, q: float) -> float: - """ - Multiply p and q (double) - """ - -def pass_callback(arg0: typing.Callable[[Foo], Foo]) -> Foo: ... -def pos_kw_only_mix(i: int, j: int, *, k: int) -> tuple: ... -def pos_kw_only_variadic_mix(i: int, j: int, *args, k: int, **kwargs) -> tuple: ... diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi deleted file mode 100644 index cf6abad8..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi +++ /dev/null @@ -1,37 +0,0 @@ -from __future__ import annotations - -import typing - -__all__: list[str] = [ - "backslashes_should_be_escaped", - "issue_51_catastrophic_regex", - "issue_73_utf8_doc_chars", -] - -def backslashes_should_be_escaped() -> None: - """ - \\brief A brief description of this function. - - A detailed description of this function. - - Here's some reStructuredText: :math:`x = [x, y, \\theta]^T` - """ - -def issue_51_catastrophic_regex(arg0: int, arg1: int) -> None: - """ - Use-case: - issue_51(os.get_handle_inheritable, os.set_handle_inheritable) - """ - -def issue_73_utf8_doc_chars() -> None: - """ - Construct a Ramsete unicycle controller. - - Tuning parameter (b > 0 rad²/m²) for which larger values make - - convergence more aggressive like a proportional term. - Tuning parameter (0 rad⁻¹ < zeta < 1 rad⁻¹) for which larger - values provide more damping in response. - """ - -_cleanup: typing.Any # value = diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/methods.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/methods.pyi deleted file mode 100644 index 6c115cd1..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/methods.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from __future__ import annotations - -__all__: list[str] = ["Dummy"] - -class Dummy: - @staticmethod - def static_method(arg0: int) -> int: ... - def regular_method(self, arg0: int) -> int: ... diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi deleted file mode 100644 index 9d81595c..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi +++ /dev/null @@ -1,99 +0,0 @@ -from __future__ import annotations - -import typing - -__all__: list[str] = [ - "WithGetterSetterDoc", - "WithPropAndGetterSetterDoc", - "WithPropDoc", - "WithoutDoc", -] - -class WithGetterSetterDoc: - """ - User docstring provided via pybind11::cpp_function(..., doc) to getters/setters, but NOT to `def_*(..., doc)` calls - """ - - def_property_readonly_static: typing.ClassVar[int] = 0 - def_property_static: typing.ClassVar[int] = 0 - @property - def def_property(self) -> int: - """ - getter doc token - """ - @def_property.setter - def def_property(self, arg1: int) -> None: - """ - setter doc token - """ - @property - def def_property_readonly(self) -> int: - """ - getter doc token - """ - -class WithPropAndGetterSetterDoc: - """ - User docstring provided via pybind11::cpp_function(..., doc) to getters/setters and to `def_*(, doc)` calls - """ - - def_property_readonly_static: typing.ClassVar[int] = 0 - def_property_static: typing.ClassVar[int] = 0 - @property - def def_property(self) -> int: - """ - prop doc token - """ - @def_property.setter - def def_property(self, arg1: int) -> None: ... - @property - def def_property_readonly(self) -> int: - """ - prop doc token - """ - -class WithPropDoc: - """ - User docstring provided only to `def_` calls - """ - - def_property_readonly_static: typing.ClassVar[int] = 0 - def_property_static: typing.ClassVar[int] = 0 - @property - def def_property(self) -> int: - """ - prop doc token - """ - @def_property.setter - def def_property(self, arg1: int) -> None: ... - @property - def def_property_readonly(self) -> int: - """ - prop doc token - """ - @property - def def_readonly(self) -> int: - """ - prop doc token - """ - @property - def def_readwrite(self) -> int: - """ - prop doc token - """ - @def_readwrite.setter - def def_readwrite(self, arg0: int) -> None: ... - -class WithoutDoc: - """ - No user docstring provided - """ - - def_property_readonly_static: typing.ClassVar[int] = 0 - def_property_static: typing.ClassVar[int] = 0 - def_property: int - def_readwrite: int - @property - def def_property_readonly(self) -> int: ... - @property - def def_readonly(self) -> int: ... diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi deleted file mode 100644 index 6f1f9b67..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi +++ /dev/null @@ -1,124 +0,0 @@ -from __future__ import annotations - -import typing - -__all__: list[str] = [ - "MapStringComplex", - "VectorPairStringDouble", - "get_complex_map", - "get_vector_of_pairs", -] - -class MapStringComplex: - def __bool__(self) -> bool: - """ - Check whether the map is nonempty - """ - @typing.overload - def __contains__(self, arg0: str) -> bool: ... - @typing.overload - def __contains__(self, arg0: typing.Any) -> bool: ... - def __delitem__(self, arg0: str) -> None: ... - def __getitem__(self, arg0: str) -> complex: ... - def __init__(self) -> None: ... - def __iter__(self) -> typing.Iterator[str]: ... - def __len__(self) -> int: ... - def __repr__(self) -> str: - """ - Return the canonical string representation of this map. - """ - def __setitem__(self, arg0: str, arg1: complex) -> None: ... - def items(self) -> typing.ItemsView: ... - def keys(self) -> typing.KeysView: ... - def values(self) -> typing.ValuesView: ... - -class VectorPairStringDouble: - __hash__: typing.ClassVar[None] = None - def __bool__(self) -> bool: - """ - Check whether the list is nonempty - """ - def __contains__(self, x: tuple[str, float]) -> bool: - """ - Return true the container contains ``x`` - """ - @typing.overload - def __delitem__(self, arg0: int) -> None: - """ - Delete the list elements at index ``i`` - """ - @typing.overload - def __delitem__(self, arg0: slice) -> None: - """ - Delete list elements using a slice object - """ - def __eq__(self, arg0: VectorPairStringDouble) -> bool: ... - @typing.overload - def __getitem__(self, s: slice) -> VectorPairStringDouble: - """ - Retrieve list elements using a slice object - """ - @typing.overload - def __getitem__(self, arg0: int) -> tuple[str, float]: ... - @typing.overload - def __init__(self) -> None: ... - @typing.overload - def __init__(self, arg0: VectorPairStringDouble) -> None: - """ - Copy constructor - """ - @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: ... - def __iter__(self) -> typing.Iterator[tuple[str, float]]: ... - def __len__(self) -> int: ... - def __ne__(self, arg0: VectorPairStringDouble) -> bool: ... - @typing.overload - def __setitem__(self, arg0: int, arg1: tuple[str, float]) -> None: ... - @typing.overload - def __setitem__(self, arg0: slice, arg1: VectorPairStringDouble) -> None: - """ - Assign list elements using a slice object - """ - def append(self, x: tuple[str, float]) -> None: - """ - Add an item to the end of the list - """ - def clear(self) -> None: - """ - Clear the contents - """ - def count(self, x: tuple[str, float]) -> int: - """ - Return the number of times ``x`` appears in the list - """ - @typing.overload - def extend(self, L: VectorPairStringDouble) -> None: - """ - Extend the list by appending all the items in the given list - """ - @typing.overload - def extend(self, L: typing.Iterable) -> None: - """ - Extend the list by appending all the items in the given list - """ - def insert(self, i: int, x: tuple[str, float]) -> None: - """ - Insert an item at a given position. - """ - @typing.overload - def pop(self) -> tuple[str, float]: - """ - Remove and return the last item - """ - @typing.overload - def pop(self, i: int) -> tuple[str, float]: - """ - Remove and return the item at index ``i`` - """ - def remove(self, x: tuple[str, float]) -> None: - """ - Remove the first item from the list whose value is x. It is an error if there is no such item. - """ - -def get_complex_map() -> MapStringComplex: ... -def get_vector_of_pairs() -> VectorPairStringDouble: ... diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/typing.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/typing.pyi deleted file mode 100644 index f2c4ab95..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/typing.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from __future__ import annotations - -import typing - -import typing_extensions - -__all__: list[str] = ["get_buffer", "get_sequence"] - -def get_buffer(arg0: typing_extensions.Buffer) -> typing_extensions.Buffer: ... -def get_sequence(arg0: typing.Sequence) -> typing.Sequence: ... diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi deleted file mode 100644 index 7c36d3fd..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi +++ /dev/null @@ -1,36 +0,0 @@ -from __future__ import annotations - -import datetime - -import numpy -from numpy import random - -__all__: list[str] = [ - "Dummy", - "Foo", - "add_day", - "foolist", - "foovar", - "list_with_none", - "none", - "random", - "t_10ms", - "t_20ns", - "t_30s", -] - -class Dummy: - linalg = numpy.linalg - -class Foo: - pass - -def add_day(arg0: datetime.datetime) -> datetime.datetime: ... - -foolist: list # value = [, ] -foovar: Foo # value = -list_with_none: list = [None, 2, {}] -none = None -t_10ms: datetime.timedelta # value = datetime.timedelta(microseconds=10000) -t_20ns: datetime.timedelta # value = datetime.timedelta(0) -t_30s: datetime.timedelta # value = datetime.timedelta(seconds=30) diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/core.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/core.pyi deleted file mode 100644 index 95c16467..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/core.pyi +++ /dev/null @@ -1,35 +0,0 @@ -from __future__ import annotations - -from demo._bindings import ( - aliases, - classes, - eigen, - enum, - flawed_bindings, - functions, - issues, - methods, - numpy, - properties, - stl, - stl_bind, - typing, - values, -) - -__all__: list[str] = [ - "aliases", - "classes", - "eigen", - "enum", - "flawed_bindings", - "functions", - "issues", - "methods", - "numpy", - "properties", - "stl", - "stl_bind", - "typing", - "values", -] diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/__init__.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/__init__.pyi deleted file mode 100644 index f61888ee..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/__init__.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from __future__ import annotations - -from . import classes, functions, values - -__all__: list[str] = ["classes", "functions", "values"] diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/classes.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/classes.pyi deleted file mode 100644 index 32aa068b..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/classes.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from __future__ import annotations - -__all__: list[str] = ["A", "B", "C", "X"] - -class A: - """ - A - """ - -class B(A): - """ - B - """ - -class C(B): - """ - C - """ - -class X: - pass diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi deleted file mode 100644 index ce1e49d1..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi +++ /dev/null @@ -1,26 +0,0 @@ -from __future__ import annotations - -import sys as sys -import typing as typing - -__all__: list[str] = [ - "accept_frozenset", - "builtin_function_as_default_arg", - "function_as_default_arg", - "lambda_as_default_arg", - "search", - "static_method_as_default_arg", - "sys", - "typing", -] - -class _Dummy: - @staticmethod - def foo(): ... - -def accept_frozenset(arg: frozenset[int | float]) -> int | None: ... -def builtin_function_as_default_arg(func: type(len) = len): ... -def function_as_default_arg(func: type(search) = search): ... -def lambda_as_default_arg(callback=...): ... -def search(a: int, b: list[int]) -> int: ... -def static_method_as_default_arg(callback=_Dummy.foo): ... diff --git a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/values.pyi b/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/values.pyi deleted file mode 100644 index 07913391..00000000 --- a/tests/stubs/python-3.7/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/values.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from __future__ import annotations - -__all__: list[str] = ["callables_dict"] -callables_dict: dict = {"len": len, "int": int} diff --git a/tests/stubs/python-3.7/requirements.txt b/tests/stubs/python-3.7/requirements.txt deleted file mode 100644 index 7c84e9c8..00000000 --- a/tests/stubs/python-3.7/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -black==22.8.0 -cmeel-eigen==3.4.0.2 -isort==5.10.1 -numpy~=1.20 -scipy~=1.0 -typing_extensions==4.7.1 diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/__init__.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/__init__.pyi deleted file mode 100644 index 86fb6b84..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/__init__.pyi +++ /dev/null @@ -1,41 +0,0 @@ -from __future__ import annotations - -from demo._bindings import ( - aliases, - classes, - eigen, - enum, - flawed_bindings, - functions, - issues, - methods, - numpy, - properties, - stl, - stl_bind, - typing, - values, -) - -from . import _bindings, core, pure_python - -__all__: list[str] = [ - "aliases", - "classes", - "core", - "eigen", - "enum", - "flawed_bindings", - "functions", - "issues", - "methods", - "numpy", - "properties", - "pure_python", - "stl", - "stl_bind", - "typing", - "values", - "version", -] -version: str = "0.0.0" diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/__init__.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/__init__.pyi deleted file mode 100644 index c263078f..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/__init__.pyi +++ /dev/null @@ -1,35 +0,0 @@ -from __future__ import annotations - -from . import ( - aliases, - classes, - eigen, - enum, - flawed_bindings, - functions, - issues, - methods, - numpy, - properties, - stl, - stl_bind, - typing, - values, -) - -__all__: list[str] = [ - "aliases", - "classes", - "eigen", - "enum", - "flawed_bindings", - "functions", - "issues", - "methods", - "numpy", - "properties", - "stl", - "stl_bind", - "typing", - "values", -] diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi deleted file mode 100644 index 93963f4b..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi +++ /dev/null @@ -1,53 +0,0 @@ -from __future__ import annotations - -import typing - -import numpy -from numpy import random - -import demo._bindings.enum -from demo._bindings.aliases.foreign_method_arg import Bar2 as foreign_type_alias -from demo._bindings.aliases.foreign_return import get_foo as foreign_class_alias - -from . import ( - foreign_arg, - foreign_attr, - foreign_class_member, - foreign_method_arg, - foreign_method_return, - foreign_return, - missing_self_arg, -) - -__all__: list[str] = [ - "Color", - "Dummy", - "foreign_arg", - "foreign_attr", - "foreign_class_alias", - "foreign_class_member", - "foreign_enum_default", - "foreign_method_arg", - "foreign_method_return", - "foreign_return", - "foreign_type_alias", - "func", - "local_func_alias", - "local_type_alias", - "missing_self_arg", - "random", -] - -class Color: - pass - -class Dummy: - linalg = numpy.linalg - -def foreign_enum_default( - color: typing.Any = demo._bindings.enum.ConsoleForegroundColor.Blue, -) -> None: ... -def func(arg0: int) -> int: ... - -local_func_alias = func -local_type_alias = Color diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_arg.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_arg.pyi deleted file mode 100644 index de75e6fb..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_arg.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from __future__ import annotations - -import demo._bindings.classes - -__all__: list[str] = ["set_foo"] - -def set_foo(arg0: demo._bindings.classes.Foo) -> int: ... diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi deleted file mode 100644 index 10c4a712..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from __future__ import annotations - -import demo._bindings.classes - -__all__: list[str] = ["value"] -value: demo._bindings.classes.Foo # value = diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi deleted file mode 100644 index 497a4e2a..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from __future__ import annotations - -import typing - -import demo._bindings.classes - -__all__: list[str] = ["Bar1"] - -class Bar1: - foo: typing.ClassVar[ - demo._bindings.classes.Foo - ] # value = diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_arg.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_arg.pyi deleted file mode 100644 index 8d4ed4ac..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_arg.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from __future__ import annotations - -import demo._bindings.classes - -__all__: list[str] = ["Bar2"] - -class Bar2: - def set_foo(self, arg0: demo._bindings.classes.Foo) -> int: ... diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_return.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_return.pyi deleted file mode 100644 index 95d218e1..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_return.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from __future__ import annotations - -import demo._bindings.classes - -__all__: list[str] = ["Bar3"] - -class Bar3: - @staticmethod - def get_foo() -> demo._bindings.classes.Foo: ... diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_return.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_return.pyi deleted file mode 100644 index 7b5b428f..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_return.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from __future__ import annotations - -import demo._bindings.classes - -__all__: list[str] = ["get_foo"] - -def get_foo() -> demo._bindings.classes.Foo: ... diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/missing_self_arg.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/missing_self_arg.pyi deleted file mode 100644 index ee1a09ee..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/missing_self_arg.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from __future__ import annotations - -import demo._bindings.classes - -__all__: list[str] = ["Bar4"] - -class Bar4: - def set_foo(self: demo._bindings.classes.Foo) -> int: ... diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi deleted file mode 100644 index ea36dda6..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi +++ /dev/null @@ -1,57 +0,0 @@ -from __future__ import annotations - -import typing - -__all__: list[str] = ["Base", "CppException", "Derived", "Foo", "Outer"] - -class Base: - class Inner: - pass - name: str - -class CppException(Exception): - pass - -class Derived(Base): - count: int - -class Foo: - class FooChild: - def __init__(self) -> None: ... - def g(self) -> None: ... - - def __init__(self) -> None: ... - def f(self) -> None: ... - -class Outer: - class Inner: - class NestedEnum: - """ - Members: - - ONE - - TWO - """ - - ONE: typing.ClassVar[Outer.Inner.NestedEnum] # value = - TWO: typing.ClassVar[Outer.Inner.NestedEnum] # value = - __members__: typing.ClassVar[ - dict[str, Outer.Inner.NestedEnum] - ] # value = {'ONE': , 'TWO': } - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - value: Outer.Inner.NestedEnum - inner: Outer.Inner diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi deleted file mode 100644 index a75e8c15..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi +++ /dev/null @@ -1,99 +0,0 @@ -from __future__ import annotations - -import numpy -import pybind11_stubgen.typing_ext -import scipy.sparse -import typing_extensions - -__all__: list[str] = [ - "accept_matrix_int", - "accept_vector_float64", - "dense_matrix_c", - "dense_matrix_r", - "fixed_mutator_a", - "fixed_mutator_c", - "fixed_mutator_r", - "four_col_matrix_r", - "four_row_matrix_r", - "get_matrix_int", - "get_vector_float64", - "sparse_matrix_c", - "sparse_matrix_r", -] - -def accept_matrix_int( - arg0: typing_extensions.Annotated[ - numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3) - ] -) -> None: ... -def accept_vector_float64( - arg0: typing_extensions.Annotated[ - numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1) - ] -) -> None: ... -def dense_matrix_c( - arg0: typing_extensions.Annotated[ - numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") - ] -) -> typing_extensions.Annotated[ - numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") -]: ... -def dense_matrix_r( - arg0: typing_extensions.Annotated[ - numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") - ] -) -> typing_extensions.Annotated[ - numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") -]: ... -def fixed_mutator_a( - arg0: typing_extensions.Annotated[ - numpy.ndarray, - numpy.float32, - pybind11_stubgen.typing_ext.FixedSize(5, 6), - numpy.ndarray.flags.writeable, - ] -) -> None: ... -def fixed_mutator_c( - arg0: typing_extensions.Annotated[ - numpy.ndarray, - numpy.float32, - pybind11_stubgen.typing_ext.FixedSize(5, 6), - numpy.ndarray.flags.writeable, - numpy.ndarray.flags.f_contiguous, - ] -) -> None: ... -def fixed_mutator_r( - arg0: typing_extensions.Annotated[ - numpy.ndarray, - numpy.float32, - pybind11_stubgen.typing_ext.FixedSize(5, 6), - numpy.ndarray.flags.writeable, - numpy.ndarray.flags.c_contiguous, - ] -) -> None: ... -def four_col_matrix_r( - arg0: typing_extensions.Annotated[ - numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", 4) - ] -) -> typing_extensions.Annotated[ - numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", 4) -]: ... -def four_row_matrix_r( - arg0: typing_extensions.Annotated[ - numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize(4, "n") - ] -) -> typing_extensions.Annotated[ - numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize(4, "n") -]: ... -def get_matrix_int() -> typing_extensions.Annotated[ - numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3) -]: ... -def get_vector_float64() -> typing_extensions.Annotated[ - numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1) -]: ... -def sparse_matrix_c( - arg0: typing_extensions.Annotated[scipy.sparse.csc_matrix, numpy.float32] -) -> typing_extensions.Annotated[scipy.sparse.csc_matrix, numpy.float32]: ... -def sparse_matrix_r( - arg0: typing_extensions.Annotated[scipy.sparse.csr_matrix, numpy.float32] -) -> typing_extensions.Annotated[scipy.sparse.csr_matrix, numpy.float32]: ... diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi deleted file mode 100644 index 57aba5b9..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi +++ /dev/null @@ -1,71 +0,0 @@ -from __future__ import annotations - -import typing - -__all__: list[str] = [ - "Blue", - "ConsoleForegroundColor", - "Green", - "Magenta", - "None_", - "Yellow", - "accept_defaulted_enum", -] - -class ConsoleForegroundColor: - """ - Members: - - Green - - Yellow - - Blue - - Magenta - - None_ - """ - - Blue: typing.ClassVar[ - ConsoleForegroundColor - ] # value = - Green: typing.ClassVar[ - ConsoleForegroundColor - ] # value = - Magenta: typing.ClassVar[ - ConsoleForegroundColor - ] # value = - None_: typing.ClassVar[ - ConsoleForegroundColor - ] # value = - Yellow: typing.ClassVar[ - ConsoleForegroundColor - ] # value = - __members__: typing.ClassVar[ - dict[str, ConsoleForegroundColor] - ] # value = {'Green': , 'Yellow': , 'Blue': , 'Magenta': , 'None_': } - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -def accept_defaulted_enum( - color: ConsoleForegroundColor = ConsoleForegroundColor.None_, -) -> None: ... - -Blue: ConsoleForegroundColor # value = -Green: ConsoleForegroundColor # value = -Magenta: ConsoleForegroundColor # value = -None_: ConsoleForegroundColor # value = -Yellow: ConsoleForegroundColor # value = diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi deleted file mode 100644 index 4f3886ea..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from __future__ import annotations - -__all__: list[str] = [ - "Enum", - "Unbound", - "accept_unbound_enum", - "accept_unbound_enum_defaulted", - "accept_unbound_type", - "accept_unbound_type_defaulted", - "get_unbound_type", -] - -class Enum: - pass - -class Unbound: - pass - -def accept_unbound_enum(arg0: ...) -> int: ... -def accept_unbound_enum_defaulted(x: Enum = ...) -> int: ... -def accept_unbound_type(arg0: tuple[..., int]) -> int: ... -def accept_unbound_type_defaulted(x: Unbound = ...) -> int: ... -def get_unbound_type() -> ...: ... diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/functions.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/functions.pyi deleted file mode 100644 index 79f666a0..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/functions.pyi +++ /dev/null @@ -1,58 +0,0 @@ -from __future__ import annotations - -import typing - -__all__: list[str] = [ - "Foo", - "accept_annotated_callable", - "accept_callable", - "accept_frozenset", - "accept_py_handle", - "accept_py_object", - "accept_set", - "add", - "default_custom_arg", - "default_int_arg", - "default_list_arg", - "default_optional_arg", - "func_w_anon_args", - "func_w_named_pos_args", - "generic", - "mul", - "pass_callback", - "pos_kw_only_mix", - "pos_kw_only_variadic_mix", -] - -class Foo: - def __init__(self, arg0: int) -> None: ... - -def accept_annotated_callable(arg0: typing.Callable[[int, int], int]) -> typing.Any: ... -def accept_callable(arg0: typing.Callable) -> typing.Any: ... -def accept_frozenset(arg0: frozenset) -> None: ... -def accept_py_handle(arg0: typing.Any) -> str: ... -def accept_py_object(arg0: typing.Any) -> str: ... -def accept_set(arg0: set) -> None: ... -def add(arg0: int, arg1: int) -> int: ... -def default_custom_arg(foo: Foo = Foo(5)) -> None: ... -def default_int_arg(n: int = 5) -> None: ... -def default_list_arg(l: list = [1, 2, 6, 18]) -> None: ... -def default_optional_arg(n: int | None = None) -> None: ... -def func_w_anon_args(arg0: int, arg1: int, arg2: int) -> None: ... -def func_w_named_pos_args(x: int, y: int, z: int) -> None: ... -def generic(*args, **kwargs) -> None: ... -@typing.overload -def mul(x: int, y: int) -> int: - """ - Multiply x and y (int) - """ - -@typing.overload -def mul(p: float, q: float) -> float: - """ - Multiply p and q (double) - """ - -def pass_callback(arg0: typing.Callable[[Foo], Foo]) -> Foo: ... -def pos_kw_only_mix(i: int, /, j: int, *, k: int) -> tuple: ... -def pos_kw_only_variadic_mix(i: int, /, j: int, *args, k: int, **kwargs) -> tuple: ... diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi deleted file mode 100644 index cf6abad8..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi +++ /dev/null @@ -1,37 +0,0 @@ -from __future__ import annotations - -import typing - -__all__: list[str] = [ - "backslashes_should_be_escaped", - "issue_51_catastrophic_regex", - "issue_73_utf8_doc_chars", -] - -def backslashes_should_be_escaped() -> None: - """ - \\brief A brief description of this function. - - A detailed description of this function. - - Here's some reStructuredText: :math:`x = [x, y, \\theta]^T` - """ - -def issue_51_catastrophic_regex(arg0: int, arg1: int) -> None: - """ - Use-case: - issue_51(os.get_handle_inheritable, os.set_handle_inheritable) - """ - -def issue_73_utf8_doc_chars() -> None: - """ - Construct a Ramsete unicycle controller. - - Tuning parameter (b > 0 rad²/m²) for which larger values make - - convergence more aggressive like a proportional term. - Tuning parameter (0 rad⁻¹ < zeta < 1 rad⁻¹) for which larger - values provide more damping in response. - """ - -_cleanup: typing.Any # value = diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/methods.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/methods.pyi deleted file mode 100644 index 6c115cd1..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/methods.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from __future__ import annotations - -__all__: list[str] = ["Dummy"] - -class Dummy: - @staticmethod - def static_method(arg0: int) -> int: ... - def regular_method(self, arg0: int) -> int: ... diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi deleted file mode 100644 index d1fe4668..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi +++ /dev/null @@ -1,26 +0,0 @@ -from __future__ import annotations - -import typing - -import numpy -import typing_extensions - -__all__: list[str] = [ - "accept_ndarray_float64", - "accept_ndarray_int", - "get_ndarray_float64", - "get_ndarray_int", - "return_dtype", -] - -def accept_ndarray_float64( - arg0: typing_extensions.Annotated[numpy.ndarray, numpy.float64] -) -> None: ... -def accept_ndarray_int( - arg0: typing_extensions.Annotated[numpy.ndarray, numpy.int32] -) -> None: ... -def get_ndarray_float64() -> typing_extensions.Annotated[ - numpy.ndarray, numpy.float64 -]: ... -def get_ndarray_int() -> typing_extensions.Annotated[numpy.ndarray, numpy.int32]: ... -def return_dtype() -> numpy.dtype[typing.Any]: ... diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi deleted file mode 100644 index 9d81595c..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi +++ /dev/null @@ -1,99 +0,0 @@ -from __future__ import annotations - -import typing - -__all__: list[str] = [ - "WithGetterSetterDoc", - "WithPropAndGetterSetterDoc", - "WithPropDoc", - "WithoutDoc", -] - -class WithGetterSetterDoc: - """ - User docstring provided via pybind11::cpp_function(..., doc) to getters/setters, but NOT to `def_*(..., doc)` calls - """ - - def_property_readonly_static: typing.ClassVar[int] = 0 - def_property_static: typing.ClassVar[int] = 0 - @property - def def_property(self) -> int: - """ - getter doc token - """ - @def_property.setter - def def_property(self, arg1: int) -> None: - """ - setter doc token - """ - @property - def def_property_readonly(self) -> int: - """ - getter doc token - """ - -class WithPropAndGetterSetterDoc: - """ - User docstring provided via pybind11::cpp_function(..., doc) to getters/setters and to `def_*(, doc)` calls - """ - - def_property_readonly_static: typing.ClassVar[int] = 0 - def_property_static: typing.ClassVar[int] = 0 - @property - def def_property(self) -> int: - """ - prop doc token - """ - @def_property.setter - def def_property(self, arg1: int) -> None: ... - @property - def def_property_readonly(self) -> int: - """ - prop doc token - """ - -class WithPropDoc: - """ - User docstring provided only to `def_` calls - """ - - def_property_readonly_static: typing.ClassVar[int] = 0 - def_property_static: typing.ClassVar[int] = 0 - @property - def def_property(self) -> int: - """ - prop doc token - """ - @def_property.setter - def def_property(self, arg1: int) -> None: ... - @property - def def_property_readonly(self) -> int: - """ - prop doc token - """ - @property - def def_readonly(self) -> int: - """ - prop doc token - """ - @property - def def_readwrite(self) -> int: - """ - prop doc token - """ - @def_readwrite.setter - def def_readwrite(self, arg0: int) -> None: ... - -class WithoutDoc: - """ - No user docstring provided - """ - - def_property_readonly_static: typing.ClassVar[int] = 0 - def_property_static: typing.ClassVar[int] = 0 - def_property: int - def_readwrite: int - @property - def def_property_readonly(self) -> int: ... - @property - def def_readonly(self) -> int: ... diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi deleted file mode 100644 index 906037e7..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi +++ /dev/null @@ -1,26 +0,0 @@ -from __future__ import annotations - -import typing - -import pybind11_stubgen.typing_ext -import typing_extensions - -__all__: list[str] = [ - "std_array", - "std_map", - "std_optional", - "std_variant", - "std_vector", -] - -def std_array( - arg0: typing_extensions.Annotated[ - list[int], pybind11_stubgen.typing_ext.FixedSize(3) - ] -) -> typing_extensions.Annotated[ - list[int], pybind11_stubgen.typing_ext.FixedSize(3) -]: ... -def std_map() -> dict[int, complex]: ... -def std_optional(arg0: int | None) -> None: ... -def std_variant(arg0: int | float | tuple[int, int]) -> None: ... -def std_vector() -> list[tuple[int, float]]: ... diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi deleted file mode 100644 index 6f1f9b67..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi +++ /dev/null @@ -1,124 +0,0 @@ -from __future__ import annotations - -import typing - -__all__: list[str] = [ - "MapStringComplex", - "VectorPairStringDouble", - "get_complex_map", - "get_vector_of_pairs", -] - -class MapStringComplex: - def __bool__(self) -> bool: - """ - Check whether the map is nonempty - """ - @typing.overload - def __contains__(self, arg0: str) -> bool: ... - @typing.overload - def __contains__(self, arg0: typing.Any) -> bool: ... - def __delitem__(self, arg0: str) -> None: ... - def __getitem__(self, arg0: str) -> complex: ... - def __init__(self) -> None: ... - def __iter__(self) -> typing.Iterator[str]: ... - def __len__(self) -> int: ... - def __repr__(self) -> str: - """ - Return the canonical string representation of this map. - """ - def __setitem__(self, arg0: str, arg1: complex) -> None: ... - def items(self) -> typing.ItemsView: ... - def keys(self) -> typing.KeysView: ... - def values(self) -> typing.ValuesView: ... - -class VectorPairStringDouble: - __hash__: typing.ClassVar[None] = None - def __bool__(self) -> bool: - """ - Check whether the list is nonempty - """ - def __contains__(self, x: tuple[str, float]) -> bool: - """ - Return true the container contains ``x`` - """ - @typing.overload - def __delitem__(self, arg0: int) -> None: - """ - Delete the list elements at index ``i`` - """ - @typing.overload - def __delitem__(self, arg0: slice) -> None: - """ - Delete list elements using a slice object - """ - def __eq__(self, arg0: VectorPairStringDouble) -> bool: ... - @typing.overload - def __getitem__(self, s: slice) -> VectorPairStringDouble: - """ - Retrieve list elements using a slice object - """ - @typing.overload - def __getitem__(self, arg0: int) -> tuple[str, float]: ... - @typing.overload - def __init__(self) -> None: ... - @typing.overload - def __init__(self, arg0: VectorPairStringDouble) -> None: - """ - Copy constructor - """ - @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: ... - def __iter__(self) -> typing.Iterator[tuple[str, float]]: ... - def __len__(self) -> int: ... - def __ne__(self, arg0: VectorPairStringDouble) -> bool: ... - @typing.overload - def __setitem__(self, arg0: int, arg1: tuple[str, float]) -> None: ... - @typing.overload - def __setitem__(self, arg0: slice, arg1: VectorPairStringDouble) -> None: - """ - Assign list elements using a slice object - """ - def append(self, x: tuple[str, float]) -> None: - """ - Add an item to the end of the list - """ - def clear(self) -> None: - """ - Clear the contents - """ - def count(self, x: tuple[str, float]) -> int: - """ - Return the number of times ``x`` appears in the list - """ - @typing.overload - def extend(self, L: VectorPairStringDouble) -> None: - """ - Extend the list by appending all the items in the given list - """ - @typing.overload - def extend(self, L: typing.Iterable) -> None: - """ - Extend the list by appending all the items in the given list - """ - def insert(self, i: int, x: tuple[str, float]) -> None: - """ - Insert an item at a given position. - """ - @typing.overload - def pop(self) -> tuple[str, float]: - """ - Remove and return the last item - """ - @typing.overload - def pop(self, i: int) -> tuple[str, float]: - """ - Remove and return the item at index ``i`` - """ - def remove(self, x: tuple[str, float]) -> None: - """ - Remove the first item from the list whose value is x. It is an error if there is no such item. - """ - -def get_complex_map() -> MapStringComplex: ... -def get_vector_of_pairs() -> VectorPairStringDouble: ... diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/typing.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/typing.pyi deleted file mode 100644 index f2c4ab95..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/typing.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from __future__ import annotations - -import typing - -import typing_extensions - -__all__: list[str] = ["get_buffer", "get_sequence"] - -def get_buffer(arg0: typing_extensions.Buffer) -> typing_extensions.Buffer: ... -def get_sequence(arg0: typing.Sequence) -> typing.Sequence: ... diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi deleted file mode 100644 index 7c36d3fd..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi +++ /dev/null @@ -1,36 +0,0 @@ -from __future__ import annotations - -import datetime - -import numpy -from numpy import random - -__all__: list[str] = [ - "Dummy", - "Foo", - "add_day", - "foolist", - "foovar", - "list_with_none", - "none", - "random", - "t_10ms", - "t_20ns", - "t_30s", -] - -class Dummy: - linalg = numpy.linalg - -class Foo: - pass - -def add_day(arg0: datetime.datetime) -> datetime.datetime: ... - -foolist: list # value = [, ] -foovar: Foo # value = -list_with_none: list = [None, 2, {}] -none = None -t_10ms: datetime.timedelta # value = datetime.timedelta(microseconds=10000) -t_20ns: datetime.timedelta # value = datetime.timedelta(0) -t_30s: datetime.timedelta # value = datetime.timedelta(seconds=30) diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/core.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/core.pyi deleted file mode 100644 index 95c16467..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/core.pyi +++ /dev/null @@ -1,35 +0,0 @@ -from __future__ import annotations - -from demo._bindings import ( - aliases, - classes, - eigen, - enum, - flawed_bindings, - functions, - issues, - methods, - numpy, - properties, - stl, - stl_bind, - typing, - values, -) - -__all__: list[str] = [ - "aliases", - "classes", - "eigen", - "enum", - "flawed_bindings", - "functions", - "issues", - "methods", - "numpy", - "properties", - "stl", - "stl_bind", - "typing", - "values", -] diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/__init__.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/__init__.pyi deleted file mode 100644 index c0243fb7..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/__init__.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from __future__ import annotations - -from . import classes, functions, functions_3_8_plus, values - -__all__: list[str] = ["classes", "functions", "functions_3_8_plus", "values"] diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/classes.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/classes.pyi deleted file mode 100644 index 32aa068b..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/classes.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from __future__ import annotations - -__all__: list[str] = ["A", "B", "C", "X"] - -class A: - """ - A - """ - -class B(A): - """ - B - """ - -class C(B): - """ - C - """ - -class X: - pass diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi deleted file mode 100644 index 13f2855c..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi +++ /dev/null @@ -1,29 +0,0 @@ -from __future__ import annotations - -import sys as sys -import typing as typing - -from demo.pure_python.functions_3_8_plus import args_mix - -__all__: list[str] = [ - "accept_frozenset", - "args_mix", - "builtin_function_as_default_arg", - "function_as_default_arg", - "lambda_as_default_arg", - "search", - "static_method_as_default_arg", - "sys", - "typing", -] - -class _Dummy: - @staticmethod - def foo(): ... - -def accept_frozenset(arg: frozenset[int | float]) -> int | None: ... -def builtin_function_as_default_arg(func: type(len) = len): ... -def function_as_default_arg(func: type(search) = search): ... -def lambda_as_default_arg(callback=...): ... -def search(a: int, b: list[int]) -> int: ... -def static_method_as_default_arg(callback=_Dummy.foo): ... diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi deleted file mode 100644 index e9164220..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from __future__ import annotations - -import typing as typing - -__all__: list[str] = ["args_mix", "typing"] - -def args_mix( - a: int, - b: float = 0.5, - c: str = "", - *args: int, - x: int = 1, - y=int, - **kwargs: typing.Dict[int, str], -): ... diff --git a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/values.pyi b/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/values.pyi deleted file mode 100644 index 07913391..00000000 --- a/tests/stubs/python-3.8/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/values.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from __future__ import annotations - -__all__: list[str] = ["callables_dict"] -callables_dict: dict = {"len": len, "int": int} diff --git a/tests/stubs/python-3.8/requirements.txt b/tests/stubs/python-3.8/requirements.txt deleted file mode 100644 index 7c84e9c8..00000000 --- a/tests/stubs/python-3.8/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -black==22.8.0 -cmeel-eigen==3.4.0.2 -isort==5.10.1 -numpy~=1.20 -scipy~=1.0 -typing_extensions==4.7.1 From f51074b51dd615131764d8063d706d6c1cebd243 Mon Sep 17 00:00:00 2001 From: gentlegiantJGC Date: Thu, 11 Sep 2025 16:12:45 +0100 Subject: [PATCH 2/8] Add JetBrains .idea folder to .gitignore (#9) --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 79915dfc..59716e8d 100644 --- a/.gitignore +++ b/.gitignore @@ -203,7 +203,7 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ +.idea/ # End of https://www.toptal.com/developers/gitignore/api/c++,cmake,python From 1a38526828ff2fafacd36ddc6500ac40e7f54cb6 Mon Sep 17 00:00:00 2001 From: gentlegiantJGC Date: Thu, 11 Sep 2025 16:40:44 +0100 Subject: [PATCH 3/8] Simplify test matrix (#11) I found the matrix with modifications difficult to follow. The config matrix variant is much easier to understand. --- .github/workflows/ci.yml | 53 ++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63c2de07..b106bb93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,44 +38,29 @@ jobs: if: ${{ failure() || success() }} tests: - name: "Test 🐍 ${{ matrix.python }} • pybind-${{ matrix.pybind11-branch }} • ${{ matrix.numpy-format }}" + name: "Test 🐍 ${{ matrix.config.python }} • pybind-${{ matrix.config.pybind11-branch }} • ${{ matrix.config.numpy-format }}" runs-on: ubuntu-latest strategy: fail-fast: false matrix: - pybind11-branch: - - "v2.13" - python: - - "3.13" - - "3.12" - - "3.11" - - "3.10" - - "3.9" - numpy-format: - - "numpy-array-wrap-with-annotated" - include: - - python: "3.13" - pybind11-branch: "v2.9" - numpy-format: "numpy-array-wrap-with-annotated" - - python: "3.13" - pybind11-branch: "v2.11" - numpy-format: "numpy-array-wrap-with-annotated" - - python: "3.13" - pybind11-branch: "v2.12" - numpy-format: "numpy-array-wrap-with-annotated" - - python: "3.13" - pybind11-branch: "v2.13" - numpy-format: "numpy-array-use-type-var" -# # TODO: uncomment -# - python: "3.13" -# pybind11-branch: "master" + config: [ + { pybind11-branch: "v2.13", python: "3.13", numpy-format: "numpy-array-use-type-var"}, + { pybind11-branch: "v2.13", python: "3.13", numpy-format: "numpy-array-wrap-with-annotated"}, + { pybind11-branch: "v2.13", python: "3.12", numpy-format: "numpy-array-wrap-with-annotated"}, + { pybind11-branch: "v2.13", python: "3.11", numpy-format: "numpy-array-wrap-with-annotated"}, + { pybind11-branch: "v2.13", python: "3.10", numpy-format: "numpy-array-wrap-with-annotated"}, + { pybind11-branch: "v2.13", python: "3.9", numpy-format: "numpy-array-wrap-with-annotated"}, + { pybind11-branch: "v2.12", python: "3.13", numpy-format: "numpy-array-wrap-with-annotated"}, + { pybind11-branch: "v2.11", python: "3.13", numpy-format: "numpy-array-wrap-with-annotated"}, + { pybind11-branch: "v2.9", python: "3.13", numpy-format: "numpy-array-wrap-with-annotated"}, + ] steps: - uses: actions/checkout@v4 - - name: Setup Python ${{ matrix.python }} + - name: Setup Python ${{ matrix.config.python }} uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python }} + python-version: ${{ matrix.config.python }} - name: Update CMake uses: jwlawson/actions-setup-cmake@v2 @@ -88,25 +73,25 @@ jobs: run: python -m pip install pytest-github-actions-annotate-failures - name: Install requirements - run: pip install -r "./tests/stubs/python-${{ matrix.python }}/requirements.txt" + run: pip install -r "./tests/stubs/python-${{ matrix.config.python }}/requirements.txt" - name: Install pybind11-stubgen run: pip install . - name: Install demo module shell: bash - run: ./tests/install-demo-module.sh --pybind11-branch "${{ matrix.pybind11-branch }}" + run: ./tests/install-demo-module.sh --pybind11-branch "${{ matrix.config.pybind11-branch }}" - name: Check stubs generation shell: bash - run: ./tests/check-demo-stubs-generation.sh --stubs-sub-dir "stubs/python-${{ matrix.python }}/pybind11-${{ matrix.pybind11-branch }}/${{ matrix.numpy-format }}" --${{ matrix.numpy-format }} + run: ./tests/check-demo-stubs-generation.sh --stubs-sub-dir "stubs/python-${{ matrix.config.python }}/pybind11-${{ matrix.config.pybind11-branch }}/${{ matrix.config.numpy-format }}" --${{ matrix.config.numpy-format }} - name: Archive patch uses: actions/upload-artifact@v4 if: failure() with: - name: "python-${{ matrix.python }}-pybind-${{ matrix.pybind11-branch }}-${{ matrix.numpy-format }}.patch" - path: "./tests/stubs/python-${{ matrix.python }}/pybind11-${{ matrix.pybind11-branch }}/${{ matrix.numpy-format }}.patch" + name: "python-${{ matrix.config.python }}-pybind-${{ matrix.config.pybind11-branch }}-${{ matrix.config.numpy-format }}.patch" + path: "./tests/stubs/python-${{ matrix.config.python }}/pybind11-${{ matrix.config.pybind11-branch }}/${{ matrix.config.numpy-format }}.patch" retention-days: 30 if-no-files-found: ignore From f55f747755d1069c7ee27d2b9f328756f6658c03 Mon Sep 17 00:00:00 2001 From: gentlegiantJGC Date: Thu, 11 Sep 2025 16:59:45 +0100 Subject: [PATCH 4/8] Add 3.9 stubs (#12) I want to support syntax changes in the 3.12 stubs. This requires having a different version before this. --- tests/stubs/python-3.10 | 2 +- tests/stubs/python-3.11 | 2 +- tests/stubs/python-3.9 | 1 - .../demo/__init__.pyi | 41 ++++++ .../demo/_bindings/__init__.pyi | 35 +++++ .../demo/_bindings/aliases/__init__.pyi | 53 ++++++++ .../demo/_bindings/aliases/foreign_arg.pyi | 7 + .../demo/_bindings/aliases/foreign_attr.pyi | 6 + .../aliases/foreign_class_member.pyi | 12 ++ .../_bindings/aliases/foreign_method_arg.pyi | 8 ++ .../aliases/foreign_method_return.pyi | 9 ++ .../demo/_bindings/aliases/foreign_return.pyi | 7 + .../_bindings/aliases/missing_self_arg.pyi | 8 ++ .../demo/_bindings/classes.pyi | 57 ++++++++ .../demo/_bindings/eigen.pyi | 100 ++++++++++++++ .../demo/_bindings/enum.pyi | 71 ++++++++++ .../demo/_bindings/flawed_bindings.pyi | 23 ++++ .../demo/_bindings/functions.pyi | 58 ++++++++ .../demo/_bindings/issues.pyi | 37 ++++++ .../demo/_bindings/methods.pyi | 8 ++ .../demo/_bindings/numpy.pyi | 21 +++ .../demo/_bindings/properties.pyi | 99 ++++++++++++++ .../demo/_bindings/stl.pyi | 21 +++ .../demo/_bindings/stl_bind.pyi | 124 ++++++++++++++++++ .../demo/_bindings/typing.pyi | 10 ++ .../demo/_bindings/values.pyi | 36 +++++ .../demo/core.pyi | 35 +++++ .../demo/pure_python/__init__.pyi | 11 ++ .../demo/pure_python/classes.pyi | 21 +++ .../demo/pure_python/functions.pyi | 31 +++++ .../demo/pure_python/functions_3_8_plus.pyi | 15 +++ .../demo/pure_python/functions_3_9_plus.pyi | 5 + .../demo/pure_python/values.pyi | 4 + tests/stubs/python-3.9/requirements.txt | 6 + 34 files changed, 981 insertions(+), 3 deletions(-) delete mode 120000 tests/stubs/python-3.9 create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/__init__.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/__init__.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_arg.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_arg.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_return.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_return.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/missing_self_arg.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/functions.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/methods.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/typing.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/core.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/__init__.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/classes.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_9_plus.pyi create mode 100644 tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/values.pyi create mode 100644 tests/stubs/python-3.9/requirements.txt diff --git a/tests/stubs/python-3.10 b/tests/stubs/python-3.10 index 08f31189..032aea2d 120000 --- a/tests/stubs/python-3.10 +++ b/tests/stubs/python-3.10 @@ -1 +1 @@ -python-3.11 \ No newline at end of file +python-3.9 \ No newline at end of file diff --git a/tests/stubs/python-3.11 b/tests/stubs/python-3.11 index 0a8325ae..f31904fc 120000 --- a/tests/stubs/python-3.11 +++ b/tests/stubs/python-3.11 @@ -1 +1 @@ -python-3.12 \ No newline at end of file +python-3.10 \ No newline at end of file diff --git a/tests/stubs/python-3.9 b/tests/stubs/python-3.9 deleted file mode 120000 index f31904fc..00000000 --- a/tests/stubs/python-3.9 +++ /dev/null @@ -1 +0,0 @@ -python-3.10 \ No newline at end of file diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/__init__.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/__init__.pyi new file mode 100644 index 00000000..86fb6b84 --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/__init__.pyi @@ -0,0 +1,41 @@ +from __future__ import annotations + +from demo._bindings import ( + aliases, + classes, + eigen, + enum, + flawed_bindings, + functions, + issues, + methods, + numpy, + properties, + stl, + stl_bind, + typing, + values, +) + +from . import _bindings, core, pure_python + +__all__: list[str] = [ + "aliases", + "classes", + "core", + "eigen", + "enum", + "flawed_bindings", + "functions", + "issues", + "methods", + "numpy", + "properties", + "pure_python", + "stl", + "stl_bind", + "typing", + "values", + "version", +] +version: str = "0.0.0" diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/__init__.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/__init__.pyi new file mode 100644 index 00000000..c263078f --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/__init__.pyi @@ -0,0 +1,35 @@ +from __future__ import annotations + +from . import ( + aliases, + classes, + eigen, + enum, + flawed_bindings, + functions, + issues, + methods, + numpy, + properties, + stl, + stl_bind, + typing, + values, +) + +__all__: list[str] = [ + "aliases", + "classes", + "eigen", + "enum", + "flawed_bindings", + "functions", + "issues", + "methods", + "numpy", + "properties", + "stl", + "stl_bind", + "typing", + "values", +] diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi new file mode 100644 index 00000000..93963f4b --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi @@ -0,0 +1,53 @@ +from __future__ import annotations + +import typing + +import numpy +from numpy import random + +import demo._bindings.enum +from demo._bindings.aliases.foreign_method_arg import Bar2 as foreign_type_alias +from demo._bindings.aliases.foreign_return import get_foo as foreign_class_alias + +from . import ( + foreign_arg, + foreign_attr, + foreign_class_member, + foreign_method_arg, + foreign_method_return, + foreign_return, + missing_self_arg, +) + +__all__: list[str] = [ + "Color", + "Dummy", + "foreign_arg", + "foreign_attr", + "foreign_class_alias", + "foreign_class_member", + "foreign_enum_default", + "foreign_method_arg", + "foreign_method_return", + "foreign_return", + "foreign_type_alias", + "func", + "local_func_alias", + "local_type_alias", + "missing_self_arg", + "random", +] + +class Color: + pass + +class Dummy: + linalg = numpy.linalg + +def foreign_enum_default( + color: typing.Any = demo._bindings.enum.ConsoleForegroundColor.Blue, +) -> None: ... +def func(arg0: int) -> int: ... + +local_func_alias = func +local_type_alias = Color diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_arg.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_arg.pyi new file mode 100644 index 00000000..de75e6fb --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_arg.pyi @@ -0,0 +1,7 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["set_foo"] + +def set_foo(arg0: demo._bindings.classes.Foo) -> int: ... diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi new file mode 100644 index 00000000..10c4a712 --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi @@ -0,0 +1,6 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["value"] +value: demo._bindings.classes.Foo # value = diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi new file mode 100644 index 00000000..497a4e2a --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi @@ -0,0 +1,12 @@ +from __future__ import annotations + +import typing + +import demo._bindings.classes + +__all__: list[str] = ["Bar1"] + +class Bar1: + foo: typing.ClassVar[ + demo._bindings.classes.Foo + ] # value = diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_arg.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_arg.pyi new file mode 100644 index 00000000..8d4ed4ac --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_arg.pyi @@ -0,0 +1,8 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["Bar2"] + +class Bar2: + def set_foo(self, arg0: demo._bindings.classes.Foo) -> int: ... diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_return.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_return.pyi new file mode 100644 index 00000000..95d218e1 --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_return.pyi @@ -0,0 +1,9 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["Bar3"] + +class Bar3: + @staticmethod + def get_foo() -> demo._bindings.classes.Foo: ... diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_return.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_return.pyi new file mode 100644 index 00000000..7b5b428f --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_return.pyi @@ -0,0 +1,7 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["get_foo"] + +def get_foo() -> demo._bindings.classes.Foo: ... diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/missing_self_arg.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/missing_self_arg.pyi new file mode 100644 index 00000000..ee1a09ee --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/aliases/missing_self_arg.pyi @@ -0,0 +1,8 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["Bar4"] + +class Bar4: + def set_foo(self: demo._bindings.classes.Foo) -> int: ... diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi new file mode 100644 index 00000000..ea36dda6 --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi @@ -0,0 +1,57 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = ["Base", "CppException", "Derived", "Foo", "Outer"] + +class Base: + class Inner: + pass + name: str + +class CppException(Exception): + pass + +class Derived(Base): + count: int + +class Foo: + class FooChild: + def __init__(self) -> None: ... + def g(self) -> None: ... + + def __init__(self) -> None: ... + def f(self) -> None: ... + +class Outer: + class Inner: + class NestedEnum: + """ + Members: + + ONE + + TWO + """ + + ONE: typing.ClassVar[Outer.Inner.NestedEnum] # value = + TWO: typing.ClassVar[Outer.Inner.NestedEnum] # value = + __members__: typing.ClassVar[ + dict[str, Outer.Inner.NestedEnum] + ] # value = {'ONE': , 'TWO': } + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + value: Outer.Inner.NestedEnum + inner: Outer.Inner diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi new file mode 100644 index 00000000..8e453374 --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi @@ -0,0 +1,100 @@ +from __future__ import annotations + +import typing + +import numpy +import pybind11_stubgen.typing_ext +import scipy.sparse + +__all__: list[str] = [ + "accept_matrix_int", + "accept_vector_float64", + "dense_matrix_c", + "dense_matrix_r", + "fixed_mutator_a", + "fixed_mutator_c", + "fixed_mutator_r", + "four_col_matrix_r", + "four_row_matrix_r", + "get_matrix_int", + "get_vector_float64", + "sparse_matrix_c", + "sparse_matrix_r", +] + +def accept_matrix_int( + arg0: typing.Annotated[ + numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3) + ] +) -> None: ... +def accept_vector_float64( + arg0: typing.Annotated[ + numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1) + ] +) -> None: ... +def dense_matrix_c( + arg0: typing.Annotated[ + numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") + ] +) -> typing.Annotated[ + numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") +]: ... +def dense_matrix_r( + arg0: typing.Annotated[ + numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") + ] +) -> typing.Annotated[ + numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") +]: ... +def fixed_mutator_a( + arg0: typing.Annotated[ + numpy.ndarray, + numpy.float32, + pybind11_stubgen.typing_ext.FixedSize(5, 6), + numpy.ndarray.flags.writeable, + ] +) -> None: ... +def fixed_mutator_c( + arg0: typing.Annotated[ + numpy.ndarray, + numpy.float32, + pybind11_stubgen.typing_ext.FixedSize(5, 6), + numpy.ndarray.flags.writeable, + numpy.ndarray.flags.f_contiguous, + ] +) -> None: ... +def fixed_mutator_r( + arg0: typing.Annotated[ + numpy.ndarray, + numpy.float32, + pybind11_stubgen.typing_ext.FixedSize(5, 6), + numpy.ndarray.flags.writeable, + numpy.ndarray.flags.c_contiguous, + ] +) -> None: ... +def four_col_matrix_r( + arg0: typing.Annotated[ + numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", 4) + ] +) -> typing.Annotated[ + numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", 4) +]: ... +def four_row_matrix_r( + arg0: typing.Annotated[ + numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize(4, "n") + ] +) -> typing.Annotated[ + numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize(4, "n") +]: ... +def get_matrix_int() -> typing.Annotated[ + numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3) +]: ... +def get_vector_float64() -> typing.Annotated[ + numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1) +]: ... +def sparse_matrix_c( + arg0: typing.Annotated[scipy.sparse.csc_matrix, numpy.float32] +) -> typing.Annotated[scipy.sparse.csc_matrix, numpy.float32]: ... +def sparse_matrix_r( + arg0: typing.Annotated[scipy.sparse.csr_matrix, numpy.float32] +) -> typing.Annotated[scipy.sparse.csr_matrix, numpy.float32]: ... diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi new file mode 100644 index 00000000..57aba5b9 --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi @@ -0,0 +1,71 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = [ + "Blue", + "ConsoleForegroundColor", + "Green", + "Magenta", + "None_", + "Yellow", + "accept_defaulted_enum", +] + +class ConsoleForegroundColor: + """ + Members: + + Green + + Yellow + + Blue + + Magenta + + None_ + """ + + Blue: typing.ClassVar[ + ConsoleForegroundColor + ] # value = + Green: typing.ClassVar[ + ConsoleForegroundColor + ] # value = + Magenta: typing.ClassVar[ + ConsoleForegroundColor + ] # value = + None_: typing.ClassVar[ + ConsoleForegroundColor + ] # value = + Yellow: typing.ClassVar[ + ConsoleForegroundColor + ] # value = + __members__: typing.ClassVar[ + dict[str, ConsoleForegroundColor] + ] # value = {'Green': , 'Yellow': , 'Blue': , 'Magenta': , 'None_': } + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +def accept_defaulted_enum( + color: ConsoleForegroundColor = ConsoleForegroundColor.None_, +) -> None: ... + +Blue: ConsoleForegroundColor # value = +Green: ConsoleForegroundColor # value = +Magenta: ConsoleForegroundColor # value = +None_: ConsoleForegroundColor # value = +Yellow: ConsoleForegroundColor # value = diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi new file mode 100644 index 00000000..4f3886ea --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi @@ -0,0 +1,23 @@ +from __future__ import annotations + +__all__: list[str] = [ + "Enum", + "Unbound", + "accept_unbound_enum", + "accept_unbound_enum_defaulted", + "accept_unbound_type", + "accept_unbound_type_defaulted", + "get_unbound_type", +] + +class Enum: + pass + +class Unbound: + pass + +def accept_unbound_enum(arg0: ...) -> int: ... +def accept_unbound_enum_defaulted(x: Enum = ...) -> int: ... +def accept_unbound_type(arg0: tuple[..., int]) -> int: ... +def accept_unbound_type_defaulted(x: Unbound = ...) -> int: ... +def get_unbound_type() -> ...: ... diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/functions.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/functions.pyi new file mode 100644 index 00000000..79f666a0 --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/functions.pyi @@ -0,0 +1,58 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = [ + "Foo", + "accept_annotated_callable", + "accept_callable", + "accept_frozenset", + "accept_py_handle", + "accept_py_object", + "accept_set", + "add", + "default_custom_arg", + "default_int_arg", + "default_list_arg", + "default_optional_arg", + "func_w_anon_args", + "func_w_named_pos_args", + "generic", + "mul", + "pass_callback", + "pos_kw_only_mix", + "pos_kw_only_variadic_mix", +] + +class Foo: + def __init__(self, arg0: int) -> None: ... + +def accept_annotated_callable(arg0: typing.Callable[[int, int], int]) -> typing.Any: ... +def accept_callable(arg0: typing.Callable) -> typing.Any: ... +def accept_frozenset(arg0: frozenset) -> None: ... +def accept_py_handle(arg0: typing.Any) -> str: ... +def accept_py_object(arg0: typing.Any) -> str: ... +def accept_set(arg0: set) -> None: ... +def add(arg0: int, arg1: int) -> int: ... +def default_custom_arg(foo: Foo = Foo(5)) -> None: ... +def default_int_arg(n: int = 5) -> None: ... +def default_list_arg(l: list = [1, 2, 6, 18]) -> None: ... +def default_optional_arg(n: int | None = None) -> None: ... +def func_w_anon_args(arg0: int, arg1: int, arg2: int) -> None: ... +def func_w_named_pos_args(x: int, y: int, z: int) -> None: ... +def generic(*args, **kwargs) -> None: ... +@typing.overload +def mul(x: int, y: int) -> int: + """ + Multiply x and y (int) + """ + +@typing.overload +def mul(p: float, q: float) -> float: + """ + Multiply p and q (double) + """ + +def pass_callback(arg0: typing.Callable[[Foo], Foo]) -> Foo: ... +def pos_kw_only_mix(i: int, /, j: int, *, k: int) -> tuple: ... +def pos_kw_only_variadic_mix(i: int, /, j: int, *args, k: int, **kwargs) -> tuple: ... diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi new file mode 100644 index 00000000..cf6abad8 --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi @@ -0,0 +1,37 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = [ + "backslashes_should_be_escaped", + "issue_51_catastrophic_regex", + "issue_73_utf8_doc_chars", +] + +def backslashes_should_be_escaped() -> None: + """ + \\brief A brief description of this function. + + A detailed description of this function. + + Here's some reStructuredText: :math:`x = [x, y, \\theta]^T` + """ + +def issue_51_catastrophic_regex(arg0: int, arg1: int) -> None: + """ + Use-case: + issue_51(os.get_handle_inheritable, os.set_handle_inheritable) + """ + +def issue_73_utf8_doc_chars() -> None: + """ + Construct a Ramsete unicycle controller. + + Tuning parameter (b > 0 rad²/m²) for which larger values make + + convergence more aggressive like a proportional term. + Tuning parameter (0 rad⁻¹ < zeta < 1 rad⁻¹) for which larger + values provide more damping in response. + """ + +_cleanup: typing.Any # value = diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/methods.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/methods.pyi new file mode 100644 index 00000000..6c115cd1 --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/methods.pyi @@ -0,0 +1,8 @@ +from __future__ import annotations + +__all__: list[str] = ["Dummy"] + +class Dummy: + @staticmethod + def static_method(arg0: int) -> int: ... + def regular_method(self, arg0: int) -> int: ... diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi new file mode 100644 index 00000000..e211caaf --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi @@ -0,0 +1,21 @@ +from __future__ import annotations + +import typing + +import numpy + +__all__: list[str] = [ + "accept_ndarray_float64", + "accept_ndarray_int", + "get_ndarray_float64", + "get_ndarray_int", + "return_dtype", +] + +def accept_ndarray_float64( + arg0: typing.Annotated[numpy.ndarray, numpy.float64] +) -> None: ... +def accept_ndarray_int(arg0: typing.Annotated[numpy.ndarray, numpy.int32]) -> None: ... +def get_ndarray_float64() -> typing.Annotated[numpy.ndarray, numpy.float64]: ... +def get_ndarray_int() -> typing.Annotated[numpy.ndarray, numpy.int32]: ... +def return_dtype() -> numpy.dtype[typing.Any]: ... diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi new file mode 100644 index 00000000..9d81595c --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi @@ -0,0 +1,99 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = [ + "WithGetterSetterDoc", + "WithPropAndGetterSetterDoc", + "WithPropDoc", + "WithoutDoc", +] + +class WithGetterSetterDoc: + """ + User docstring provided via pybind11::cpp_function(..., doc) to getters/setters, but NOT to `def_*(..., doc)` calls + """ + + def_property_readonly_static: typing.ClassVar[int] = 0 + def_property_static: typing.ClassVar[int] = 0 + @property + def def_property(self) -> int: + """ + getter doc token + """ + @def_property.setter + def def_property(self, arg1: int) -> None: + """ + setter doc token + """ + @property + def def_property_readonly(self) -> int: + """ + getter doc token + """ + +class WithPropAndGetterSetterDoc: + """ + User docstring provided via pybind11::cpp_function(..., doc) to getters/setters and to `def_*(, doc)` calls + """ + + def_property_readonly_static: typing.ClassVar[int] = 0 + def_property_static: typing.ClassVar[int] = 0 + @property + def def_property(self) -> int: + """ + prop doc token + """ + @def_property.setter + def def_property(self, arg1: int) -> None: ... + @property + def def_property_readonly(self) -> int: + """ + prop doc token + """ + +class WithPropDoc: + """ + User docstring provided only to `def_` calls + """ + + def_property_readonly_static: typing.ClassVar[int] = 0 + def_property_static: typing.ClassVar[int] = 0 + @property + def def_property(self) -> int: + """ + prop doc token + """ + @def_property.setter + def def_property(self, arg1: int) -> None: ... + @property + def def_property_readonly(self) -> int: + """ + prop doc token + """ + @property + def def_readonly(self) -> int: + """ + prop doc token + """ + @property + def def_readwrite(self) -> int: + """ + prop doc token + """ + @def_readwrite.setter + def def_readwrite(self, arg0: int) -> None: ... + +class WithoutDoc: + """ + No user docstring provided + """ + + def_property_readonly_static: typing.ClassVar[int] = 0 + def_property_static: typing.ClassVar[int] = 0 + def_property: int + def_readwrite: int + @property + def def_property_readonly(self) -> int: ... + @property + def def_readonly(self) -> int: ... diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi new file mode 100644 index 00000000..bd5bb496 --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi @@ -0,0 +1,21 @@ +from __future__ import annotations + +import typing + +import pybind11_stubgen.typing_ext + +__all__: list[str] = [ + "std_array", + "std_map", + "std_optional", + "std_variant", + "std_vector", +] + +def std_array( + arg0: typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)] +) -> typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)]: ... +def std_map() -> dict[int, complex]: ... +def std_optional(arg0: int | None) -> None: ... +def std_variant(arg0: int | float | tuple[int, int]) -> None: ... +def std_vector() -> list[tuple[int, float]]: ... diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi new file mode 100644 index 00000000..6f1f9b67 --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi @@ -0,0 +1,124 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = [ + "MapStringComplex", + "VectorPairStringDouble", + "get_complex_map", + "get_vector_of_pairs", +] + +class MapStringComplex: + def __bool__(self) -> bool: + """ + Check whether the map is nonempty + """ + @typing.overload + def __contains__(self, arg0: str) -> bool: ... + @typing.overload + def __contains__(self, arg0: typing.Any) -> bool: ... + def __delitem__(self, arg0: str) -> None: ... + def __getitem__(self, arg0: str) -> complex: ... + def __init__(self) -> None: ... + def __iter__(self) -> typing.Iterator[str]: ... + def __len__(self) -> int: ... + def __repr__(self) -> str: + """ + Return the canonical string representation of this map. + """ + def __setitem__(self, arg0: str, arg1: complex) -> None: ... + def items(self) -> typing.ItemsView: ... + def keys(self) -> typing.KeysView: ... + def values(self) -> typing.ValuesView: ... + +class VectorPairStringDouble: + __hash__: typing.ClassVar[None] = None + def __bool__(self) -> bool: + """ + Check whether the list is nonempty + """ + def __contains__(self, x: tuple[str, float]) -> bool: + """ + Return true the container contains ``x`` + """ + @typing.overload + def __delitem__(self, arg0: int) -> None: + """ + Delete the list elements at index ``i`` + """ + @typing.overload + def __delitem__(self, arg0: slice) -> None: + """ + Delete list elements using a slice object + """ + def __eq__(self, arg0: VectorPairStringDouble) -> bool: ... + @typing.overload + def __getitem__(self, s: slice) -> VectorPairStringDouble: + """ + Retrieve list elements using a slice object + """ + @typing.overload + def __getitem__(self, arg0: int) -> tuple[str, float]: ... + @typing.overload + def __init__(self) -> None: ... + @typing.overload + def __init__(self, arg0: VectorPairStringDouble) -> None: + """ + Copy constructor + """ + @typing.overload + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator[tuple[str, float]]: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: VectorPairStringDouble) -> bool: ... + @typing.overload + def __setitem__(self, arg0: int, arg1: tuple[str, float]) -> None: ... + @typing.overload + def __setitem__(self, arg0: slice, arg1: VectorPairStringDouble) -> None: + """ + Assign list elements using a slice object + """ + def append(self, x: tuple[str, float]) -> None: + """ + Add an item to the end of the list + """ + def clear(self) -> None: + """ + Clear the contents + """ + def count(self, x: tuple[str, float]) -> int: + """ + Return the number of times ``x`` appears in the list + """ + @typing.overload + def extend(self, L: VectorPairStringDouble) -> None: + """ + Extend the list by appending all the items in the given list + """ + @typing.overload + def extend(self, L: typing.Iterable) -> None: + """ + Extend the list by appending all the items in the given list + """ + def insert(self, i: int, x: tuple[str, float]) -> None: + """ + Insert an item at a given position. + """ + @typing.overload + def pop(self) -> tuple[str, float]: + """ + Remove and return the last item + """ + @typing.overload + def pop(self, i: int) -> tuple[str, float]: + """ + Remove and return the item at index ``i`` + """ + def remove(self, x: tuple[str, float]) -> None: + """ + Remove the first item from the list whose value is x. It is an error if there is no such item. + """ + +def get_complex_map() -> MapStringComplex: ... +def get_vector_of_pairs() -> VectorPairStringDouble: ... diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/typing.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/typing.pyi new file mode 100644 index 00000000..f2c4ab95 --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/typing.pyi @@ -0,0 +1,10 @@ +from __future__ import annotations + +import typing + +import typing_extensions + +__all__: list[str] = ["get_buffer", "get_sequence"] + +def get_buffer(arg0: typing_extensions.Buffer) -> typing_extensions.Buffer: ... +def get_sequence(arg0: typing.Sequence) -> typing.Sequence: ... diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi new file mode 100644 index 00000000..7c36d3fd --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi @@ -0,0 +1,36 @@ +from __future__ import annotations + +import datetime + +import numpy +from numpy import random + +__all__: list[str] = [ + "Dummy", + "Foo", + "add_day", + "foolist", + "foovar", + "list_with_none", + "none", + "random", + "t_10ms", + "t_20ns", + "t_30s", +] + +class Dummy: + linalg = numpy.linalg + +class Foo: + pass + +def add_day(arg0: datetime.datetime) -> datetime.datetime: ... + +foolist: list # value = [, ] +foovar: Foo # value = +list_with_none: list = [None, 2, {}] +none = None +t_10ms: datetime.timedelta # value = datetime.timedelta(microseconds=10000) +t_20ns: datetime.timedelta # value = datetime.timedelta(0) +t_30s: datetime.timedelta # value = datetime.timedelta(seconds=30) diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/core.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/core.pyi new file mode 100644 index 00000000..95c16467 --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/core.pyi @@ -0,0 +1,35 @@ +from __future__ import annotations + +from demo._bindings import ( + aliases, + classes, + eigen, + enum, + flawed_bindings, + functions, + issues, + methods, + numpy, + properties, + stl, + stl_bind, + typing, + values, +) + +__all__: list[str] = [ + "aliases", + "classes", + "eigen", + "enum", + "flawed_bindings", + "functions", + "issues", + "methods", + "numpy", + "properties", + "stl", + "stl_bind", + "typing", + "values", +] diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/__init__.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/__init__.pyi new file mode 100644 index 00000000..10d343e0 --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/__init__.pyi @@ -0,0 +1,11 @@ +from __future__ import annotations + +from . import classes, functions, functions_3_8_plus, functions_3_9_plus, values + +__all__: list[str] = [ + "classes", + "functions", + "functions_3_8_plus", + "functions_3_9_plus", + "values", +] diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/classes.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/classes.pyi new file mode 100644 index 00000000..32aa068b --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/classes.pyi @@ -0,0 +1,21 @@ +from __future__ import annotations + +__all__: list[str] = ["A", "B", "C", "X"] + +class A: + """ + A + """ + +class B(A): + """ + B + """ + +class C(B): + """ + C + """ + +class X: + pass diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi new file mode 100644 index 00000000..5ed9ef3c --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi @@ -0,0 +1,31 @@ +from __future__ import annotations + +import sys as sys +import typing as typing + +from demo.pure_python.functions_3_8_plus import args_mix +from demo.pure_python.functions_3_9_plus import generic_alias_annotation + +__all__: list[str] = [ + "accept_frozenset", + "args_mix", + "builtin_function_as_default_arg", + "function_as_default_arg", + "generic_alias_annotation", + "lambda_as_default_arg", + "search", + "static_method_as_default_arg", + "sys", + "typing", +] + +class _Dummy: + @staticmethod + def foo(): ... + +def accept_frozenset(arg: frozenset[int | float]) -> int | None: ... +def builtin_function_as_default_arg(func: type(len) = len): ... +def function_as_default_arg(func: type(search) = search): ... +def lambda_as_default_arg(callback=...): ... +def search(a: int, b: list[int]) -> int: ... +def static_method_as_default_arg(callback=_Dummy.foo): ... diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi new file mode 100644 index 00000000..e9164220 --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi @@ -0,0 +1,15 @@ +from __future__ import annotations + +import typing as typing + +__all__: list[str] = ["args_mix", "typing"] + +def args_mix( + a: int, + b: float = 0.5, + c: str = "", + *args: int, + x: int = 1, + y=int, + **kwargs: typing.Dict[int, str], +): ... diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_9_plus.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_9_plus.pyi new file mode 100644 index 00000000..59b9b80c --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_9_plus.pyi @@ -0,0 +1,5 @@ +from __future__ import annotations + +__all__: list[str] = ["generic_alias_annotation"] + +def generic_alias_annotation(a: list[tuple[int]], b: dict[int, str]) -> list[float]: ... diff --git a/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/values.pyi b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/values.pyi new file mode 100644 index 00000000..07913391 --- /dev/null +++ b/tests/stubs/python-3.9/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/pure_python/values.pyi @@ -0,0 +1,4 @@ +from __future__ import annotations + +__all__: list[str] = ["callables_dict"] +callables_dict: dict = {"len": len, "int": int} diff --git a/tests/stubs/python-3.9/requirements.txt b/tests/stubs/python-3.9/requirements.txt new file mode 100644 index 00000000..7c84e9c8 --- /dev/null +++ b/tests/stubs/python-3.9/requirements.txt @@ -0,0 +1,6 @@ +black==22.8.0 +cmeel-eigen==3.4.0.2 +isort==5.10.1 +numpy~=1.20 +scipy~=1.0 +typing_extensions==4.7.1 From c828a62815c7f6d292ce6791865646ba7a580621 Mon Sep 17 00:00:00 2001 From: gentlegiantJGC Date: Thu, 11 Sep 2025 17:14:01 +0100 Subject: [PATCH 5/8] Update black for Python 3.12 stubs (#13) --- .../demo/_bindings/classes.pyi | 3 ++ .../demo/_bindings/eigen.pyi | 38 ++++++++++--------- .../demo/_bindings/numpy.pyi | 2 +- .../demo/_bindings/properties.pyi | 7 ++++ .../demo/_bindings/stl.pyi | 2 +- .../demo/_bindings/stl_bind.pyi | 17 +++++++++ .../demo/_bindings/classes.pyi | 3 ++ .../demo/_bindings/eigen.pyi | 38 ++++++++++--------- .../demo/_bindings/numpy.pyi | 2 +- .../demo/_bindings/properties.pyi | 7 ++++ .../demo/_bindings/stl.pyi | 2 +- .../demo/_bindings/stl_bind.pyi | 17 +++++++++ .../demo/_bindings/classes.pyi | 3 ++ .../demo/_bindings/eigen.pyi | 32 ++++++++-------- .../demo/_bindings/numpy.pyi | 4 +- .../demo/_bindings/properties.pyi | 7 ++++ .../demo/_bindings/stl.pyi | 2 +- .../demo/_bindings/stl_bind.pyi | 17 +++++++++ .../demo/_bindings/classes.pyi | 3 ++ .../demo/_bindings/eigen.pyi | 38 ++++++++++--------- .../demo/_bindings/numpy.pyi | 2 +- .../demo/_bindings/properties.pyi | 7 ++++ .../demo/_bindings/stl.pyi | 2 +- .../demo/_bindings/stl_bind.pyi | 17 +++++++++ .../demo/_bindings/classes.pyi | 3 ++ .../demo/_bindings/eigen.pyi | 38 ++++++++++--------- .../demo/_bindings/numpy.pyi | 2 +- .../demo/_bindings/properties.pyi | 7 ++++ .../demo/_bindings/stl_bind.pyi | 17 +++++++++ tests/stubs/python-3.12/requirements.txt | 2 +- 30 files changed, 247 insertions(+), 94 deletions(-) diff --git a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi index ea36dda6..bdc4a13e 100644 --- a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi @@ -7,6 +7,7 @@ __all__: list[str] = ["Base", "CppException", "Derived", "Foo", "Outer"] class Base: class Inner: pass + name: str class CppException(Exception): @@ -53,5 +54,7 @@ class Outer: def name(self) -> str: ... @property def value(self) -> int: ... + value: Outer.Inner.NestedEnum + inner: Outer.Inner diff --git a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi index 8e453374..7c1d4e96 100644 --- a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi @@ -25,24 +25,24 @@ __all__: list[str] = [ def accept_matrix_int( arg0: typing.Annotated[ numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3) - ] + ], ) -> None: ... def accept_vector_float64( arg0: typing.Annotated[ numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1) - ] + ], ) -> None: ... def dense_matrix_c( arg0: typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") - ] + ], ) -> typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") ]: ... def dense_matrix_r( arg0: typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") - ] + ], ) -> typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") ]: ... @@ -52,7 +52,7 @@ def fixed_mutator_a( numpy.float32, pybind11_stubgen.typing_ext.FixedSize(5, 6), numpy.ndarray.flags.writeable, - ] + ], ) -> None: ... def fixed_mutator_c( arg0: typing.Annotated[ @@ -61,7 +61,7 @@ def fixed_mutator_c( pybind11_stubgen.typing_ext.FixedSize(5, 6), numpy.ndarray.flags.writeable, numpy.ndarray.flags.f_contiguous, - ] + ], ) -> None: ... def fixed_mutator_r( arg0: typing.Annotated[ @@ -70,31 +70,35 @@ def fixed_mutator_r( pybind11_stubgen.typing_ext.FixedSize(5, 6), numpy.ndarray.flags.writeable, numpy.ndarray.flags.c_contiguous, - ] + ], ) -> None: ... def four_col_matrix_r( arg0: typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", 4) - ] + ], ) -> typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", 4) ]: ... def four_row_matrix_r( arg0: typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize(4, "n") - ] + ], ) -> typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize(4, "n") ]: ... -def get_matrix_int() -> typing.Annotated[ - numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3) -]: ... -def get_vector_float64() -> typing.Annotated[ - numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1) -]: ... +def get_matrix_int() -> ( + typing.Annotated[ + numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3) + ] +): ... +def get_vector_float64() -> ( + typing.Annotated[ + numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1) + ] +): ... def sparse_matrix_c( - arg0: typing.Annotated[scipy.sparse.csc_matrix, numpy.float32] + arg0: typing.Annotated[scipy.sparse.csc_matrix, numpy.float32], ) -> typing.Annotated[scipy.sparse.csc_matrix, numpy.float32]: ... def sparse_matrix_r( - arg0: typing.Annotated[scipy.sparse.csr_matrix, numpy.float32] + arg0: typing.Annotated[scipy.sparse.csr_matrix, numpy.float32], ) -> typing.Annotated[scipy.sparse.csr_matrix, numpy.float32]: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi index e211caaf..34943048 100644 --- a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi @@ -13,7 +13,7 @@ __all__: list[str] = [ ] def accept_ndarray_float64( - arg0: typing.Annotated[numpy.ndarray, numpy.float64] + arg0: typing.Annotated[numpy.ndarray, numpy.float64], ) -> None: ... def accept_ndarray_int(arg0: typing.Annotated[numpy.ndarray, numpy.int32]) -> None: ... def get_ndarray_float64() -> typing.Annotated[numpy.ndarray, numpy.float64]: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi index 9d81595c..492380b4 100644 --- a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi @@ -21,11 +21,13 @@ class WithGetterSetterDoc: """ getter doc token """ + @def_property.setter def def_property(self, arg1: int) -> None: """ setter doc token """ + @property def def_property_readonly(self) -> int: """ @@ -44,6 +46,7 @@ class WithPropAndGetterSetterDoc: """ prop doc token """ + @def_property.setter def def_property(self, arg1: int) -> None: ... @property @@ -64,6 +67,7 @@ class WithPropDoc: """ prop doc token """ + @def_property.setter def def_property(self, arg1: int) -> None: ... @property @@ -71,16 +75,19 @@ class WithPropDoc: """ prop doc token """ + @property def def_readonly(self) -> int: """ prop doc token """ + @property def def_readwrite(self) -> int: """ prop doc token """ + @def_readwrite.setter def def_readwrite(self, arg0: int) -> None: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi index bd5bb496..e0faec55 100644 --- a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi @@ -13,7 +13,7 @@ __all__: list[str] = [ ] def std_array( - arg0: typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)] + arg0: typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)], ) -> typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)]: ... def std_map() -> dict[int, complex]: ... def std_optional(arg0: int | None) -> None: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi index 3547ce70..e9d68305 100644 --- a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi @@ -14,6 +14,7 @@ class MapStringComplex: """ Check whether the map is nonempty """ + @typing.overload def __contains__(self, arg0: str) -> bool: ... @typing.overload @@ -27,6 +28,7 @@ class MapStringComplex: """ Return the canonical string representation of this map. """ + def __setitem__(self, arg0: str, arg1: complex) -> None: ... def items(self) -> typing.ItemsView[str, complex]: ... def keys(self) -> typing.KeysView[str]: ... @@ -38,26 +40,31 @@ class VectorPairStringDouble: """ Check whether the list is nonempty """ + def __contains__(self, x: tuple[str, float]) -> bool: """ Return true the container contains ``x`` """ + @typing.overload def __delitem__(self, arg0: int) -> None: """ Delete the list elements at index ``i`` """ + @typing.overload def __delitem__(self, arg0: slice) -> None: """ Delete list elements using a slice object """ + def __eq__(self, arg0: VectorPairStringDouble) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> VectorPairStringDouble: """ Retrieve list elements using a slice object """ + @typing.overload def __getitem__(self, arg0: int) -> tuple[str, float]: ... @typing.overload @@ -67,6 +74,7 @@ class VectorPairStringDouble: """ Copy constructor """ + @typing.overload def __init__(self, arg0: typing.Iterable) -> None: ... def __iter__(self) -> typing.Iterator: ... @@ -79,42 +87,51 @@ class VectorPairStringDouble: """ Assign list elements using a slice object """ + def append(self, x: tuple[str, float]) -> None: """ Add an item to the end of the list """ + def clear(self) -> None: """ Clear the contents """ + def count(self, x: tuple[str, float]) -> int: """ Return the number of times ``x`` appears in the list """ + @typing.overload def extend(self, L: VectorPairStringDouble) -> None: """ Extend the list by appending all the items in the given list """ + @typing.overload def extend(self, L: typing.Iterable) -> None: """ Extend the list by appending all the items in the given list """ + def insert(self, i: int, x: tuple[str, float]) -> None: """ Insert an item at a given position. """ + @typing.overload def pop(self) -> tuple[str, float]: """ Remove and return the last item """ + @typing.overload def pop(self, i: int) -> tuple[str, float]: """ Remove and return the item at index ``i`` """ + def remove(self, x: tuple[str, float]) -> None: """ Remove the first item from the list whose value is x. It is an error if there is no such item. diff --git a/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi b/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi index ea36dda6..bdc4a13e 100644 --- a/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi @@ -7,6 +7,7 @@ __all__: list[str] = ["Base", "CppException", "Derived", "Foo", "Outer"] class Base: class Inner: pass + name: str class CppException(Exception): @@ -53,5 +54,7 @@ class Outer: def name(self) -> str: ... @property def value(self) -> int: ... + value: Outer.Inner.NestedEnum + inner: Outer.Inner diff --git a/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi b/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi index 8e453374..7c1d4e96 100644 --- a/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi @@ -25,24 +25,24 @@ __all__: list[str] = [ def accept_matrix_int( arg0: typing.Annotated[ numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3) - ] + ], ) -> None: ... def accept_vector_float64( arg0: typing.Annotated[ numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1) - ] + ], ) -> None: ... def dense_matrix_c( arg0: typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") - ] + ], ) -> typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") ]: ... def dense_matrix_r( arg0: typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") - ] + ], ) -> typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") ]: ... @@ -52,7 +52,7 @@ def fixed_mutator_a( numpy.float32, pybind11_stubgen.typing_ext.FixedSize(5, 6), numpy.ndarray.flags.writeable, - ] + ], ) -> None: ... def fixed_mutator_c( arg0: typing.Annotated[ @@ -61,7 +61,7 @@ def fixed_mutator_c( pybind11_stubgen.typing_ext.FixedSize(5, 6), numpy.ndarray.flags.writeable, numpy.ndarray.flags.f_contiguous, - ] + ], ) -> None: ... def fixed_mutator_r( arg0: typing.Annotated[ @@ -70,31 +70,35 @@ def fixed_mutator_r( pybind11_stubgen.typing_ext.FixedSize(5, 6), numpy.ndarray.flags.writeable, numpy.ndarray.flags.c_contiguous, - ] + ], ) -> None: ... def four_col_matrix_r( arg0: typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", 4) - ] + ], ) -> typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", 4) ]: ... def four_row_matrix_r( arg0: typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize(4, "n") - ] + ], ) -> typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize(4, "n") ]: ... -def get_matrix_int() -> typing.Annotated[ - numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3) -]: ... -def get_vector_float64() -> typing.Annotated[ - numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1) -]: ... +def get_matrix_int() -> ( + typing.Annotated[ + numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3) + ] +): ... +def get_vector_float64() -> ( + typing.Annotated[ + numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1) + ] +): ... def sparse_matrix_c( - arg0: typing.Annotated[scipy.sparse.csc_matrix, numpy.float32] + arg0: typing.Annotated[scipy.sparse.csc_matrix, numpy.float32], ) -> typing.Annotated[scipy.sparse.csc_matrix, numpy.float32]: ... def sparse_matrix_r( - arg0: typing.Annotated[scipy.sparse.csr_matrix, numpy.float32] + arg0: typing.Annotated[scipy.sparse.csr_matrix, numpy.float32], ) -> typing.Annotated[scipy.sparse.csr_matrix, numpy.float32]: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi b/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi index e211caaf..34943048 100644 --- a/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi @@ -13,7 +13,7 @@ __all__: list[str] = [ ] def accept_ndarray_float64( - arg0: typing.Annotated[numpy.ndarray, numpy.float64] + arg0: typing.Annotated[numpy.ndarray, numpy.float64], ) -> None: ... def accept_ndarray_int(arg0: typing.Annotated[numpy.ndarray, numpy.int32]) -> None: ... def get_ndarray_float64() -> typing.Annotated[numpy.ndarray, numpy.float64]: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi b/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi index 9d81595c..492380b4 100644 --- a/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi @@ -21,11 +21,13 @@ class WithGetterSetterDoc: """ getter doc token """ + @def_property.setter def def_property(self, arg1: int) -> None: """ setter doc token """ + @property def def_property_readonly(self) -> int: """ @@ -44,6 +46,7 @@ class WithPropAndGetterSetterDoc: """ prop doc token """ + @def_property.setter def def_property(self, arg1: int) -> None: ... @property @@ -64,6 +67,7 @@ class WithPropDoc: """ prop doc token """ + @def_property.setter def def_property(self, arg1: int) -> None: ... @property @@ -71,16 +75,19 @@ class WithPropDoc: """ prop doc token """ + @property def def_readonly(self) -> int: """ prop doc token """ + @property def def_readwrite(self) -> int: """ prop doc token """ + @def_readwrite.setter def def_readwrite(self, arg0: int) -> None: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi b/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi index bd5bb496..e0faec55 100644 --- a/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi @@ -13,7 +13,7 @@ __all__: list[str] = [ ] def std_array( - arg0: typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)] + arg0: typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)], ) -> typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)]: ... def std_map() -> dict[int, complex]: ... def std_optional(arg0: int | None) -> None: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi b/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi index 6f1f9b67..f51d6c50 100644 --- a/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi @@ -14,6 +14,7 @@ class MapStringComplex: """ Check whether the map is nonempty """ + @typing.overload def __contains__(self, arg0: str) -> bool: ... @typing.overload @@ -27,6 +28,7 @@ class MapStringComplex: """ Return the canonical string representation of this map. """ + def __setitem__(self, arg0: str, arg1: complex) -> None: ... def items(self) -> typing.ItemsView: ... def keys(self) -> typing.KeysView: ... @@ -38,26 +40,31 @@ class VectorPairStringDouble: """ Check whether the list is nonempty """ + def __contains__(self, x: tuple[str, float]) -> bool: """ Return true the container contains ``x`` """ + @typing.overload def __delitem__(self, arg0: int) -> None: """ Delete the list elements at index ``i`` """ + @typing.overload def __delitem__(self, arg0: slice) -> None: """ Delete list elements using a slice object """ + def __eq__(self, arg0: VectorPairStringDouble) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> VectorPairStringDouble: """ Retrieve list elements using a slice object """ + @typing.overload def __getitem__(self, arg0: int) -> tuple[str, float]: ... @typing.overload @@ -67,6 +74,7 @@ class VectorPairStringDouble: """ Copy constructor """ + @typing.overload def __init__(self, arg0: typing.Iterable) -> None: ... def __iter__(self) -> typing.Iterator[tuple[str, float]]: ... @@ -79,42 +87,51 @@ class VectorPairStringDouble: """ Assign list elements using a slice object """ + def append(self, x: tuple[str, float]) -> None: """ Add an item to the end of the list """ + def clear(self) -> None: """ Clear the contents """ + def count(self, x: tuple[str, float]) -> int: """ Return the number of times ``x`` appears in the list """ + @typing.overload def extend(self, L: VectorPairStringDouble) -> None: """ Extend the list by appending all the items in the given list """ + @typing.overload def extend(self, L: typing.Iterable) -> None: """ Extend the list by appending all the items in the given list """ + def insert(self, i: int, x: tuple[str, float]) -> None: """ Insert an item at a given position. """ + @typing.overload def pop(self) -> tuple[str, float]: """ Remove and return the last item """ + @typing.overload def pop(self, i: int) -> tuple[str, float]: """ Remove and return the item at index ``i`` """ + def remove(self, x: tuple[str, float]) -> None: """ Remove the first item from the list whose value is x. It is an error if there is no such item. diff --git a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/classes.pyi b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/classes.pyi index ea36dda6..bdc4a13e 100644 --- a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/classes.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/classes.pyi @@ -7,6 +7,7 @@ __all__: list[str] = ["Base", "CppException", "Derived", "Foo", "Outer"] class Base: class Inner: pass + name: str class CppException(Exception): @@ -53,5 +54,7 @@ class Outer: def name(self) -> str: ... @property def value(self) -> int: ... + value: Outer.Inner.NestedEnum + inner: Outer.Inner diff --git a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/eigen.pyi b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/eigen.pyi index 742d2eea..f5111a0a 100644 --- a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/eigen.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/eigen.pyi @@ -26,45 +26,47 @@ N = typing.TypeVar("N", bound=int) def accept_matrix_int( arg0: numpy.ndarray[ tuple[typing.Literal[3], typing.Literal[3]], numpy.dtype[numpy.int32] - ] + ], ) -> None: ... def accept_vector_float64( arg0: numpy.ndarray[ tuple[typing.Literal[3], typing.Literal[1]], numpy.dtype[numpy.float64] - ] + ], ) -> None: ... def dense_matrix_c( - arg0: numpy.ndarray[tuple[M, N], numpy.dtype[numpy.float32]] + arg0: numpy.ndarray[tuple[M, N], numpy.dtype[numpy.float32]], ) -> numpy.ndarray[tuple[M, N], numpy.dtype[numpy.float32]]: ... def dense_matrix_r( - arg0: numpy.ndarray[tuple[M, N], numpy.dtype[numpy.float32]] + arg0: numpy.ndarray[tuple[M, N], numpy.dtype[numpy.float32]], ) -> numpy.ndarray[tuple[M, N], numpy.dtype[numpy.float32]]: ... def fixed_mutator_a( arg0: numpy.ndarray[ tuple[typing.Literal[5], typing.Literal[6]], numpy.dtype[numpy.float32] - ] + ], ) -> None: ... def fixed_mutator_c( arg0: numpy.ndarray[ tuple[typing.Literal[5], typing.Literal[6]], numpy.dtype[numpy.float32] - ] + ], ) -> None: ... def fixed_mutator_r( arg0: numpy.ndarray[ tuple[typing.Literal[5], typing.Literal[6]], numpy.dtype[numpy.float32] - ] + ], ) -> None: ... def four_col_matrix_r( - arg0: numpy.ndarray[tuple[M, typing.Literal[4]], numpy.dtype[numpy.float32]] + arg0: numpy.ndarray[tuple[M, typing.Literal[4]], numpy.dtype[numpy.float32]], ) -> numpy.ndarray[tuple[M, typing.Literal[4]], numpy.dtype[numpy.float32]]: ... def four_row_matrix_r( - arg0: numpy.ndarray[tuple[typing.Literal[4], N], numpy.dtype[numpy.float32]] + arg0: numpy.ndarray[tuple[typing.Literal[4], N], numpy.dtype[numpy.float32]], ) -> numpy.ndarray[tuple[typing.Literal[4], N], numpy.dtype[numpy.float32]]: ... -def get_matrix_int() -> numpy.ndarray[ - tuple[typing.Literal[3], typing.Literal[3]], numpy.dtype[numpy.int32] -]: ... -def get_vector_float64() -> numpy.ndarray[ - tuple[typing.Literal[3], typing.Literal[1]], numpy.dtype[numpy.float64] -]: ... +def get_matrix_int() -> ( + numpy.ndarray[tuple[typing.Literal[3], typing.Literal[3]], numpy.dtype[numpy.int32]] +): ... +def get_vector_float64() -> ( + numpy.ndarray[ + tuple[typing.Literal[3], typing.Literal[1]], numpy.dtype[numpy.float64] + ] +): ... def sparse_matrix_c(arg0: scipy.sparse.csc_matrix) -> scipy.sparse.csc_matrix: ... def sparse_matrix_r(arg0: scipy.sparse.csr_matrix) -> scipy.sparse.csr_matrix: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/numpy.pyi b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/numpy.pyi index 08714c58..19245c5d 100644 --- a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/numpy.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/numpy.pyi @@ -13,10 +13,10 @@ __all__: list[str] = [ ] def accept_ndarray_float64( - arg0: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]] + arg0: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], ) -> None: ... def accept_ndarray_int( - arg0: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]] + arg0: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], ) -> None: ... def get_ndarray_float64() -> numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]]: ... def get_ndarray_int() -> numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]]: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/properties.pyi b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/properties.pyi index 9d81595c..492380b4 100644 --- a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/properties.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/properties.pyi @@ -21,11 +21,13 @@ class WithGetterSetterDoc: """ getter doc token """ + @def_property.setter def def_property(self, arg1: int) -> None: """ setter doc token """ + @property def def_property_readonly(self) -> int: """ @@ -44,6 +46,7 @@ class WithPropAndGetterSetterDoc: """ prop doc token """ + @def_property.setter def def_property(self, arg1: int) -> None: ... @property @@ -64,6 +67,7 @@ class WithPropDoc: """ prop doc token """ + @def_property.setter def def_property(self, arg1: int) -> None: ... @property @@ -71,16 +75,19 @@ class WithPropDoc: """ prop doc token """ + @property def def_readonly(self) -> int: """ prop doc token """ + @property def def_readwrite(self) -> int: """ prop doc token """ + @def_readwrite.setter def def_readwrite(self, arg0: int) -> None: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/stl.pyi b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/stl.pyi index bd5bb496..e0faec55 100644 --- a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/stl.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/stl.pyi @@ -13,7 +13,7 @@ __all__: list[str] = [ ] def std_array( - arg0: typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)] + arg0: typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)], ) -> typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)]: ... def std_map() -> dict[int, complex]: ... def std_optional(arg0: int | None) -> None: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/stl_bind.pyi b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/stl_bind.pyi index 6f1f9b67..f51d6c50 100644 --- a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/stl_bind.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-use-type-var/demo/_bindings/stl_bind.pyi @@ -14,6 +14,7 @@ class MapStringComplex: """ Check whether the map is nonempty """ + @typing.overload def __contains__(self, arg0: str) -> bool: ... @typing.overload @@ -27,6 +28,7 @@ class MapStringComplex: """ Return the canonical string representation of this map. """ + def __setitem__(self, arg0: str, arg1: complex) -> None: ... def items(self) -> typing.ItemsView: ... def keys(self) -> typing.KeysView: ... @@ -38,26 +40,31 @@ class VectorPairStringDouble: """ Check whether the list is nonempty """ + def __contains__(self, x: tuple[str, float]) -> bool: """ Return true the container contains ``x`` """ + @typing.overload def __delitem__(self, arg0: int) -> None: """ Delete the list elements at index ``i`` """ + @typing.overload def __delitem__(self, arg0: slice) -> None: """ Delete list elements using a slice object """ + def __eq__(self, arg0: VectorPairStringDouble) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> VectorPairStringDouble: """ Retrieve list elements using a slice object """ + @typing.overload def __getitem__(self, arg0: int) -> tuple[str, float]: ... @typing.overload @@ -67,6 +74,7 @@ class VectorPairStringDouble: """ Copy constructor """ + @typing.overload def __init__(self, arg0: typing.Iterable) -> None: ... def __iter__(self) -> typing.Iterator[tuple[str, float]]: ... @@ -79,42 +87,51 @@ class VectorPairStringDouble: """ Assign list elements using a slice object """ + def append(self, x: tuple[str, float]) -> None: """ Add an item to the end of the list """ + def clear(self) -> None: """ Clear the contents """ + def count(self, x: tuple[str, float]) -> int: """ Return the number of times ``x`` appears in the list """ + @typing.overload def extend(self, L: VectorPairStringDouble) -> None: """ Extend the list by appending all the items in the given list """ + @typing.overload def extend(self, L: typing.Iterable) -> None: """ Extend the list by appending all the items in the given list """ + def insert(self, i: int, x: tuple[str, float]) -> None: """ Insert an item at a given position. """ + @typing.overload def pop(self) -> tuple[str, float]: """ Remove and return the last item """ + @typing.overload def pop(self, i: int) -> tuple[str, float]: """ Remove and return the item at index ``i`` """ + def remove(self, x: tuple[str, float]) -> None: """ Remove the first item from the list whose value is x. It is an error if there is no such item. diff --git a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi index ea36dda6..bdc4a13e 100644 --- a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi @@ -7,6 +7,7 @@ __all__: list[str] = ["Base", "CppException", "Derived", "Foo", "Outer"] class Base: class Inner: pass + name: str class CppException(Exception): @@ -53,5 +54,7 @@ class Outer: def name(self) -> str: ... @property def value(self) -> int: ... + value: Outer.Inner.NestedEnum + inner: Outer.Inner diff --git a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi index 8e453374..7c1d4e96 100644 --- a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi @@ -25,24 +25,24 @@ __all__: list[str] = [ def accept_matrix_int( arg0: typing.Annotated[ numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3) - ] + ], ) -> None: ... def accept_vector_float64( arg0: typing.Annotated[ numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1) - ] + ], ) -> None: ... def dense_matrix_c( arg0: typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") - ] + ], ) -> typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") ]: ... def dense_matrix_r( arg0: typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") - ] + ], ) -> typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") ]: ... @@ -52,7 +52,7 @@ def fixed_mutator_a( numpy.float32, pybind11_stubgen.typing_ext.FixedSize(5, 6), numpy.ndarray.flags.writeable, - ] + ], ) -> None: ... def fixed_mutator_c( arg0: typing.Annotated[ @@ -61,7 +61,7 @@ def fixed_mutator_c( pybind11_stubgen.typing_ext.FixedSize(5, 6), numpy.ndarray.flags.writeable, numpy.ndarray.flags.f_contiguous, - ] + ], ) -> None: ... def fixed_mutator_r( arg0: typing.Annotated[ @@ -70,31 +70,35 @@ def fixed_mutator_r( pybind11_stubgen.typing_ext.FixedSize(5, 6), numpy.ndarray.flags.writeable, numpy.ndarray.flags.c_contiguous, - ] + ], ) -> None: ... def four_col_matrix_r( arg0: typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", 4) - ] + ], ) -> typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", 4) ]: ... def four_row_matrix_r( arg0: typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize(4, "n") - ] + ], ) -> typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize(4, "n") ]: ... -def get_matrix_int() -> typing.Annotated[ - numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3) -]: ... -def get_vector_float64() -> typing.Annotated[ - numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1) -]: ... +def get_matrix_int() -> ( + typing.Annotated[ + numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3) + ] +): ... +def get_vector_float64() -> ( + typing.Annotated[ + numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1) + ] +): ... def sparse_matrix_c( - arg0: typing.Annotated[scipy.sparse.csc_matrix, numpy.float32] + arg0: typing.Annotated[scipy.sparse.csc_matrix, numpy.float32], ) -> typing.Annotated[scipy.sparse.csc_matrix, numpy.float32]: ... def sparse_matrix_r( - arg0: typing.Annotated[scipy.sparse.csr_matrix, numpy.float32] + arg0: typing.Annotated[scipy.sparse.csr_matrix, numpy.float32], ) -> typing.Annotated[scipy.sparse.csr_matrix, numpy.float32]: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi index e211caaf..34943048 100644 --- a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi @@ -13,7 +13,7 @@ __all__: list[str] = [ ] def accept_ndarray_float64( - arg0: typing.Annotated[numpy.ndarray, numpy.float64] + arg0: typing.Annotated[numpy.ndarray, numpy.float64], ) -> None: ... def accept_ndarray_int(arg0: typing.Annotated[numpy.ndarray, numpy.int32]) -> None: ... def get_ndarray_float64() -> typing.Annotated[numpy.ndarray, numpy.float64]: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi index 9d81595c..492380b4 100644 --- a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi @@ -21,11 +21,13 @@ class WithGetterSetterDoc: """ getter doc token """ + @def_property.setter def def_property(self, arg1: int) -> None: """ setter doc token """ + @property def def_property_readonly(self) -> int: """ @@ -44,6 +46,7 @@ class WithPropAndGetterSetterDoc: """ prop doc token """ + @def_property.setter def def_property(self, arg1: int) -> None: ... @property @@ -64,6 +67,7 @@ class WithPropDoc: """ prop doc token """ + @def_property.setter def def_property(self, arg1: int) -> None: ... @property @@ -71,16 +75,19 @@ class WithPropDoc: """ prop doc token """ + @property def def_readonly(self) -> int: """ prop doc token """ + @property def def_readwrite(self) -> int: """ prop doc token """ + @def_readwrite.setter def def_readwrite(self, arg0: int) -> None: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi index bd5bb496..e0faec55 100644 --- a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi @@ -13,7 +13,7 @@ __all__: list[str] = [ ] def std_array( - arg0: typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)] + arg0: typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)], ) -> typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)]: ... def std_map() -> dict[int, complex]: ... def std_optional(arg0: int | None) -> None: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi index 6f1f9b67..f51d6c50 100644 --- a/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.13/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi @@ -14,6 +14,7 @@ class MapStringComplex: """ Check whether the map is nonempty """ + @typing.overload def __contains__(self, arg0: str) -> bool: ... @typing.overload @@ -27,6 +28,7 @@ class MapStringComplex: """ Return the canonical string representation of this map. """ + def __setitem__(self, arg0: str, arg1: complex) -> None: ... def items(self) -> typing.ItemsView: ... def keys(self) -> typing.KeysView: ... @@ -38,26 +40,31 @@ class VectorPairStringDouble: """ Check whether the list is nonempty """ + def __contains__(self, x: tuple[str, float]) -> bool: """ Return true the container contains ``x`` """ + @typing.overload def __delitem__(self, arg0: int) -> None: """ Delete the list elements at index ``i`` """ + @typing.overload def __delitem__(self, arg0: slice) -> None: """ Delete list elements using a slice object """ + def __eq__(self, arg0: VectorPairStringDouble) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> VectorPairStringDouble: """ Retrieve list elements using a slice object """ + @typing.overload def __getitem__(self, arg0: int) -> tuple[str, float]: ... @typing.overload @@ -67,6 +74,7 @@ class VectorPairStringDouble: """ Copy constructor """ + @typing.overload def __init__(self, arg0: typing.Iterable) -> None: ... def __iter__(self) -> typing.Iterator[tuple[str, float]]: ... @@ -79,42 +87,51 @@ class VectorPairStringDouble: """ Assign list elements using a slice object """ + def append(self, x: tuple[str, float]) -> None: """ Add an item to the end of the list """ + def clear(self) -> None: """ Clear the contents """ + def count(self, x: tuple[str, float]) -> int: """ Return the number of times ``x`` appears in the list """ + @typing.overload def extend(self, L: VectorPairStringDouble) -> None: """ Extend the list by appending all the items in the given list """ + @typing.overload def extend(self, L: typing.Iterable) -> None: """ Extend the list by appending all the items in the given list """ + def insert(self, i: int, x: tuple[str, float]) -> None: """ Insert an item at a given position. """ + @typing.overload def pop(self) -> tuple[str, float]: """ Remove and return the last item """ + @typing.overload def pop(self, i: int) -> tuple[str, float]: """ Remove and return the item at index ``i`` """ + def remove(self, x: tuple[str, float]) -> None: """ Remove the first item from the list whose value is x. It is an error if there is no such item. diff --git a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi index ea36dda6..bdc4a13e 100644 --- a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi @@ -7,6 +7,7 @@ __all__: list[str] = ["Base", "CppException", "Derived", "Foo", "Outer"] class Base: class Inner: pass + name: str class CppException(Exception): @@ -53,5 +54,7 @@ class Outer: def name(self) -> str: ... @property def value(self) -> int: ... + value: Outer.Inner.NestedEnum + inner: Outer.Inner diff --git a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi index 8e453374..7c1d4e96 100644 --- a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi @@ -25,24 +25,24 @@ __all__: list[str] = [ def accept_matrix_int( arg0: typing.Annotated[ numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3) - ] + ], ) -> None: ... def accept_vector_float64( arg0: typing.Annotated[ numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1) - ] + ], ) -> None: ... def dense_matrix_c( arg0: typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") - ] + ], ) -> typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") ]: ... def dense_matrix_r( arg0: typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") - ] + ], ) -> typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n") ]: ... @@ -52,7 +52,7 @@ def fixed_mutator_a( numpy.float32, pybind11_stubgen.typing_ext.FixedSize(5, 6), numpy.ndarray.flags.writeable, - ] + ], ) -> None: ... def fixed_mutator_c( arg0: typing.Annotated[ @@ -61,7 +61,7 @@ def fixed_mutator_c( pybind11_stubgen.typing_ext.FixedSize(5, 6), numpy.ndarray.flags.writeable, numpy.ndarray.flags.f_contiguous, - ] + ], ) -> None: ... def fixed_mutator_r( arg0: typing.Annotated[ @@ -70,31 +70,35 @@ def fixed_mutator_r( pybind11_stubgen.typing_ext.FixedSize(5, 6), numpy.ndarray.flags.writeable, numpy.ndarray.flags.c_contiguous, - ] + ], ) -> None: ... def four_col_matrix_r( arg0: typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", 4) - ] + ], ) -> typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", 4) ]: ... def four_row_matrix_r( arg0: typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize(4, "n") - ] + ], ) -> typing.Annotated[ numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize(4, "n") ]: ... -def get_matrix_int() -> typing.Annotated[ - numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3) -]: ... -def get_vector_float64() -> typing.Annotated[ - numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1) -]: ... +def get_matrix_int() -> ( + typing.Annotated[ + numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3) + ] +): ... +def get_vector_float64() -> ( + typing.Annotated[ + numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1) + ] +): ... def sparse_matrix_c( - arg0: typing.Annotated[scipy.sparse.csc_matrix, numpy.float32] + arg0: typing.Annotated[scipy.sparse.csc_matrix, numpy.float32], ) -> typing.Annotated[scipy.sparse.csc_matrix, numpy.float32]: ... def sparse_matrix_r( - arg0: typing.Annotated[scipy.sparse.csr_matrix, numpy.float32] + arg0: typing.Annotated[scipy.sparse.csr_matrix, numpy.float32], ) -> typing.Annotated[scipy.sparse.csr_matrix, numpy.float32]: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi index e211caaf..34943048 100644 --- a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi @@ -13,7 +13,7 @@ __all__: list[str] = [ ] def accept_ndarray_float64( - arg0: typing.Annotated[numpy.ndarray, numpy.float64] + arg0: typing.Annotated[numpy.ndarray, numpy.float64], ) -> None: ... def accept_ndarray_int(arg0: typing.Annotated[numpy.ndarray, numpy.int32]) -> None: ... def get_ndarray_float64() -> typing.Annotated[numpy.ndarray, numpy.float64]: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi index 9d81595c..492380b4 100644 --- a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi @@ -21,11 +21,13 @@ class WithGetterSetterDoc: """ getter doc token """ + @def_property.setter def def_property(self, arg1: int) -> None: """ setter doc token """ + @property def def_property_readonly(self) -> int: """ @@ -44,6 +46,7 @@ class WithPropAndGetterSetterDoc: """ prop doc token """ + @def_property.setter def def_property(self, arg1: int) -> None: ... @property @@ -64,6 +67,7 @@ class WithPropDoc: """ prop doc token """ + @def_property.setter def def_property(self, arg1: int) -> None: ... @property @@ -71,16 +75,19 @@ class WithPropDoc: """ prop doc token """ + @property def def_readonly(self) -> int: """ prop doc token """ + @property def def_readwrite(self) -> int: """ prop doc token """ + @def_readwrite.setter def def_readwrite(self, arg0: int) -> None: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi index 7133e4cc..0f82bb19 100644 --- a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi @@ -14,6 +14,7 @@ class MapStringComplex: """ Check whether the map is nonempty """ + @typing.overload def __contains__(self, arg0: str) -> bool: ... @typing.overload @@ -27,6 +28,7 @@ class MapStringComplex: """ Return the canonical string representation of this map. """ + def __setitem__(self, arg0: str, arg1: complex) -> None: ... def items(self) -> typing.ItemsView[MapStringComplex]: ... def keys(self) -> typing.KeysView[MapStringComplex]: ... @@ -38,26 +40,31 @@ class VectorPairStringDouble: """ Check whether the list is nonempty """ + def __contains__(self, x: tuple[str, float]) -> bool: """ Return true the container contains ``x`` """ + @typing.overload def __delitem__(self, arg0: int) -> None: """ Delete the list elements at index ``i`` """ + @typing.overload def __delitem__(self, arg0: slice) -> None: """ Delete list elements using a slice object """ + def __eq__(self, arg0: VectorPairStringDouble) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> VectorPairStringDouble: """ Retrieve list elements using a slice object """ + @typing.overload def __getitem__(self, arg0: int) -> tuple[str, float]: ... @typing.overload @@ -67,6 +74,7 @@ class VectorPairStringDouble: """ Copy constructor """ + @typing.overload def __init__(self, arg0: typing.Iterable) -> None: ... def __iter__(self) -> typing.Iterator: ... @@ -79,42 +87,51 @@ class VectorPairStringDouble: """ Assign list elements using a slice object """ + def append(self, x: tuple[str, float]) -> None: """ Add an item to the end of the list """ + def clear(self) -> None: """ Clear the contents """ + def count(self, x: tuple[str, float]) -> int: """ Return the number of times ``x`` appears in the list """ + @typing.overload def extend(self, L: VectorPairStringDouble) -> None: """ Extend the list by appending all the items in the given list """ + @typing.overload def extend(self, L: typing.Iterable) -> None: """ Extend the list by appending all the items in the given list """ + def insert(self, i: int, x: tuple[str, float]) -> None: """ Insert an item at a given position. """ + @typing.overload def pop(self) -> tuple[str, float]: """ Remove and return the last item """ + @typing.overload def pop(self, i: int) -> tuple[str, float]: """ Remove and return the item at index ``i`` """ + def remove(self, x: tuple[str, float]) -> None: """ Remove the first item from the list whose value is x. It is an error if there is no such item. diff --git a/tests/stubs/python-3.12/requirements.txt b/tests/stubs/python-3.12/requirements.txt index 7c84e9c8..b5a3f6b2 100644 --- a/tests/stubs/python-3.12/requirements.txt +++ b/tests/stubs/python-3.12/requirements.txt @@ -1,4 +1,4 @@ -black==22.8.0 +black==25.1.0 cmeel-eigen==3.4.0.2 isort==5.10.1 numpy~=1.20 From d63fe858988586462364ad3c937c77f37ba91cb0 Mon Sep 17 00:00:00 2001 From: gentlegiantJGC Date: Thu, 11 Sep 2025 17:33:20 +0100 Subject: [PATCH 6/8] Add error logs for each pybind11 version (#14) * Add error logs for each pybind11 version stubgen generates less errors with code from pybind11 v3.0 so it needs its own error log file * Fix symbolic links --- .github/workflows/ci.yml | 2 +- tests/check-demo-errors-generation.sh | 8 +++++++- tests/errors/pybind11-v2.11 | 1 + tests/errors/pybind11-v2.12 | 1 + tests/errors/pybind11-v2.13 | 1 + tests/{ => errors/pybind11-v2.9}/demo.errors.stderr.txt | 0 6 files changed, 11 insertions(+), 2 deletions(-) create mode 120000 tests/errors/pybind11-v2.11 create mode 120000 tests/errors/pybind11-v2.12 create mode 120000 tests/errors/pybind11-v2.13 rename tests/{ => errors/pybind11-v2.9}/demo.errors.stderr.txt (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b106bb93..03d69c17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,7 +97,7 @@ jobs: - name: Check error generation shell: bash - run: ./tests/check-demo-errors-generation.sh + run: ./tests/check-demo-errors-generation.sh "pybind11-${{ matrix.config.pybind11-branch }}" test-cli-options: name: "Runs on 🐍 ${{ matrix.python }} • ${{ matrix.test-package }}" diff --git a/tests/check-demo-errors-generation.sh b/tests/check-demo-errors-generation.sh index 71906c73..255e5e33 100755 --- a/tests/check-demo-errors-generation.sh +++ b/tests/check-demo-errors-generation.sh @@ -2,8 +2,14 @@ set -e +if [ "$#" -ne 1 ]; then + echo "Usage: $0 pybind11-vX.Y" + exit 1 +fi + TESTS_ROOT="$(readlink -m "$(dirname "$0")")" -DEMO_ERRORS_FILE="${TESTS_ROOT}/demo.errors.stderr.txt" +ERRORS_ROOT="$(readlink -m "${TESTS_ROOT}/errors/$1")" +DEMO_ERRORS_FILE="${ERRORS_ROOT}/demo.errors.stderr.txt" STUBS_DIR="/tmp/out" # Stubs should never be actually written remove_demo_errors() { diff --git a/tests/errors/pybind11-v2.11 b/tests/errors/pybind11-v2.11 new file mode 120000 index 00000000..2369df54 --- /dev/null +++ b/tests/errors/pybind11-v2.11 @@ -0,0 +1 @@ +pybind11-v2.9 \ No newline at end of file diff --git a/tests/errors/pybind11-v2.12 b/tests/errors/pybind11-v2.12 new file mode 120000 index 00000000..e6ae88f7 --- /dev/null +++ b/tests/errors/pybind11-v2.12 @@ -0,0 +1 @@ +pybind11-v2.11 \ No newline at end of file diff --git a/tests/errors/pybind11-v2.13 b/tests/errors/pybind11-v2.13 new file mode 120000 index 00000000..6480bdb7 --- /dev/null +++ b/tests/errors/pybind11-v2.13 @@ -0,0 +1 @@ +pybind11-v2.12 \ No newline at end of file diff --git a/tests/demo.errors.stderr.txt b/tests/errors/pybind11-v2.9/demo.errors.stderr.txt similarity index 100% rename from tests/demo.errors.stderr.txt rename to tests/errors/pybind11-v2.9/demo.errors.stderr.txt From 00b5ca2ba1aedc5d4eca1ee9934005f461bc8294 Mon Sep 17 00:00:00 2001 From: gentlegiantJGC Date: Thu, 11 Sep 2025 17:42:26 +0100 Subject: [PATCH 7/8] Add tests for pybind11 v3.0 (#15) --- .github/workflows/ci.yml | 2 + .../pybind11-v3.0/demo.errors.stderr.txt | 15 ++ .../demo/__init__.pyi | 41 +++++ .../demo/_bindings/__init__.pyi | 35 +++++ .../demo/_bindings/aliases/__init__.pyi | 53 +++++++ .../demo/_bindings/aliases/foreign_arg.pyi | 7 + .../demo/_bindings/aliases/foreign_attr.pyi | 6 + .../aliases/foreign_class_member.pyi | 12 ++ .../_bindings/aliases/foreign_method_arg.pyi | 8 + .../aliases/foreign_method_return.pyi | 9 ++ .../demo/_bindings/aliases/foreign_return.pyi | 7 + .../_bindings/aliases/missing_self_arg.pyi | 8 + .../demo/_bindings/classes.pyi | 63 ++++++++ .../demo/_bindings/eigen.pyi | 71 +++++++++ .../demo/_bindings/enum.pyi | 71 +++++++++ .../demo/_bindings/flawed_bindings.pyi | 25 +++ .../demo/_bindings/functions.pyi | 74 +++++++++ .../demo/_bindings/issues.pyi | 39 +++++ .../demo/_bindings/methods.pyi | 10 ++ .../demo/_bindings/numpy.pyi | 24 +++ .../demo/_bindings/properties.pyi | 112 ++++++++++++++ .../demo/_bindings/stl.pyi | 28 ++++ .../demo/_bindings/stl_bind.pyi | 146 ++++++++++++++++++ .../demo/_bindings/typing.pyi | 8 + .../demo/_bindings/values.pyi | 36 +++++ .../numpy-array-use-type-var/demo/core.pyi | 35 +++++ .../demo/pure_python/__init__.pyi | 11 ++ .../demo/pure_python/classes.pyi | 21 +++ .../demo/pure_python/functions.pyi | 31 ++++ .../demo/pure_python/functions_3_8_plus.pyi | 15 ++ .../demo/pure_python/functions_3_9_plus.pyi | 5 + .../demo/pure_python/values.pyi | 4 + .../demo/__init__.pyi | 41 +++++ .../demo/_bindings/__init__.pyi | 35 +++++ .../demo/_bindings/aliases/__init__.pyi | 53 +++++++ .../demo/_bindings/aliases/foreign_arg.pyi | 7 + .../demo/_bindings/aliases/foreign_attr.pyi | 6 + .../aliases/foreign_class_member.pyi | 12 ++ .../_bindings/aliases/foreign_method_arg.pyi | 8 + .../aliases/foreign_method_return.pyi | 9 ++ .../demo/_bindings/aliases/foreign_return.pyi | 7 + .../_bindings/aliases/missing_self_arg.pyi | 8 + .../demo/_bindings/classes.pyi | 63 ++++++++ .../demo/_bindings/eigen.pyi | 75 +++++++++ .../demo/_bindings/enum.pyi | 71 +++++++++ .../demo/_bindings/flawed_bindings.pyi | 25 +++ .../demo/_bindings/functions.pyi | 74 +++++++++ .../demo/_bindings/issues.pyi | 39 +++++ .../demo/_bindings/methods.pyi | 10 ++ .../demo/_bindings/numpy.pyi | 24 +++ .../demo/_bindings/properties.pyi | 112 ++++++++++++++ .../demo/_bindings/stl.pyi | 28 ++++ .../demo/_bindings/stl_bind.pyi | 146 ++++++++++++++++++ .../demo/_bindings/typing.pyi | 8 + .../demo/_bindings/values.pyi | 36 +++++ .../demo/core.pyi | 35 +++++ .../demo/pure_python/__init__.pyi | 11 ++ .../demo/pure_python/classes.pyi | 21 +++ .../demo/pure_python/functions.pyi | 31 ++++ .../demo/pure_python/functions_3_8_plus.pyi | 15 ++ .../demo/pure_python/functions_3_9_plus.pyi | 5 + .../demo/pure_python/values.pyi | 4 + 62 files changed, 2051 insertions(+) create mode 100644 tests/errors/pybind11-v3.0/demo.errors.stderr.txt create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/__init__.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/__init__.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/__init__.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_arg.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_attr.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_class_member.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_method_arg.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_method_return.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_return.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/missing_self_arg.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/classes.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/eigen.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/enum.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/flawed_bindings.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/functions.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/issues.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/methods.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/numpy.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/properties.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/stl.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/stl_bind.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/typing.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/values.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/core.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/__init__.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/classes.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/functions.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/functions_3_8_plus.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/functions_3_9_plus.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/values.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/__init__.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/__init__.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_arg.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_arg.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_return.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_return.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/missing_self_arg.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/functions.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/methods.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/typing.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/core.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/__init__.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/classes.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_9_plus.pyi create mode 100644 tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/values.pyi diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03d69c17..a0b91c20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,8 @@ jobs: fail-fast: false matrix: config: [ + { pybind11-branch: "v3.0", python: "3.13", numpy-format: "numpy-array-use-type-var"}, + { pybind11-branch: "v3.0", python: "3.13", numpy-format: "numpy-array-wrap-with-annotated"}, { pybind11-branch: "v2.13", python: "3.13", numpy-format: "numpy-array-use-type-var"}, { pybind11-branch: "v2.13", python: "3.13", numpy-format: "numpy-array-wrap-with-annotated"}, { pybind11-branch: "v2.13", python: "3.12", numpy-format: "numpy-array-wrap-with-annotated"}, diff --git a/tests/errors/pybind11-v3.0/demo.errors.stderr.txt b/tests/errors/pybind11-v3.0/demo.errors.stderr.txt new file mode 100644 index 00000000..e858fa4a --- /dev/null +++ b/tests/errors/pybind11-v3.0/demo.errors.stderr.txt @@ -0,0 +1,15 @@ +pybind11_stubgen - [ ERROR] In demo._bindings.aliases.foreign_enum_default : Invalid expression '' +pybind11_stubgen - [ ERROR] In demo._bindings.enum.accept_defaulted_enum : Invalid expression '' +pybind11_stubgen - [ ERROR] In demo._bindings.flawed_bindings.accept_unbound_enum : Invalid expression '(anonymous namespace)::Enum' +pybind11_stubgen - [ ERROR] In demo._bindings.flawed_bindings.accept_unbound_enum_defaulted : Invalid expression '' +pybind11_stubgen - [ ERROR] In demo._bindings.flawed_bindings.accept_unbound_type : Invalid expression '(anonymous namespace)::Unbound' +pybind11_stubgen - [ ERROR] In demo._bindings.flawed_bindings.accept_unbound_type_defaulted : Invalid expression '' +pybind11_stubgen - [ ERROR] In demo._bindings.flawed_bindings.get_unbound_type : Invalid expression '(anonymous namespace)::Unbound' +pybind11_stubgen - [WARNING] Enum-like str representations were found with no matching mapping to the enum class location. +Use `--enum-class-locations` to specify full path to the following enum(s): + - ConsoleForegroundColor +pybind11_stubgen - [WARNING] Raw C++ types/values were found in signatures extracted from docstrings. +Please check the corresponding sections of pybind11 documentation to avoid common mistakes in binding code: + - https://pybind11.readthedocs.io/en/latest/advanced/misc.html#avoiding-cpp-types-in-docstrings + - https://pybind11.readthedocs.io/en/latest/advanced/functions.html#default-arguments-revisited +pybind11_stubgen - [ INFO] Terminating due to previous errors diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/__init__.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/__init__.pyi new file mode 100644 index 00000000..86fb6b84 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/__init__.pyi @@ -0,0 +1,41 @@ +from __future__ import annotations + +from demo._bindings import ( + aliases, + classes, + eigen, + enum, + flawed_bindings, + functions, + issues, + methods, + numpy, + properties, + stl, + stl_bind, + typing, + values, +) + +from . import _bindings, core, pure_python + +__all__: list[str] = [ + "aliases", + "classes", + "core", + "eigen", + "enum", + "flawed_bindings", + "functions", + "issues", + "methods", + "numpy", + "properties", + "pure_python", + "stl", + "stl_bind", + "typing", + "values", + "version", +] +version: str = "0.0.0" diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/__init__.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/__init__.pyi new file mode 100644 index 00000000..c263078f --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/__init__.pyi @@ -0,0 +1,35 @@ +from __future__ import annotations + +from . import ( + aliases, + classes, + eigen, + enum, + flawed_bindings, + functions, + issues, + methods, + numpy, + properties, + stl, + stl_bind, + typing, + values, +) + +__all__: list[str] = [ + "aliases", + "classes", + "eigen", + "enum", + "flawed_bindings", + "functions", + "issues", + "methods", + "numpy", + "properties", + "stl", + "stl_bind", + "typing", + "values", +] diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/__init__.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/__init__.pyi new file mode 100644 index 00000000..8d6f4ceb --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/__init__.pyi @@ -0,0 +1,53 @@ +from __future__ import annotations + +import typing + +import numpy +from numpy import random + +import demo._bindings.enum +from demo._bindings.aliases.foreign_method_arg import Bar2 as foreign_type_alias +from demo._bindings.aliases.foreign_return import get_foo as foreign_class_alias + +from . import ( + foreign_arg, + foreign_attr, + foreign_class_member, + foreign_method_arg, + foreign_method_return, + foreign_return, + missing_self_arg, +) + +__all__: list[str] = [ + "Color", + "Dummy", + "foreign_arg", + "foreign_attr", + "foreign_class_alias", + "foreign_class_member", + "foreign_enum_default", + "foreign_method_arg", + "foreign_method_return", + "foreign_return", + "foreign_type_alias", + "func", + "local_func_alias", + "local_type_alias", + "missing_self_arg", + "random", +] + +class Color: + pass + +class Dummy: + linalg = numpy.linalg + +def foreign_enum_default( + color: typing.Any = demo._bindings.enum.ConsoleForegroundColor.Blue, +) -> None: ... +def func(arg0: typing.SupportsInt) -> int: ... + +local_func_alias = func +local_type_alias = Color diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_arg.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_arg.pyi new file mode 100644 index 00000000..de75e6fb --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_arg.pyi @@ -0,0 +1,7 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["set_foo"] + +def set_foo(arg0: demo._bindings.classes.Foo) -> int: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_attr.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_attr.pyi new file mode 100644 index 00000000..10c4a712 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_attr.pyi @@ -0,0 +1,6 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["value"] +value: demo._bindings.classes.Foo # value = diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_class_member.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_class_member.pyi new file mode 100644 index 00000000..497a4e2a --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_class_member.pyi @@ -0,0 +1,12 @@ +from __future__ import annotations + +import typing + +import demo._bindings.classes + +__all__: list[str] = ["Bar1"] + +class Bar1: + foo: typing.ClassVar[ + demo._bindings.classes.Foo + ] # value = diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_method_arg.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_method_arg.pyi new file mode 100644 index 00000000..8d4ed4ac --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_method_arg.pyi @@ -0,0 +1,8 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["Bar2"] + +class Bar2: + def set_foo(self, arg0: demo._bindings.classes.Foo) -> int: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_method_return.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_method_return.pyi new file mode 100644 index 00000000..95d218e1 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_method_return.pyi @@ -0,0 +1,9 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["Bar3"] + +class Bar3: + @staticmethod + def get_foo() -> demo._bindings.classes.Foo: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_return.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_return.pyi new file mode 100644 index 00000000..7b5b428f --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/foreign_return.pyi @@ -0,0 +1,7 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["get_foo"] + +def get_foo() -> demo._bindings.classes.Foo: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/missing_self_arg.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/missing_self_arg.pyi new file mode 100644 index 00000000..ee1a09ee --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/aliases/missing_self_arg.pyi @@ -0,0 +1,8 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["Bar4"] + +class Bar4: + def set_foo(self: demo._bindings.classes.Foo) -> int: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/classes.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/classes.pyi new file mode 100644 index 00000000..5578ccd3 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/classes.pyi @@ -0,0 +1,63 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = ["Base", "CppException", "Derived", "Foo", "Outer"] + +class Base: + class Inner: + pass + + name: str + +class CppException(Exception): + pass + +class Derived(Base): + @property + def count(self) -> int: ... + @count.setter + def count(self, arg0: typing.SupportsInt) -> None: ... + +class Foo: + class FooChild: + def __init__(self) -> None: ... + def g(self) -> None: ... + + def __init__(self) -> None: ... + def f(self) -> None: ... + +class Outer: + class Inner: + class NestedEnum: + """ + Members: + + ONE + + TWO + """ + + ONE: typing.ClassVar[Outer.Inner.NestedEnum] # value = + TWO: typing.ClassVar[Outer.Inner.NestedEnum] # value = + __members__: typing.ClassVar[ + dict[str, Outer.Inner.NestedEnum] + ] # value = {'ONE': , 'TWO': } + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: typing.SupportsInt) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: typing.SupportsInt) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + + value: Outer.Inner.NestedEnum + + inner: Outer.Inner diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/eigen.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/eigen.pyi new file mode 100644 index 00000000..c7a814b2 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/eigen.pyi @@ -0,0 +1,71 @@ +from __future__ import annotations + +import typing + +import numpy +import numpy.typing +import scipy.sparse + +__all__: list[str] = [ + "accept_matrix_int", + "accept_vector_float64", + "dense_matrix_c", + "dense_matrix_r", + "fixed_mutator_a", + "fixed_mutator_c", + "fixed_mutator_r", + "four_col_matrix_r", + "four_row_matrix_r", + "get_matrix_int", + "get_vector_float64", + "sparse_matrix_c", + "sparse_matrix_r", +] + +def accept_matrix_int( + arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.int32, "[3, 3]"], +) -> None: ... +def accept_vector_float64( + arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[3, 1]"], +) -> None: ... +def dense_matrix_c( + arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float32, "[m, n]"], +) -> typing.Annotated[numpy.typing.NDArray[numpy.float32], "[m, n]"]: ... +def dense_matrix_r( + arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float32, "[m, n]"], +) -> typing.Annotated[numpy.typing.NDArray[numpy.float32], "[m, n]"]: ... +def fixed_mutator_a( + arg0: typing.Annotated[ + numpy.typing.NDArray[numpy.float32], "[5, 6]", "flags.writeable" + ], +) -> None: ... +def fixed_mutator_c( + arg0: typing.Annotated[ + numpy.typing.NDArray[numpy.float32], + "[5, 6]", + "flags.writeable", + "flags.f_contiguous", + ], +) -> None: ... +def fixed_mutator_r( + arg0: typing.Annotated[ + numpy.typing.NDArray[numpy.float32], + "[5, 6]", + "flags.writeable", + "flags.c_contiguous", + ], +) -> None: ... +def four_col_matrix_r( + arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float32, "[m, 4]"], +) -> typing.Annotated[numpy.typing.NDArray[numpy.float32], "[m, 4]"]: ... +def four_row_matrix_r( + arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float32, "[4, n]"], +) -> typing.Annotated[numpy.typing.NDArray[numpy.float32], "[4, n]"]: ... +def get_matrix_int() -> ( + typing.Annotated[numpy.typing.NDArray[numpy.int32], "[3, 3]"] +): ... +def get_vector_float64() -> ( + typing.Annotated[numpy.typing.NDArray[numpy.float64], "[3, 1]"] +): ... +def sparse_matrix_c(arg0: scipy.sparse.csc_matrix) -> scipy.sparse.csc_matrix: ... +def sparse_matrix_r(arg0: scipy.sparse.csr_matrix) -> scipy.sparse.csr_matrix: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/enum.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/enum.pyi new file mode 100644 index 00000000..a994e39a --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/enum.pyi @@ -0,0 +1,71 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = [ + "Blue", + "ConsoleForegroundColor", + "Green", + "Magenta", + "None_", + "Yellow", + "accept_defaulted_enum", +] + +class ConsoleForegroundColor: + """ + Members: + + Green + + Yellow + + Blue + + Magenta + + None_ + """ + + Blue: typing.ClassVar[ + ConsoleForegroundColor + ] # value = + Green: typing.ClassVar[ + ConsoleForegroundColor + ] # value = + Magenta: typing.ClassVar[ + ConsoleForegroundColor + ] # value = + None_: typing.ClassVar[ + ConsoleForegroundColor + ] # value = + Yellow: typing.ClassVar[ + ConsoleForegroundColor + ] # value = + __members__: typing.ClassVar[ + dict[str, ConsoleForegroundColor] + ] # value = {'Green': , 'Yellow': , 'Blue': , 'Magenta': , 'None_': } + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: typing.SupportsInt) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: typing.SupportsInt) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +def accept_defaulted_enum( + color: ConsoleForegroundColor = ConsoleForegroundColor.None_, +) -> None: ... + +Blue: ConsoleForegroundColor # value = +Green: ConsoleForegroundColor # value = +Magenta: ConsoleForegroundColor # value = +None_: ConsoleForegroundColor # value = +Yellow: ConsoleForegroundColor # value = diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/flawed_bindings.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/flawed_bindings.pyi new file mode 100644 index 00000000..d95bbb35 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/flawed_bindings.pyi @@ -0,0 +1,25 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = [ + "Enum", + "Unbound", + "accept_unbound_enum", + "accept_unbound_enum_defaulted", + "accept_unbound_type", + "accept_unbound_type_defaulted", + "get_unbound_type", +] + +class Enum: + pass + +class Unbound: + pass + +def accept_unbound_enum(arg0: ...) -> int: ... +def accept_unbound_enum_defaulted(x: Enum = ...) -> int: ... +def accept_unbound_type(arg0: tuple[..., typing.SupportsInt]) -> int: ... +def accept_unbound_type_defaulted(x: Unbound = ...) -> int: ... +def get_unbound_type() -> ...: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/functions.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/functions.pyi new file mode 100644 index 00000000..99710ab0 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/functions.pyi @@ -0,0 +1,74 @@ +from __future__ import annotations + +import collections.abc +import typing + +__all__: list[str] = [ + "Foo", + "accept_annotated_callable", + "accept_callable", + "accept_frozenset", + "accept_py_handle", + "accept_py_object", + "accept_set", + "add", + "default_custom_arg", + "default_int_arg", + "default_list_arg", + "default_optional_arg", + "func_w_anon_args", + "func_w_named_pos_args", + "generic", + "mul", + "pass_callback", + "pos_kw_only_mix", + "pos_kw_only_variadic_mix", +] + +class Foo: + def __init__(self, arg0: typing.SupportsInt) -> None: ... + +def accept_annotated_callable( + arg0: collections.abc.Callable[[typing.SupportsInt, typing.SupportsInt], int], +) -> typing.Any: ... +def accept_callable(arg0: collections.abc.Callable) -> typing.Any: ... +def accept_frozenset(arg0: frozenset) -> None: ... +def accept_py_handle(arg0: typing.Any) -> str: ... +def accept_py_object(arg0: typing.Any) -> str: ... +def accept_set(arg0: set) -> None: ... +def add(arg0: typing.SupportsInt, arg1: typing.SupportsInt) -> int: ... +def default_custom_arg(foo: Foo = Foo(5)) -> None: ... +def default_int_arg(n: typing.SupportsInt = 5) -> None: ... +def default_list_arg(l: list = [1, 2, 6, 18]) -> None: ... +def default_optional_arg(n: typing.SupportsInt | None = None) -> None: ... +def func_w_anon_args( + arg0: typing.SupportsInt, arg1: typing.SupportsInt, arg2: typing.SupportsInt +) -> None: ... +def func_w_named_pos_args( + x: typing.SupportsInt, y: typing.SupportsInt, z: typing.SupportsInt +) -> None: ... +def generic(*args, **kwargs) -> None: ... +@typing.overload +def mul(x: typing.SupportsInt, y: typing.SupportsInt) -> int: + """ + Multiply x and y (int) + """ + +@typing.overload +def mul(p: typing.SupportsFloat, q: typing.SupportsFloat) -> float: + """ + Multiply p and q (double) + """ + +def pass_callback(arg0: collections.abc.Callable[[Foo], Foo]) -> Foo: ... +def pos_kw_only_mix( + i: typing.SupportsInt, /, j: typing.SupportsInt, *, k: typing.SupportsInt +) -> tuple: ... +def pos_kw_only_variadic_mix( + i: typing.SupportsInt, + /, + j: typing.SupportsInt, + *args, + k: typing.SupportsInt, + **kwargs, +) -> tuple: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/issues.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/issues.pyi new file mode 100644 index 00000000..165940ce --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/issues.pyi @@ -0,0 +1,39 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = [ + "backslashes_should_be_escaped", + "issue_51_catastrophic_regex", + "issue_73_utf8_doc_chars", +] + +def backslashes_should_be_escaped() -> None: + """ + \\brief A brief description of this function. + + A detailed description of this function. + + Here's some reStructuredText: :math:`x = [x, y, \\theta]^T` + """ + +def issue_51_catastrophic_regex( + arg0: typing.SupportsInt, arg1: typing.SupportsInt +) -> None: + """ + Use-case: + issue_51(os.get_handle_inheritable, os.set_handle_inheritable) + """ + +def issue_73_utf8_doc_chars() -> None: + """ + Construct a Ramsete unicycle controller. + + Tuning parameter (b > 0 rad²/m²) for which larger values make + + convergence more aggressive like a proportional term. + Tuning parameter (0 rad⁻¹ < zeta < 1 rad⁻¹) for which larger + values provide more damping in response. + """ + +_cleanup: typing.Any # value = diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/methods.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/methods.pyi new file mode 100644 index 00000000..406a3011 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/methods.pyi @@ -0,0 +1,10 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = ["Dummy"] + +class Dummy: + @staticmethod + def static_method(arg0: typing.SupportsInt) -> int: ... + def regular_method(self, arg0: typing.SupportsInt) -> int: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/numpy.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/numpy.pyi new file mode 100644 index 00000000..ca0a64b9 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/numpy.pyi @@ -0,0 +1,24 @@ +from __future__ import annotations + +import typing + +import numpy +import numpy.typing + +__all__: list[str] = [ + "accept_ndarray_float64", + "accept_ndarray_int", + "get_ndarray_float64", + "get_ndarray_int", + "return_dtype", +] + +def accept_ndarray_float64( + arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], +) -> None: ... +def accept_ndarray_int( + arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.int32], +) -> None: ... +def get_ndarray_float64() -> numpy.typing.NDArray[numpy.float64]: ... +def get_ndarray_int() -> numpy.typing.NDArray[numpy.int32]: ... +def return_dtype() -> numpy.dtype[typing.Any]: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/properties.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/properties.pyi new file mode 100644 index 00000000..0c9632ad --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/properties.pyi @@ -0,0 +1,112 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = [ + "WithGetterSetterDoc", + "WithPropAndGetterSetterDoc", + "WithPropDoc", + "WithoutDoc", +] + +class WithGetterSetterDoc: + """ + User docstring provided via pybind11::cpp_function(..., doc) to getters/setters, but NOT to `def_*(..., doc)` calls + """ + + def_property_readonly_static: typing.ClassVar[int] = 0 + def_property_static: typing.ClassVar[int] = 0 + @property + def def_property(self) -> int: + """ + getter doc token + """ + + @def_property.setter + def def_property(self, arg1: typing.SupportsInt) -> None: + """ + setter doc token + """ + + @property + def def_property_readonly(self) -> int: + """ + getter doc token + """ + +class WithPropAndGetterSetterDoc: + """ + User docstring provided via pybind11::cpp_function(..., doc) to getters/setters and to `def_*(, doc)` calls + """ + + def_property_readonly_static: typing.ClassVar[int] = 0 + def_property_static: typing.ClassVar[int] = 0 + @property + def def_property(self) -> int: + """ + prop doc token + """ + + @def_property.setter + def def_property(self, arg1: typing.SupportsInt) -> None: ... + @property + def def_property_readonly(self) -> int: + """ + prop doc token + """ + +class WithPropDoc: + """ + User docstring provided only to `def_` calls + """ + + def_property_readonly_static: typing.ClassVar[int] = 0 + def_property_static: typing.ClassVar[int] = 0 + @property + def def_property(self) -> int: + """ + prop doc token + """ + + @def_property.setter + def def_property(self, arg1: typing.SupportsInt) -> None: ... + @property + def def_property_readonly(self) -> int: + """ + prop doc token + """ + + @property + def def_readonly(self) -> int: + """ + prop doc token + """ + + @property + def def_readwrite(self) -> int: + """ + prop doc token + """ + + @def_readwrite.setter + def def_readwrite(self, arg0: typing.SupportsInt) -> None: ... + +class WithoutDoc: + """ + No user docstring provided + """ + + def_property_readonly_static: typing.ClassVar[int] = 0 + def_property_static: typing.ClassVar[int] = 0 + @property + def def_property(self) -> int: ... + @def_property.setter + def def_property(self, arg1: typing.SupportsInt) -> None: ... + @property + def def_property_readonly(self) -> int: ... + @property + def def_readonly(self) -> int: ... + @property + def def_readwrite(self) -> int: ... + @def_readwrite.setter + def def_readwrite(self, arg0: typing.SupportsInt) -> None: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/stl.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/stl.pyi new file mode 100644 index 00000000..12833c68 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/stl.pyi @@ -0,0 +1,28 @@ +from __future__ import annotations + +import collections.abc +import typing + +__all__: list[str] = [ + "std_array", + "std_map", + "std_optional", + "std_variant", + "std_vector", +] + +def std_array( + arg0: typing.Annotated[ + collections.abc.Sequence[typing.SupportsInt], "FixedSize(3)" + ], +) -> typing.Annotated[list[int], "FixedSize(3)"]: ... +def std_map() -> dict[int, complex]: ... +def std_optional(arg0: typing.SupportsInt | None) -> None: ... +def std_variant( + arg0: ( + typing.SupportsInt + | typing.SupportsFloat + | tuple[typing.SupportsInt, typing.SupportsInt] + ), +) -> None: ... +def std_vector() -> list[tuple[int, float]]: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/stl_bind.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/stl_bind.pyi new file mode 100644 index 00000000..32f31d42 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/stl_bind.pyi @@ -0,0 +1,146 @@ +from __future__ import annotations + +import collections.abc +import typing + +__all__: list[str] = [ + "MapStringComplex", + "VectorPairStringDouble", + "get_complex_map", + "get_vector_of_pairs", +] + +class MapStringComplex: + def __bool__(self) -> bool: + """ + Check whether the map is nonempty + """ + + @typing.overload + def __contains__(self, arg0: str) -> bool: ... + @typing.overload + def __contains__(self, arg0: typing.Any) -> bool: ... + def __delitem__(self, arg0: str) -> None: ... + def __getitem__(self, arg0: str) -> complex: ... + def __init__(self) -> None: ... + def __iter__(self) -> collections.abc.Iterator[str]: ... + def __len__(self) -> int: ... + def __repr__(self) -> str: + """ + Return the canonical string representation of this map. + """ + + def __setitem__(self, arg0: str, arg1: complex) -> None: ... + def items(self) -> typing.ItemsView: ... + def keys(self) -> typing.KeysView: ... + def values(self) -> typing.ValuesView: ... + +class VectorPairStringDouble: + __hash__: typing.ClassVar[None] = None + def __bool__(self) -> bool: + """ + Check whether the list is nonempty + """ + + def __contains__(self, x: tuple[str, typing.SupportsFloat]) -> bool: + """ + Return true the container contains ``x`` + """ + + @typing.overload + def __delitem__(self, arg0: typing.SupportsInt) -> None: + """ + Delete the list elements at index ``i`` + """ + + @typing.overload + def __delitem__(self, arg0: slice) -> None: + """ + Delete list elements using a slice object + """ + + def __eq__(self, arg0: VectorPairStringDouble) -> bool: ... + @typing.overload + def __getitem__(self, s: slice) -> VectorPairStringDouble: + """ + Retrieve list elements using a slice object + """ + + @typing.overload + def __getitem__(self, arg0: typing.SupportsInt) -> tuple[str, float]: ... + @typing.overload + def __init__(self) -> None: ... + @typing.overload + def __init__(self, arg0: VectorPairStringDouble) -> None: + """ + Copy constructor + """ + + @typing.overload + def __init__(self, arg0: collections.abc.Iterable) -> None: ... + def __iter__(self) -> collections.abc.Iterator[tuple[str, float]]: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: VectorPairStringDouble) -> bool: ... + @typing.overload + def __setitem__( + self, arg0: typing.SupportsInt, arg1: tuple[str, typing.SupportsFloat] + ) -> None: ... + @typing.overload + def __setitem__(self, arg0: slice, arg1: VectorPairStringDouble) -> None: + """ + Assign list elements using a slice object + """ + + def append(self, x: tuple[str, typing.SupportsFloat]) -> None: + """ + Add an item to the end of the list + """ + + def clear(self) -> None: + """ + Clear the contents + """ + + def count(self, x: tuple[str, typing.SupportsFloat]) -> int: + """ + Return the number of times ``x`` appears in the list + """ + + @typing.overload + def extend(self, L: VectorPairStringDouble) -> None: + """ + Extend the list by appending all the items in the given list + """ + + @typing.overload + def extend(self, L: collections.abc.Iterable) -> None: + """ + Extend the list by appending all the items in the given list + """ + + def insert( + self, i: typing.SupportsInt, x: tuple[str, typing.SupportsFloat] + ) -> None: + """ + Insert an item at a given position. + """ + + @typing.overload + def pop(self) -> tuple[str, float]: + """ + Remove and return the last item + """ + + @typing.overload + def pop(self, i: typing.SupportsInt) -> tuple[str, float]: + """ + Remove and return the item at index ``i`` + """ + + def remove(self, x: tuple[str, typing.SupportsFloat]) -> None: + """ + Remove the first item from the list whose value is x. It is an error if there is no such item. + """ + +def get_complex_map() -> MapStringComplex: ... +def get_vector_of_pairs() -> VectorPairStringDouble: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/typing.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/typing.pyi new file mode 100644 index 00000000..98fd047b --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/typing.pyi @@ -0,0 +1,8 @@ +from __future__ import annotations + +import collections.abc + +__all__: list[str] = ["get_buffer", "get_sequence"] + +def get_buffer(arg0: collections.abc.Buffer) -> collections.abc.Buffer: ... +def get_sequence(arg0: collections.abc.Sequence) -> collections.abc.Sequence: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/values.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/values.pyi new file mode 100644 index 00000000..7c36d3fd --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/values.pyi @@ -0,0 +1,36 @@ +from __future__ import annotations + +import datetime + +import numpy +from numpy import random + +__all__: list[str] = [ + "Dummy", + "Foo", + "add_day", + "foolist", + "foovar", + "list_with_none", + "none", + "random", + "t_10ms", + "t_20ns", + "t_30s", +] + +class Dummy: + linalg = numpy.linalg + +class Foo: + pass + +def add_day(arg0: datetime.datetime) -> datetime.datetime: ... + +foolist: list # value = [, ] +foovar: Foo # value = +list_with_none: list = [None, 2, {}] +none = None +t_10ms: datetime.timedelta # value = datetime.timedelta(microseconds=10000) +t_20ns: datetime.timedelta # value = datetime.timedelta(0) +t_30s: datetime.timedelta # value = datetime.timedelta(seconds=30) diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/core.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/core.pyi new file mode 100644 index 00000000..95c16467 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/core.pyi @@ -0,0 +1,35 @@ +from __future__ import annotations + +from demo._bindings import ( + aliases, + classes, + eigen, + enum, + flawed_bindings, + functions, + issues, + methods, + numpy, + properties, + stl, + stl_bind, + typing, + values, +) + +__all__: list[str] = [ + "aliases", + "classes", + "eigen", + "enum", + "flawed_bindings", + "functions", + "issues", + "methods", + "numpy", + "properties", + "stl", + "stl_bind", + "typing", + "values", +] diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/__init__.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/__init__.pyi new file mode 100644 index 00000000..10d343e0 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/__init__.pyi @@ -0,0 +1,11 @@ +from __future__ import annotations + +from . import classes, functions, functions_3_8_plus, functions_3_9_plus, values + +__all__: list[str] = [ + "classes", + "functions", + "functions_3_8_plus", + "functions_3_9_plus", + "values", +] diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/classes.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/classes.pyi new file mode 100644 index 00000000..32aa068b --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/classes.pyi @@ -0,0 +1,21 @@ +from __future__ import annotations + +__all__: list[str] = ["A", "B", "C", "X"] + +class A: + """ + A + """ + +class B(A): + """ + B + """ + +class C(B): + """ + C + """ + +class X: + pass diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/functions.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/functions.pyi new file mode 100644 index 00000000..5ed9ef3c --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/functions.pyi @@ -0,0 +1,31 @@ +from __future__ import annotations + +import sys as sys +import typing as typing + +from demo.pure_python.functions_3_8_plus import args_mix +from demo.pure_python.functions_3_9_plus import generic_alias_annotation + +__all__: list[str] = [ + "accept_frozenset", + "args_mix", + "builtin_function_as_default_arg", + "function_as_default_arg", + "generic_alias_annotation", + "lambda_as_default_arg", + "search", + "static_method_as_default_arg", + "sys", + "typing", +] + +class _Dummy: + @staticmethod + def foo(): ... + +def accept_frozenset(arg: frozenset[int | float]) -> int | None: ... +def builtin_function_as_default_arg(func: type(len) = len): ... +def function_as_default_arg(func: type(search) = search): ... +def lambda_as_default_arg(callback=...): ... +def search(a: int, b: list[int]) -> int: ... +def static_method_as_default_arg(callback=_Dummy.foo): ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/functions_3_8_plus.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/functions_3_8_plus.pyi new file mode 100644 index 00000000..e9164220 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/functions_3_8_plus.pyi @@ -0,0 +1,15 @@ +from __future__ import annotations + +import typing as typing + +__all__: list[str] = ["args_mix", "typing"] + +def args_mix( + a: int, + b: float = 0.5, + c: str = "", + *args: int, + x: int = 1, + y=int, + **kwargs: typing.Dict[int, str], +): ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/functions_3_9_plus.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/functions_3_9_plus.pyi new file mode 100644 index 00000000..59b9b80c --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/functions_3_9_plus.pyi @@ -0,0 +1,5 @@ +from __future__ import annotations + +__all__: list[str] = ["generic_alias_annotation"] + +def generic_alias_annotation(a: list[tuple[int]], b: dict[int, str]) -> list[float]: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/values.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/values.pyi new file mode 100644 index 00000000..07913391 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/pure_python/values.pyi @@ -0,0 +1,4 @@ +from __future__ import annotations + +__all__: list[str] = ["callables_dict"] +callables_dict: dict = {"len": len, "int": int} diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/__init__.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/__init__.pyi new file mode 100644 index 00000000..86fb6b84 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/__init__.pyi @@ -0,0 +1,41 @@ +from __future__ import annotations + +from demo._bindings import ( + aliases, + classes, + eigen, + enum, + flawed_bindings, + functions, + issues, + methods, + numpy, + properties, + stl, + stl_bind, + typing, + values, +) + +from . import _bindings, core, pure_python + +__all__: list[str] = [ + "aliases", + "classes", + "core", + "eigen", + "enum", + "flawed_bindings", + "functions", + "issues", + "methods", + "numpy", + "properties", + "pure_python", + "stl", + "stl_bind", + "typing", + "values", + "version", +] +version: str = "0.0.0" diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/__init__.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/__init__.pyi new file mode 100644 index 00000000..c263078f --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/__init__.pyi @@ -0,0 +1,35 @@ +from __future__ import annotations + +from . import ( + aliases, + classes, + eigen, + enum, + flawed_bindings, + functions, + issues, + methods, + numpy, + properties, + stl, + stl_bind, + typing, + values, +) + +__all__: list[str] = [ + "aliases", + "classes", + "eigen", + "enum", + "flawed_bindings", + "functions", + "issues", + "methods", + "numpy", + "properties", + "stl", + "stl_bind", + "typing", + "values", +] diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi new file mode 100644 index 00000000..8d6f4ceb --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi @@ -0,0 +1,53 @@ +from __future__ import annotations + +import typing + +import numpy +from numpy import random + +import demo._bindings.enum +from demo._bindings.aliases.foreign_method_arg import Bar2 as foreign_type_alias +from demo._bindings.aliases.foreign_return import get_foo as foreign_class_alias + +from . import ( + foreign_arg, + foreign_attr, + foreign_class_member, + foreign_method_arg, + foreign_method_return, + foreign_return, + missing_self_arg, +) + +__all__: list[str] = [ + "Color", + "Dummy", + "foreign_arg", + "foreign_attr", + "foreign_class_alias", + "foreign_class_member", + "foreign_enum_default", + "foreign_method_arg", + "foreign_method_return", + "foreign_return", + "foreign_type_alias", + "func", + "local_func_alias", + "local_type_alias", + "missing_self_arg", + "random", +] + +class Color: + pass + +class Dummy: + linalg = numpy.linalg + +def foreign_enum_default( + color: typing.Any = demo._bindings.enum.ConsoleForegroundColor.Blue, +) -> None: ... +def func(arg0: typing.SupportsInt) -> int: ... + +local_func_alias = func +local_type_alias = Color diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_arg.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_arg.pyi new file mode 100644 index 00000000..de75e6fb --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_arg.pyi @@ -0,0 +1,7 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["set_foo"] + +def set_foo(arg0: demo._bindings.classes.Foo) -> int: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi new file mode 100644 index 00000000..10c4a712 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi @@ -0,0 +1,6 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["value"] +value: demo._bindings.classes.Foo # value = diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi new file mode 100644 index 00000000..497a4e2a --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi @@ -0,0 +1,12 @@ +from __future__ import annotations + +import typing + +import demo._bindings.classes + +__all__: list[str] = ["Bar1"] + +class Bar1: + foo: typing.ClassVar[ + demo._bindings.classes.Foo + ] # value = diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_arg.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_arg.pyi new file mode 100644 index 00000000..8d4ed4ac --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_arg.pyi @@ -0,0 +1,8 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["Bar2"] + +class Bar2: + def set_foo(self, arg0: demo._bindings.classes.Foo) -> int: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_return.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_return.pyi new file mode 100644 index 00000000..95d218e1 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_method_return.pyi @@ -0,0 +1,9 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["Bar3"] + +class Bar3: + @staticmethod + def get_foo() -> demo._bindings.classes.Foo: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_return.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_return.pyi new file mode 100644 index 00000000..7b5b428f --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_return.pyi @@ -0,0 +1,7 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["get_foo"] + +def get_foo() -> demo._bindings.classes.Foo: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/missing_self_arg.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/missing_self_arg.pyi new file mode 100644 index 00000000..ee1a09ee --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/aliases/missing_self_arg.pyi @@ -0,0 +1,8 @@ +from __future__ import annotations + +import demo._bindings.classes + +__all__: list[str] = ["Bar4"] + +class Bar4: + def set_foo(self: demo._bindings.classes.Foo) -> int: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi new file mode 100644 index 00000000..5578ccd3 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi @@ -0,0 +1,63 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = ["Base", "CppException", "Derived", "Foo", "Outer"] + +class Base: + class Inner: + pass + + name: str + +class CppException(Exception): + pass + +class Derived(Base): + @property + def count(self) -> int: ... + @count.setter + def count(self, arg0: typing.SupportsInt) -> None: ... + +class Foo: + class FooChild: + def __init__(self) -> None: ... + def g(self) -> None: ... + + def __init__(self) -> None: ... + def f(self) -> None: ... + +class Outer: + class Inner: + class NestedEnum: + """ + Members: + + ONE + + TWO + """ + + ONE: typing.ClassVar[Outer.Inner.NestedEnum] # value = + TWO: typing.ClassVar[Outer.Inner.NestedEnum] # value = + __members__: typing.ClassVar[ + dict[str, Outer.Inner.NestedEnum] + ] # value = {'ONE': , 'TWO': } + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: typing.SupportsInt) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: typing.SupportsInt) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + + value: Outer.Inner.NestedEnum + + inner: Outer.Inner diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi new file mode 100644 index 00000000..afe7ccb3 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/eigen.pyi @@ -0,0 +1,75 @@ +from __future__ import annotations + +import typing + +import numpy +import numpy.typing +import scipy.sparse + +__all__: list[str] = [ + "accept_matrix_int", + "accept_vector_float64", + "dense_matrix_c", + "dense_matrix_r", + "fixed_mutator_a", + "fixed_mutator_c", + "fixed_mutator_r", + "four_col_matrix_r", + "four_row_matrix_r", + "get_matrix_int", + "get_vector_float64", + "sparse_matrix_c", + "sparse_matrix_r", +] + +def accept_matrix_int( + arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.int32, "[3, 3]"], +) -> None: ... +def accept_vector_float64( + arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[3, 1]"], +) -> None: ... +def dense_matrix_c( + arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float32, "[m, n]"], +) -> typing.Annotated[numpy.typing.NDArray[numpy.float32], "[m, n]"]: ... +def dense_matrix_r( + arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float32, "[m, n]"], +) -> typing.Annotated[numpy.typing.NDArray[numpy.float32], "[m, n]"]: ... +def fixed_mutator_a( + arg0: typing.Annotated[ + numpy.typing.NDArray[numpy.float32], "[5, 6]", "flags.writeable" + ], +) -> None: ... +def fixed_mutator_c( + arg0: typing.Annotated[ + numpy.typing.NDArray[numpy.float32], + "[5, 6]", + "flags.writeable", + "flags.f_contiguous", + ], +) -> None: ... +def fixed_mutator_r( + arg0: typing.Annotated[ + numpy.typing.NDArray[numpy.float32], + "[5, 6]", + "flags.writeable", + "flags.c_contiguous", + ], +) -> None: ... +def four_col_matrix_r( + arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float32, "[m, 4]"], +) -> typing.Annotated[numpy.typing.NDArray[numpy.float32], "[m, 4]"]: ... +def four_row_matrix_r( + arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float32, "[4, n]"], +) -> typing.Annotated[numpy.typing.NDArray[numpy.float32], "[4, n]"]: ... +def get_matrix_int() -> ( + typing.Annotated[numpy.typing.NDArray[numpy.int32], "[3, 3]"] +): ... +def get_vector_float64() -> ( + typing.Annotated[numpy.typing.NDArray[numpy.float64], "[3, 1]"] +): ... +def sparse_matrix_c( + arg0: typing.Annotated[scipy.sparse.csc_matrix, numpy.float32], +) -> typing.Annotated[scipy.sparse.csc_matrix, numpy.float32]: ... +def sparse_matrix_r( + arg0: typing.Annotated[scipy.sparse.csr_matrix, numpy.float32], +) -> typing.Annotated[scipy.sparse.csr_matrix, numpy.float32]: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi new file mode 100644 index 00000000..a994e39a --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi @@ -0,0 +1,71 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = [ + "Blue", + "ConsoleForegroundColor", + "Green", + "Magenta", + "None_", + "Yellow", + "accept_defaulted_enum", +] + +class ConsoleForegroundColor: + """ + Members: + + Green + + Yellow + + Blue + + Magenta + + None_ + """ + + Blue: typing.ClassVar[ + ConsoleForegroundColor + ] # value = + Green: typing.ClassVar[ + ConsoleForegroundColor + ] # value = + Magenta: typing.ClassVar[ + ConsoleForegroundColor + ] # value = + None_: typing.ClassVar[ + ConsoleForegroundColor + ] # value = + Yellow: typing.ClassVar[ + ConsoleForegroundColor + ] # value = + __members__: typing.ClassVar[ + dict[str, ConsoleForegroundColor] + ] # value = {'Green': , 'Yellow': , 'Blue': , 'Magenta': , 'None_': } + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: typing.SupportsInt) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: typing.SupportsInt) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +def accept_defaulted_enum( + color: ConsoleForegroundColor = ConsoleForegroundColor.None_, +) -> None: ... + +Blue: ConsoleForegroundColor # value = +Green: ConsoleForegroundColor # value = +Magenta: ConsoleForegroundColor # value = +None_: ConsoleForegroundColor # value = +Yellow: ConsoleForegroundColor # value = diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi new file mode 100644 index 00000000..d95bbb35 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi @@ -0,0 +1,25 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = [ + "Enum", + "Unbound", + "accept_unbound_enum", + "accept_unbound_enum_defaulted", + "accept_unbound_type", + "accept_unbound_type_defaulted", + "get_unbound_type", +] + +class Enum: + pass + +class Unbound: + pass + +def accept_unbound_enum(arg0: ...) -> int: ... +def accept_unbound_enum_defaulted(x: Enum = ...) -> int: ... +def accept_unbound_type(arg0: tuple[..., typing.SupportsInt]) -> int: ... +def accept_unbound_type_defaulted(x: Unbound = ...) -> int: ... +def get_unbound_type() -> ...: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/functions.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/functions.pyi new file mode 100644 index 00000000..99710ab0 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/functions.pyi @@ -0,0 +1,74 @@ +from __future__ import annotations + +import collections.abc +import typing + +__all__: list[str] = [ + "Foo", + "accept_annotated_callable", + "accept_callable", + "accept_frozenset", + "accept_py_handle", + "accept_py_object", + "accept_set", + "add", + "default_custom_arg", + "default_int_arg", + "default_list_arg", + "default_optional_arg", + "func_w_anon_args", + "func_w_named_pos_args", + "generic", + "mul", + "pass_callback", + "pos_kw_only_mix", + "pos_kw_only_variadic_mix", +] + +class Foo: + def __init__(self, arg0: typing.SupportsInt) -> None: ... + +def accept_annotated_callable( + arg0: collections.abc.Callable[[typing.SupportsInt, typing.SupportsInt], int], +) -> typing.Any: ... +def accept_callable(arg0: collections.abc.Callable) -> typing.Any: ... +def accept_frozenset(arg0: frozenset) -> None: ... +def accept_py_handle(arg0: typing.Any) -> str: ... +def accept_py_object(arg0: typing.Any) -> str: ... +def accept_set(arg0: set) -> None: ... +def add(arg0: typing.SupportsInt, arg1: typing.SupportsInt) -> int: ... +def default_custom_arg(foo: Foo = Foo(5)) -> None: ... +def default_int_arg(n: typing.SupportsInt = 5) -> None: ... +def default_list_arg(l: list = [1, 2, 6, 18]) -> None: ... +def default_optional_arg(n: typing.SupportsInt | None = None) -> None: ... +def func_w_anon_args( + arg0: typing.SupportsInt, arg1: typing.SupportsInt, arg2: typing.SupportsInt +) -> None: ... +def func_w_named_pos_args( + x: typing.SupportsInt, y: typing.SupportsInt, z: typing.SupportsInt +) -> None: ... +def generic(*args, **kwargs) -> None: ... +@typing.overload +def mul(x: typing.SupportsInt, y: typing.SupportsInt) -> int: + """ + Multiply x and y (int) + """ + +@typing.overload +def mul(p: typing.SupportsFloat, q: typing.SupportsFloat) -> float: + """ + Multiply p and q (double) + """ + +def pass_callback(arg0: collections.abc.Callable[[Foo], Foo]) -> Foo: ... +def pos_kw_only_mix( + i: typing.SupportsInt, /, j: typing.SupportsInt, *, k: typing.SupportsInt +) -> tuple: ... +def pos_kw_only_variadic_mix( + i: typing.SupportsInt, + /, + j: typing.SupportsInt, + *args, + k: typing.SupportsInt, + **kwargs, +) -> tuple: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi new file mode 100644 index 00000000..165940ce --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi @@ -0,0 +1,39 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = [ + "backslashes_should_be_escaped", + "issue_51_catastrophic_regex", + "issue_73_utf8_doc_chars", +] + +def backslashes_should_be_escaped() -> None: + """ + \\brief A brief description of this function. + + A detailed description of this function. + + Here's some reStructuredText: :math:`x = [x, y, \\theta]^T` + """ + +def issue_51_catastrophic_regex( + arg0: typing.SupportsInt, arg1: typing.SupportsInt +) -> None: + """ + Use-case: + issue_51(os.get_handle_inheritable, os.set_handle_inheritable) + """ + +def issue_73_utf8_doc_chars() -> None: + """ + Construct a Ramsete unicycle controller. + + Tuning parameter (b > 0 rad²/m²) for which larger values make + + convergence more aggressive like a proportional term. + Tuning parameter (0 rad⁻¹ < zeta < 1 rad⁻¹) for which larger + values provide more damping in response. + """ + +_cleanup: typing.Any # value = diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/methods.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/methods.pyi new file mode 100644 index 00000000..406a3011 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/methods.pyi @@ -0,0 +1,10 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = ["Dummy"] + +class Dummy: + @staticmethod + def static_method(arg0: typing.SupportsInt) -> int: ... + def regular_method(self, arg0: typing.SupportsInt) -> int: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi new file mode 100644 index 00000000..ca0a64b9 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/numpy.pyi @@ -0,0 +1,24 @@ +from __future__ import annotations + +import typing + +import numpy +import numpy.typing + +__all__: list[str] = [ + "accept_ndarray_float64", + "accept_ndarray_int", + "get_ndarray_float64", + "get_ndarray_int", + "return_dtype", +] + +def accept_ndarray_float64( + arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], +) -> None: ... +def accept_ndarray_int( + arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.int32], +) -> None: ... +def get_ndarray_float64() -> numpy.typing.NDArray[numpy.float64]: ... +def get_ndarray_int() -> numpy.typing.NDArray[numpy.int32]: ... +def return_dtype() -> numpy.dtype[typing.Any]: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi new file mode 100644 index 00000000..0c9632ad --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi @@ -0,0 +1,112 @@ +from __future__ import annotations + +import typing + +__all__: list[str] = [ + "WithGetterSetterDoc", + "WithPropAndGetterSetterDoc", + "WithPropDoc", + "WithoutDoc", +] + +class WithGetterSetterDoc: + """ + User docstring provided via pybind11::cpp_function(..., doc) to getters/setters, but NOT to `def_*(..., doc)` calls + """ + + def_property_readonly_static: typing.ClassVar[int] = 0 + def_property_static: typing.ClassVar[int] = 0 + @property + def def_property(self) -> int: + """ + getter doc token + """ + + @def_property.setter + def def_property(self, arg1: typing.SupportsInt) -> None: + """ + setter doc token + """ + + @property + def def_property_readonly(self) -> int: + """ + getter doc token + """ + +class WithPropAndGetterSetterDoc: + """ + User docstring provided via pybind11::cpp_function(..., doc) to getters/setters and to `def_*(, doc)` calls + """ + + def_property_readonly_static: typing.ClassVar[int] = 0 + def_property_static: typing.ClassVar[int] = 0 + @property + def def_property(self) -> int: + """ + prop doc token + """ + + @def_property.setter + def def_property(self, arg1: typing.SupportsInt) -> None: ... + @property + def def_property_readonly(self) -> int: + """ + prop doc token + """ + +class WithPropDoc: + """ + User docstring provided only to `def_` calls + """ + + def_property_readonly_static: typing.ClassVar[int] = 0 + def_property_static: typing.ClassVar[int] = 0 + @property + def def_property(self) -> int: + """ + prop doc token + """ + + @def_property.setter + def def_property(self, arg1: typing.SupportsInt) -> None: ... + @property + def def_property_readonly(self) -> int: + """ + prop doc token + """ + + @property + def def_readonly(self) -> int: + """ + prop doc token + """ + + @property + def def_readwrite(self) -> int: + """ + prop doc token + """ + + @def_readwrite.setter + def def_readwrite(self, arg0: typing.SupportsInt) -> None: ... + +class WithoutDoc: + """ + No user docstring provided + """ + + def_property_readonly_static: typing.ClassVar[int] = 0 + def_property_static: typing.ClassVar[int] = 0 + @property + def def_property(self) -> int: ... + @def_property.setter + def def_property(self, arg1: typing.SupportsInt) -> None: ... + @property + def def_property_readonly(self) -> int: ... + @property + def def_readonly(self) -> int: ... + @property + def def_readwrite(self) -> int: ... + @def_readwrite.setter + def def_readwrite(self, arg0: typing.SupportsInt) -> None: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi new file mode 100644 index 00000000..12833c68 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi @@ -0,0 +1,28 @@ +from __future__ import annotations + +import collections.abc +import typing + +__all__: list[str] = [ + "std_array", + "std_map", + "std_optional", + "std_variant", + "std_vector", +] + +def std_array( + arg0: typing.Annotated[ + collections.abc.Sequence[typing.SupportsInt], "FixedSize(3)" + ], +) -> typing.Annotated[list[int], "FixedSize(3)"]: ... +def std_map() -> dict[int, complex]: ... +def std_optional(arg0: typing.SupportsInt | None) -> None: ... +def std_variant( + arg0: ( + typing.SupportsInt + | typing.SupportsFloat + | tuple[typing.SupportsInt, typing.SupportsInt] + ), +) -> None: ... +def std_vector() -> list[tuple[int, float]]: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi new file mode 100644 index 00000000..32f31d42 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi @@ -0,0 +1,146 @@ +from __future__ import annotations + +import collections.abc +import typing + +__all__: list[str] = [ + "MapStringComplex", + "VectorPairStringDouble", + "get_complex_map", + "get_vector_of_pairs", +] + +class MapStringComplex: + def __bool__(self) -> bool: + """ + Check whether the map is nonempty + """ + + @typing.overload + def __contains__(self, arg0: str) -> bool: ... + @typing.overload + def __contains__(self, arg0: typing.Any) -> bool: ... + def __delitem__(self, arg0: str) -> None: ... + def __getitem__(self, arg0: str) -> complex: ... + def __init__(self) -> None: ... + def __iter__(self) -> collections.abc.Iterator[str]: ... + def __len__(self) -> int: ... + def __repr__(self) -> str: + """ + Return the canonical string representation of this map. + """ + + def __setitem__(self, arg0: str, arg1: complex) -> None: ... + def items(self) -> typing.ItemsView: ... + def keys(self) -> typing.KeysView: ... + def values(self) -> typing.ValuesView: ... + +class VectorPairStringDouble: + __hash__: typing.ClassVar[None] = None + def __bool__(self) -> bool: + """ + Check whether the list is nonempty + """ + + def __contains__(self, x: tuple[str, typing.SupportsFloat]) -> bool: + """ + Return true the container contains ``x`` + """ + + @typing.overload + def __delitem__(self, arg0: typing.SupportsInt) -> None: + """ + Delete the list elements at index ``i`` + """ + + @typing.overload + def __delitem__(self, arg0: slice) -> None: + """ + Delete list elements using a slice object + """ + + def __eq__(self, arg0: VectorPairStringDouble) -> bool: ... + @typing.overload + def __getitem__(self, s: slice) -> VectorPairStringDouble: + """ + Retrieve list elements using a slice object + """ + + @typing.overload + def __getitem__(self, arg0: typing.SupportsInt) -> tuple[str, float]: ... + @typing.overload + def __init__(self) -> None: ... + @typing.overload + def __init__(self, arg0: VectorPairStringDouble) -> None: + """ + Copy constructor + """ + + @typing.overload + def __init__(self, arg0: collections.abc.Iterable) -> None: ... + def __iter__(self) -> collections.abc.Iterator[tuple[str, float]]: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: VectorPairStringDouble) -> bool: ... + @typing.overload + def __setitem__( + self, arg0: typing.SupportsInt, arg1: tuple[str, typing.SupportsFloat] + ) -> None: ... + @typing.overload + def __setitem__(self, arg0: slice, arg1: VectorPairStringDouble) -> None: + """ + Assign list elements using a slice object + """ + + def append(self, x: tuple[str, typing.SupportsFloat]) -> None: + """ + Add an item to the end of the list + """ + + def clear(self) -> None: + """ + Clear the contents + """ + + def count(self, x: tuple[str, typing.SupportsFloat]) -> int: + """ + Return the number of times ``x`` appears in the list + """ + + @typing.overload + def extend(self, L: VectorPairStringDouble) -> None: + """ + Extend the list by appending all the items in the given list + """ + + @typing.overload + def extend(self, L: collections.abc.Iterable) -> None: + """ + Extend the list by appending all the items in the given list + """ + + def insert( + self, i: typing.SupportsInt, x: tuple[str, typing.SupportsFloat] + ) -> None: + """ + Insert an item at a given position. + """ + + @typing.overload + def pop(self) -> tuple[str, float]: + """ + Remove and return the last item + """ + + @typing.overload + def pop(self, i: typing.SupportsInt) -> tuple[str, float]: + """ + Remove and return the item at index ``i`` + """ + + def remove(self, x: tuple[str, typing.SupportsFloat]) -> None: + """ + Remove the first item from the list whose value is x. It is an error if there is no such item. + """ + +def get_complex_map() -> MapStringComplex: ... +def get_vector_of_pairs() -> VectorPairStringDouble: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/typing.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/typing.pyi new file mode 100644 index 00000000..98fd047b --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/typing.pyi @@ -0,0 +1,8 @@ +from __future__ import annotations + +import collections.abc + +__all__: list[str] = ["get_buffer", "get_sequence"] + +def get_buffer(arg0: collections.abc.Buffer) -> collections.abc.Buffer: ... +def get_sequence(arg0: collections.abc.Sequence) -> collections.abc.Sequence: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi new file mode 100644 index 00000000..7c36d3fd --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi @@ -0,0 +1,36 @@ +from __future__ import annotations + +import datetime + +import numpy +from numpy import random + +__all__: list[str] = [ + "Dummy", + "Foo", + "add_day", + "foolist", + "foovar", + "list_with_none", + "none", + "random", + "t_10ms", + "t_20ns", + "t_30s", +] + +class Dummy: + linalg = numpy.linalg + +class Foo: + pass + +def add_day(arg0: datetime.datetime) -> datetime.datetime: ... + +foolist: list # value = [, ] +foovar: Foo # value = +list_with_none: list = [None, 2, {}] +none = None +t_10ms: datetime.timedelta # value = datetime.timedelta(microseconds=10000) +t_20ns: datetime.timedelta # value = datetime.timedelta(0) +t_30s: datetime.timedelta # value = datetime.timedelta(seconds=30) diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/core.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/core.pyi new file mode 100644 index 00000000..95c16467 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/core.pyi @@ -0,0 +1,35 @@ +from __future__ import annotations + +from demo._bindings import ( + aliases, + classes, + eigen, + enum, + flawed_bindings, + functions, + issues, + methods, + numpy, + properties, + stl, + stl_bind, + typing, + values, +) + +__all__: list[str] = [ + "aliases", + "classes", + "eigen", + "enum", + "flawed_bindings", + "functions", + "issues", + "methods", + "numpy", + "properties", + "stl", + "stl_bind", + "typing", + "values", +] diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/__init__.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/__init__.pyi new file mode 100644 index 00000000..10d343e0 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/__init__.pyi @@ -0,0 +1,11 @@ +from __future__ import annotations + +from . import classes, functions, functions_3_8_plus, functions_3_9_plus, values + +__all__: list[str] = [ + "classes", + "functions", + "functions_3_8_plus", + "functions_3_9_plus", + "values", +] diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/classes.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/classes.pyi new file mode 100644 index 00000000..32aa068b --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/classes.pyi @@ -0,0 +1,21 @@ +from __future__ import annotations + +__all__: list[str] = ["A", "B", "C", "X"] + +class A: + """ + A + """ + +class B(A): + """ + B + """ + +class C(B): + """ + C + """ + +class X: + pass diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi new file mode 100644 index 00000000..5ed9ef3c --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi @@ -0,0 +1,31 @@ +from __future__ import annotations + +import sys as sys +import typing as typing + +from demo.pure_python.functions_3_8_plus import args_mix +from demo.pure_python.functions_3_9_plus import generic_alias_annotation + +__all__: list[str] = [ + "accept_frozenset", + "args_mix", + "builtin_function_as_default_arg", + "function_as_default_arg", + "generic_alias_annotation", + "lambda_as_default_arg", + "search", + "static_method_as_default_arg", + "sys", + "typing", +] + +class _Dummy: + @staticmethod + def foo(): ... + +def accept_frozenset(arg: frozenset[int | float]) -> int | None: ... +def builtin_function_as_default_arg(func: type(len) = len): ... +def function_as_default_arg(func: type(search) = search): ... +def lambda_as_default_arg(callback=...): ... +def search(a: int, b: list[int]) -> int: ... +def static_method_as_default_arg(callback=_Dummy.foo): ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi new file mode 100644 index 00000000..e9164220 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi @@ -0,0 +1,15 @@ +from __future__ import annotations + +import typing as typing + +__all__: list[str] = ["args_mix", "typing"] + +def args_mix( + a: int, + b: float = 0.5, + c: str = "", + *args: int, + x: int = 1, + y=int, + **kwargs: typing.Dict[int, str], +): ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_9_plus.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_9_plus.pyi new file mode 100644 index 00000000..59b9b80c --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_9_plus.pyi @@ -0,0 +1,5 @@ +from __future__ import annotations + +__all__: list[str] = ["generic_alias_annotation"] + +def generic_alias_annotation(a: list[tuple[int]], b: dict[int, str]) -> list[float]: ... diff --git a/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/values.pyi b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/values.pyi new file mode 100644 index 00000000..07913391 --- /dev/null +++ b/tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/pure_python/values.pyi @@ -0,0 +1,4 @@ +from __future__ import annotations + +__all__: list[str] = ["callables_dict"] +callables_dict: dict = {"len": len, "int": int} From 5a5da58b3fb5df9c0f682d886b8409e489147044 Mon Sep 17 00:00:00 2001 From: gentlegiantJGC Date: Thu, 11 Sep 2025 17:56:32 +0100 Subject: [PATCH 8/8] Replace setup.py with pyproject.toml (#16) * Replace setup.py with pyproject.toml pyproject.toml is the modern way of listing package metadata. Since this library is not doing anything complex in the build process the setup.py is no longer needed. * Fix find packages --- pyproject.toml | 28 ++++++++++++++++++++++++++++ setup.py | 19 ------------------- 2 files changed, 28 insertions(+), 19 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..e0de5022 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,28 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "pybind11-stubgen" +description = "PEP 561 type stubs generator for pybind11 modules" +version = "2.5.5" +requires-python = "~=3.7" +authors = [ + {name = "Sergei Izmailov", email = "sergei.a.izmailov@gmail.com"}, +] +license = "BSD-3-Clause" +license-files = ["LICENSE"] +dynamic = ["readme"] + +[project.urls] +Repository = "https://github.com/sizmailov/pybind11-stubgen" +Issues = "https://github.com/sizmailov/pybind11-stubgen/issues" + +[tool.setuptools.packages] +find = {} + +[tool.setuptools.dynamic] +readme = {file = ["README.md"], content-type = "text/markdown"} + +[project.entry-points.console_scripts] +pybind11-stubgen = "pybind11_stubgen.__init__:main" diff --git a/setup.py b/setup.py deleted file mode 100644 index 27a68aaa..00000000 --- a/setup.py +++ /dev/null @@ -1,19 +0,0 @@ -from setuptools import find_packages, setup - -setup( - name="pybind11-stubgen", - maintainer="Sergei Izmailov", - maintainer_email="sergei.a.izmailov@gmail.com", - description="PEP 561 type stubs generator for pybind11 modules", - url="https://github.com/sizmailov/pybind11-stubgen", - version="2.5.5", - long_description=open("README.md").read(), - long_description_content_type="text/markdown", - license="BSD", - entry_points={ - "console_scripts": "pybind11-stubgen = pybind11_stubgen.__init__:main" - }, - packages=find_packages(), - package_data={"pybind11_stubgen": ["py.typed"]}, - python_requires="~=3.7", -)