Skip to content

Commit

Permalink
Release 2.5.2 (#245)
Browse files Browse the repository at this point in the history
Changes:
- ✨ Ignore technical dunder Python 3.13 fields (`__static_attributes__`
and `__firstlineno__`): (#243) by @nim65s
- 🔧 CI: Drop Python 3.7, add Python 3.13 (#243) by @nim65s
  • Loading branch information
sizmailov authored Feb 24, 2025
1 parent 198a75a commit 433c899
Show file tree
Hide file tree
Showing 148 changed files with 890 additions and 62 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
name: Format code
runs-on: ubuntu-latest
steps:
- name: Setup Python
- name: Setup Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.13'
python-version: "3.13"
- name: Checkout
uses: actions/checkout@v4
- name: Install requirements
Expand All @@ -44,7 +44,7 @@ jobs:
fail-fast: false
matrix:
pybind11-branch:
- "master"
- "v2.13"
python:
- "3.13"
- "3.12"
Expand All @@ -55,15 +55,21 @@ jobs:
numpy-format:
- "numpy-array-wrap-with-annotated"
include:
- python: "3.12"
- python: "3.13"
pybind11-branch: "v2.9"
numpy-format: "numpy-array-wrap-with-annotated"
- python: "3.12"
- python: "3.13"
pybind11-branch: "v2.11"
numpy-format: "numpy-array-wrap-with-annotated"
- python: "3.12"
pybind11-branch: "master"
- 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"
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -157,7 +163,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python }}
- name: Setup Python 3.13
uses: actions/setup-python@v2
with:
python-version: "3.13"
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

Version 2.5.2 (Feb 24, 2025)
--------------------------
Changes:
- ✨ Ignore technical dunder Python 3.13 fields (`__static_attributes__` and `__firstlineno__`): (#243) by @nim65s
- 🔧 CI: Drop Python 3.7, add Python 3.13 (#243) by @nim65s


Version 2.5.1 (Mar 26, 2024)
--------------------------
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
maintainer_email="[email protected]",
description="PEP 561 type stubs generator for pybind11 modules",
url="https://github.com/sizmailov/pybind11-stubgen",
version="2.5.1",
version="2.5.2",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
license="BSD",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from __future__ import annotations

import typing

import numpy
import pybind11_stubgen.typing_ext
import scipy.sparse
import typing_extensions

__all__ = [
"accept_matrix_int",
Expand All @@ -22,39 +23,39 @@ __all__ = [
]

def accept_matrix_int(
arg0: typing_extensions.Annotated[
arg0: typing.Annotated[
numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3)
]
) -> None: ...
def accept_vector_float64(
arg0: typing_extensions.Annotated[
arg0: typing.Annotated[
numpy.ndarray, numpy.float64, pybind11_stubgen.typing_ext.FixedSize(3, 1)
]
) -> None: ...
def dense_matrix_c(
arg0: typing_extensions.Annotated[
arg0: typing.Annotated[
numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n")
]
) -> typing_extensions.Annotated[
) -> typing.Annotated[
numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n")
]: ...
def dense_matrix_r(
arg0: typing_extensions.Annotated[
arg0: typing.Annotated[
numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n")
]
) -> typing_extensions.Annotated[
) -> typing.Annotated[
numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", "n")
]: ...
def fixed_mutator_a(
arg0: typing_extensions.Annotated[
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_extensions.Annotated[
arg0: typing.Annotated[
numpy.ndarray,
numpy.float32,
pybind11_stubgen.typing_ext.FixedSize(5, 6),
Expand All @@ -63,7 +64,7 @@ def fixed_mutator_c(
]
) -> None: ...
def fixed_mutator_r(
arg0: typing_extensions.Annotated[
arg0: typing.Annotated[
numpy.ndarray,
numpy.float32,
pybind11_stubgen.typing_ext.FixedSize(5, 6),
Expand All @@ -72,28 +73,28 @@ def fixed_mutator_r(
]
) -> None: ...
def four_col_matrix_r(
arg0: typing_extensions.Annotated[
arg0: typing.Annotated[
numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", 4)
]
) -> typing_extensions.Annotated[
) -> typing.Annotated[
numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize("m", 4)
]: ...
def four_row_matrix_r(
arg0: typing_extensions.Annotated[
arg0: typing.Annotated[
numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize(4, "n")
]
) -> typing_extensions.Annotated[
) -> typing.Annotated[
numpy.ndarray, numpy.float32, pybind11_stubgen.typing_ext.DynamicSize(4, "n")
]: ...
def get_matrix_int() -> typing_extensions.Annotated[
def get_matrix_int() -> typing.Annotated[
numpy.ndarray, numpy.int32, pybind11_stubgen.typing_ext.FixedSize(3, 3)
]: ...
def get_vector_float64() -> typing_extensions.Annotated[
def get_vector_float64() -> typing.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]: ...
arg0: typing.Annotated[scipy.sparse.csc_matrix, numpy.float32]
) -> typing.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]: ...
arg0: typing.Annotated[scipy.sparse.csr_matrix, numpy.float32]
) -> typing.Annotated[scipy.sparse.csr_matrix, numpy.float32]: ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from __future__ import annotations

import typing

import numpy

__all__ = [
"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]: ...
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@ from __future__ import annotations
import typing

import pybind11_stubgen.typing_ext
import typing_extensions

__all__ = ["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)
]: ...
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: ...
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from __future__ import annotations

from . import classes, functions, functions_3_8_plus, functions_3_9_plus, values

__all__ = ["classes", "functions", "functions_3_8_plus", "functions_3_9_plus", "values"]
Original file line number Diff line number Diff line change
@@ -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__ = [
"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): ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from __future__ import annotations

__all__ = ["generic_alias_annotation"]

def generic_alias_annotation(a: list[tuple[int]], b: dict[int, str]) -> list[float]: ...

This file was deleted.

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"
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",
]
Loading

0 comments on commit 433c899

Please sign in to comment.