Skip to content

Commit f579782

Browse files
committed
Add pybind-v2.12 stubs (identical to pybind-v2.13)
1 parent 6bb7ab1 commit f579782

30 files changed

+961
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
from __future__ import annotations
2+
3+
from demo._bindings import (
4+
aliases,
5+
classes,
6+
eigen,
7+
enum,
8+
flawed_bindings,
9+
functions,
10+
issues,
11+
methods,
12+
numpy,
13+
properties,
14+
stl,
15+
stl_bind,
16+
typing,
17+
values,
18+
)
19+
20+
from . import _bindings, core, pure_python
21+
22+
__all__ = [
23+
"aliases",
24+
"classes",
25+
"core",
26+
"eigen",
27+
"enum",
28+
"flawed_bindings",
29+
"functions",
30+
"issues",
31+
"methods",
32+
"numpy",
33+
"properties",
34+
"pure_python",
35+
"stl",
36+
"stl_bind",
37+
"typing",
38+
"values",
39+
"version",
40+
]
41+
version: str = "0.0.0"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from __future__ import annotations
2+
3+
from . import (
4+
aliases,
5+
classes,
6+
eigen,
7+
enum,
8+
flawed_bindings,
9+
functions,
10+
issues,
11+
methods,
12+
numpy,
13+
properties,
14+
stl,
15+
stl_bind,
16+
typing,
17+
values,
18+
)
19+
20+
__all__ = [
21+
"aliases",
22+
"classes",
23+
"eigen",
24+
"enum",
25+
"flawed_bindings",
26+
"functions",
27+
"issues",
28+
"methods",
29+
"numpy",
30+
"properties",
31+
"stl",
32+
"stl_bind",
33+
"typing",
34+
"values",
35+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
from __future__ import annotations
2+
3+
import typing
4+
5+
import numpy
6+
from numpy import random
7+
8+
import demo._bindings.enum
9+
from demo._bindings.aliases.foreign_method_arg import Bar2 as foreign_type_alias
10+
from demo._bindings.aliases.foreign_return import get_foo as foreign_class_alias
11+
12+
from . import (
13+
foreign_arg,
14+
foreign_attr,
15+
foreign_class_member,
16+
foreign_method_arg,
17+
foreign_method_return,
18+
foreign_return,
19+
missing_self_arg,
20+
)
21+
22+
__all__ = [
23+
"Color",
24+
"Dummy",
25+
"foreign_arg",
26+
"foreign_attr",
27+
"foreign_class_alias",
28+
"foreign_class_member",
29+
"foreign_enum_default",
30+
"foreign_method_arg",
31+
"foreign_method_return",
32+
"foreign_return",
33+
"foreign_type_alias",
34+
"func",
35+
"local_func_alias",
36+
"local_type_alias",
37+
"missing_self_arg",
38+
"random",
39+
]
40+
41+
class Color:
42+
pass
43+
44+
class Dummy:
45+
linalg = numpy.linalg
46+
47+
def foreign_enum_default(
48+
color: typing.Any = demo._bindings.enum.ConsoleForegroundColor.Blue,
49+
) -> None: ...
50+
def func(arg0: int) -> int: ...
51+
52+
local_func_alias = func
53+
local_type_alias = Color
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from __future__ import annotations
2+
3+
import demo._bindings.classes
4+
5+
__all__ = ["set_foo"]
6+
7+
def set_foo(arg0: demo._bindings.classes.Foo) -> int: ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from __future__ import annotations
2+
3+
import demo._bindings.classes
4+
5+
__all__ = ["value"]
6+
value: demo._bindings.classes.Foo # value = <demo._bindings.classes.Foo object>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from __future__ import annotations
2+
3+
import typing
4+
5+
import demo._bindings.classes
6+
7+
__all__ = ["Bar1"]
8+
9+
class Bar1:
10+
foo: typing.ClassVar[
11+
demo._bindings.classes.Foo
12+
] # value = <demo._bindings.classes.Foo object>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from __future__ import annotations
2+
3+
import demo._bindings.classes
4+
5+
__all__ = ["Bar2"]
6+
7+
class Bar2:
8+
def set_foo(self, arg0: demo._bindings.classes.Foo) -> int: ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from __future__ import annotations
2+
3+
import demo._bindings.classes
4+
5+
__all__ = ["Bar3"]
6+
7+
class Bar3:
8+
@staticmethod
9+
def get_foo() -> demo._bindings.classes.Foo: ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from __future__ import annotations
2+
3+
import demo._bindings.classes
4+
5+
__all__ = ["get_foo"]
6+
7+
def get_foo() -> demo._bindings.classes.Foo: ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from __future__ import annotations
2+
3+
import demo._bindings.classes
4+
5+
__all__ = ["Bar4"]
6+
7+
class Bar4:
8+
def set_foo(self: demo._bindings.classes.Foo) -> int: ...
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
from __future__ import annotations
2+
3+
import typing
4+
5+
__all__ = ["Base", "CppException", "Derived", "Foo", "Outer"]
6+
7+
class Base:
8+
class Inner:
9+
pass
10+
name: str
11+
12+
class CppException(Exception):
13+
pass
14+
15+
class Derived(Base):
16+
count: int
17+
18+
class Foo:
19+
class FooChild:
20+
def __init__(self) -> None: ...
21+
def g(self) -> None: ...
22+
23+
def __init__(self) -> None: ...
24+
def f(self) -> None: ...
25+
26+
class Outer:
27+
class Inner:
28+
class NestedEnum:
29+
"""
30+
Members:
31+
32+
ONE
33+
34+
TWO
35+
"""
36+
37+
ONE: typing.ClassVar[Outer.Inner.NestedEnum] # value = <NestedEnum.ONE: 1>
38+
TWO: typing.ClassVar[Outer.Inner.NestedEnum] # value = <NestedEnum.TWO: 2>
39+
__members__: typing.ClassVar[
40+
dict[str, Outer.Inner.NestedEnum]
41+
] # value = {'ONE': <NestedEnum.ONE: 1>, 'TWO': <NestedEnum.TWO: 2>}
42+
def __eq__(self, other: typing.Any) -> bool: ...
43+
def __getstate__(self) -> int: ...
44+
def __hash__(self) -> int: ...
45+
def __index__(self) -> int: ...
46+
def __init__(self, value: int) -> None: ...
47+
def __int__(self) -> int: ...
48+
def __ne__(self, other: typing.Any) -> bool: ...
49+
def __repr__(self) -> str: ...
50+
def __setstate__(self, state: int) -> None: ...
51+
def __str__(self) -> str: ...
52+
@property
53+
def name(self) -> str: ...
54+
@property
55+
def value(self) -> int: ...
56+
value: Outer.Inner.NestedEnum
57+
inner: Outer.Inner
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
from __future__ import annotations
2+
3+
import typing
4+
5+
import numpy
6+
import pybind11_stubgen.typing_ext
7+
import scipy.sparse
8+
9+
__all__ = [
10+
"accept_matrix_int",
11+
"accept_vector_float64",
12+
"dense_matrix_c",
13+
"dense_matrix_r",
14+
"fixed_mutator_a",
15+
"fixed_mutator_c",
16+
"fixed_mutator_r",
17+
"four_col_matrix_r",
18+
"four_row_matrix_r",
19+
"get_matrix_int",
20+
"get_vector_float64",
21+
"sparse_matrix_c",
22+
"sparse_matrix_r",
23+
]
24+
25+
def accept_matrix_int(
26+
arg0: typing.Annotated[
27+
numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3)
28+
]
29+
) -> None: ...
30+
def accept_vector_float64(
31+
arg0: typing.Annotated[
32+
numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1)
33+
]
34+
) -> None: ...
35+
def dense_matrix_c(
36+
arg0: typing.Annotated[
37+
numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n")
38+
]
39+
) -> typing.Annotated[
40+
numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n")
41+
]: ...
42+
def dense_matrix_r(
43+
arg0: typing.Annotated[
44+
numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n")
45+
]
46+
) -> typing.Annotated[
47+
numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n")
48+
]: ...
49+
def fixed_mutator_a(
50+
arg0: typing.Annotated[
51+
numpy.ndarray,
52+
numpy.float32,
53+
pybind11_stubgen.typing_ext.FixedSize(5, 6),
54+
numpy.ndarray.flags.writeable,
55+
]
56+
) -> None: ...
57+
def fixed_mutator_c(
58+
arg0: typing.Annotated[
59+
numpy.ndarray,
60+
numpy.float32,
61+
pybind11_stubgen.typing_ext.FixedSize(5, 6),
62+
numpy.ndarray.flags.writeable,
63+
numpy.ndarray.flags.f_contiguous,
64+
]
65+
) -> None: ...
66+
def fixed_mutator_r(
67+
arg0: typing.Annotated[
68+
numpy.ndarray,
69+
numpy.float32,
70+
pybind11_stubgen.typing_ext.FixedSize(5, 6),
71+
numpy.ndarray.flags.writeable,
72+
numpy.ndarray.flags.c_contiguous,
73+
]
74+
) -> None: ...
75+
def four_col_matrix_r(
76+
arg0: typing.Annotated[
77+
numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", 4)
78+
]
79+
) -> typing.Annotated[
80+
numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", 4)
81+
]: ...
82+
def four_row_matrix_r(
83+
arg0: typing.Annotated[
84+
numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize(4, "n")
85+
]
86+
) -> typing.Annotated[
87+
numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize(4, "n")
88+
]: ...
89+
def get_matrix_int() -> typing.Annotated[
90+
numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3)
91+
]: ...
92+
def get_vector_float64() -> typing.Annotated[
93+
numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1)
94+
]: ...
95+
def sparse_matrix_c(
96+
arg0: typing.Annotated[scipy.sparse.csc_matrix, numpy.float32]
97+
) -> typing.Annotated[scipy.sparse.csc_matrix, numpy.float32]: ...
98+
def sparse_matrix_r(
99+
arg0: typing.Annotated[scipy.sparse.csr_matrix, numpy.float32]
100+
) -> typing.Annotated[scipy.sparse.csr_matrix, numpy.float32]: ...

0 commit comments

Comments
 (0)