Skip to content

Commit

Permalink
ci: Try Python 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
sizmailov committed Aug 31, 2023
1 parent a23fd4d commit e856c39
Show file tree
Hide file tree
Showing 28 changed files with 722 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- runs-on: "ubuntu-latest"
python: "3.7"
pybind11-branch: "master"
- runs-on: "ubuntu-latest"
- runs-on: "ubuntu-20.04"
python: "3.6"
pybind11-branch: "master"
steps:
Expand Down
41 changes: 41 additions & 0 deletions tests/stubs/python-3.6/pybind11-master/demo/__init__.pyi
Original file line number Diff line number Diff line change
@@ -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__ = [
"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"
35 changes: 35 additions & 0 deletions tests/stubs/python-3.6/pybind11-master/demo/_bindings/__init__.pyi
Original file line number Diff line number Diff line change
@@ -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__ = [
"aliases",
"classes",
"eigen",
"enum",
"flawed_bindings",
"functions",
"issues",
"methods",
"numpy",
"properties",
"stl",
"stl_bind",
"typing",
"values",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from __future__ import annotations

import numpy
from numpy import random

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,
)

__all__ = [
"Color",
"Dummy",
"foreign_arg",
"foreign_attr",
"foreign_class_alias",
"foreign_class_member",
"foreign_method_arg",
"foreign_method_return",
"foreign_return",
"foreign_type_alias",
"func",
"local_func_alias",
"local_type_alias",
"random",
]

class Color:
pass

class Dummy:
linalg = numpy.linalg

def func(arg0: int) -> int: ...

local_func_alias = func
local_type_alias = Color
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from __future__ import annotations

import demo._bindings.classes

__all__ = ["set_foo"]

def set_foo(arg0: demo._bindings.classes.Foo) -> int: ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from __future__ import annotations

import demo._bindings.classes

__all__ = ["value"]
value: demo._bindings.classes.Foo # value = <demo._bindings.classes.Foo object>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from __future__ import annotations

import typing

import demo._bindings.classes

__all__ = ["Bar1"]

class Bar1:
foo: typing.ClassVar[
demo._bindings.classes.Foo
] # value = <demo._bindings.classes.Foo object>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from __future__ import annotations

import demo._bindings.classes

__all__ = ["Bar2"]

class Bar2:
def set_foo(self) -> int: ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from __future__ import annotations

import demo._bindings.classes

__all__ = ["Bar3"]

class Bar3:
@staticmethod
def get_foo() -> demo._bindings.classes.Foo: ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from __future__ import annotations

import demo._bindings.classes

__all__ = ["get_foo"]

def get_foo() -> demo._bindings.classes.Foo: ...
57 changes: 57 additions & 0 deletions tests/stubs/python-3.6/pybind11-master/demo/_bindings/classes.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
from __future__ import annotations

import typing

__all__ = ["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 = <NestedEnum.ONE: 1>
TWO: typing.ClassVar[Outer.Inner.NestedEnum] # value = <NestedEnum.TWO: 2>
__members__: typing.ClassVar[
dict[str, Outer.Inner.NestedEnum]
] # value = {'ONE': <NestedEnum.ONE: 1>, 'TWO': <NestedEnum.TWO: 2>}
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(arg0: Outer.Inner.NestedEnum) -> int: ...
value: Outer.Inner.NestedEnum
inner: Outer.Inner
28 changes: 28 additions & 0 deletions tests/stubs/python-3.6/pybind11-master/demo/_bindings/eigen.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from __future__ import annotations

import numpy
import pybind11_stubgen.typing_ext

__all__ = [
"accept_matrix_int",
"accept_vector_float64",
"get_matrix_int",
"get_vector_float64",
]

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 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)
]: ...
62 changes: 62 additions & 0 deletions tests/stubs/python-3.6/pybind11-master/demo/_bindings/enum.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
from __future__ import annotations

import typing

__all__ = [
"Blue",
"ConsoleForegroundColor",
"Green",
"Magenta",
"Yellow",
"accept_defaulted_enum",
]

class ConsoleForegroundColor:
"""
Members:
Green
Yellow
Blue
Magenta
"""

Blue: typing.ClassVar[
ConsoleForegroundColor
] # value = <ConsoleForegroundColor.Blue: 34>
Green: typing.ClassVar[
ConsoleForegroundColor
] # value = <ConsoleForegroundColor.Green: 32>
Magenta: typing.ClassVar[
ConsoleForegroundColor
] # value = <ConsoleForegroundColor.Magenta: 35>
Yellow: typing.ClassVar[
ConsoleForegroundColor
] # value = <ConsoleForegroundColor.Yellow: 33>
__members__: typing.ClassVar[
dict[str, ConsoleForegroundColor]
] # value = {'Green': <ConsoleForegroundColor.Green: 32>, 'Yellow': <ConsoleForegroundColor.Yellow: 33>, 'Blue': <ConsoleForegroundColor.Blue: 34>, 'Magenta': <ConsoleForegroundColor.Magenta: 35>}
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(arg0: ConsoleForegroundColor) -> int: ...

def accept_defaulted_enum(color: ConsoleForegroundColor = ...) -> None: ...

Blue: ConsoleForegroundColor # value = <ConsoleForegroundColor.Blue: 34>
Green: ConsoleForegroundColor # value = <ConsoleForegroundColor.Green: 32>
Magenta: ConsoleForegroundColor # value = <ConsoleForegroundColor.Magenta: 35>
Yellow: ConsoleForegroundColor # value = <ConsoleForegroundColor.Yellow: 33>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from __future__ import annotations

__all__ = [
"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() -> ...: ...
Loading

0 comments on commit e856c39

Please sign in to comment.