mirror of
https://github.com/pybind/pybind11.git
synced 2025-02-17 06:00:51 +00:00
Merge branch 'pybind:master' into master
This commit is contained in:
commit
cd2b9d4b09
19
.github/workflows/ci.yml
vendored
19
.github/workflows/ci.yml
vendored
@ -600,11 +600,11 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
centos:
|
centos:
|
||||||
- 7 # GCC 4.8
|
- centos7 # GCC 4.8
|
||||||
- 8
|
- stream8
|
||||||
|
|
||||||
name: "🐍 3 • CentOS ${{ matrix.centos }} • x64"
|
name: "🐍 3 • CentOS ${{ matrix.centos }} • x64"
|
||||||
container: "centos:${{ matrix.centos }}"
|
container: "quay.io/centos/centos:${{ matrix.centos }}"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -619,22 +619,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python3 -m pip install cmake -r tests/requirements.txt
|
python3 -m pip install cmake -r tests/requirements.txt
|
||||||
|
|
||||||
- name: VAR_BUILD_TYPE 7
|
|
||||||
if: matrix.centos == 7
|
|
||||||
run: echo MinSizeRel > VAR_BUILD_TYPE
|
|
||||||
|
|
||||||
# Using Release to avoid segfault that appeared around 2021-06-04,
|
|
||||||
# apparently when the gcc version changed from 8.3 to 8.4.
|
|
||||||
- name: VAR_BUILD_TYPE 8
|
|
||||||
if: matrix.centos == 8
|
|
||||||
run: echo Release > VAR_BUILD_TYPE
|
|
||||||
|
|
||||||
# Temporally disabling EIGEN due to SSL issue in CentOS 7
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
shell: bash
|
shell: bash
|
||||||
run: >
|
run: >
|
||||||
cmake -S . -B build
|
cmake -S . -B build
|
||||||
-DCMAKE_BUILD_TYPE=$(cat VAR_BUILD_TYPE)
|
-DCMAKE_BUILD_TYPE=MinSizeRel
|
||||||
-DPYBIND11_WERROR=ON
|
-DPYBIND11_WERROR=ON
|
||||||
-DDOWNLOAD_CATCH=ON
|
-DDOWNLOAD_CATCH=ON
|
||||||
-DDOWNLOAD_EIGEN=ON
|
-DDOWNLOAD_EIGEN=ON
|
||||||
|
@ -6,6 +6,65 @@ Changelog
|
|||||||
Starting with version 1.8.0, pybind11 releases use a `semantic versioning
|
Starting with version 1.8.0, pybind11 releases use a `semantic versioning
|
||||||
<http://semver.org>`_ policy.
|
<http://semver.org>`_ policy.
|
||||||
|
|
||||||
|
IN DEVELOPMENT
|
||||||
|
--------------
|
||||||
|
|
||||||
|
Changes will be added here periodically.
|
||||||
|
|
||||||
|
|
||||||
|
Version 2.9.1 (Feb 2, 2022)
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
* If possible, attach Python exception with ``py::raise_from`` to ``TypeError``
|
||||||
|
when casting from C++ to Python. This will give additional info if Python
|
||||||
|
exceptions occur in the caster. Adds a test case of trying to convert a set
|
||||||
|
from C++ to Python when the hash function is not defined in Python.
|
||||||
|
`#3605 <https://github.com/pybind/pybind11/pull/3605>`_
|
||||||
|
|
||||||
|
* Add a mapping of C++11 nested exceptions to their Python exception
|
||||||
|
equivalent using ``py::raise_from``. This attaches the nested exceptions in
|
||||||
|
Python using the ``__cause__`` field.
|
||||||
|
`#3608 <https://github.com/pybind/pybind11/pull/3608>`_
|
||||||
|
|
||||||
|
* Propagate Python exception traceback using ``raise_from`` if a pybind11
|
||||||
|
function runs out of overloads.
|
||||||
|
`#3671 <https://github.com/pybind/pybind11/pull/3671>`_
|
||||||
|
|
||||||
|
* ``py::multiple_inheritance`` is now only needed when C++ bases are hidden
|
||||||
|
from pybind11.
|
||||||
|
`#3650 <https://github.com/pybind/pybind11/pull/3650>`_ and
|
||||||
|
`#3659 <https://github.com/pybind/pybind11/pull/3659>`_
|
||||||
|
|
||||||
|
|
||||||
|
Bug fixes:
|
||||||
|
|
||||||
|
* Remove a boolean cast in ``numpy.h`` that causes MSVC C4800 warnings when
|
||||||
|
compiling against Python 3.10 or newer.
|
||||||
|
`#3669 <https://github.com/pybind/pybind11/pull/3669>`_
|
||||||
|
|
||||||
|
* Render ``py::bool_`` and ``py::float_`` as ``bool`` and ``float``
|
||||||
|
respectively.
|
||||||
|
`#3622 <https://github.com/pybind/pybind11/pull/3622>`_
|
||||||
|
|
||||||
|
Build system improvements:
|
||||||
|
|
||||||
|
* Fix CMake extension suffix computation on Python 3.10+.
|
||||||
|
`#3663 <https://github.com/pybind/pybind11/pull/3663>`_
|
||||||
|
|
||||||
|
* Allow ``CMAKE_ARGS`` to override CMake args in pybind11's own ``setup.py``.
|
||||||
|
`#3577 <https://github.com/pybind/pybind11/pull/3577>`_
|
||||||
|
|
||||||
|
* Remove a few deprecated c-headers.
|
||||||
|
`#3610 <https://github.com/pybind/pybind11/pull/3610>`_
|
||||||
|
|
||||||
|
* More uniform handling of test targets.
|
||||||
|
`#3590 <https://github.com/pybind/pybind11/pull/3590>`_
|
||||||
|
|
||||||
|
* Add clang-tidy readability check to catch potentially swapped function args.
|
||||||
|
`#3611 <https://github.com/pybind/pybind11/pull/3611>`_
|
||||||
|
|
||||||
|
|
||||||
Version 2.9.0 (Dec 28, 2021)
|
Version 2.9.0 (Dec 28, 2021)
|
||||||
----------------------------
|
----------------------------
|
||||||
|
@ -10,12 +10,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define PYBIND11_VERSION_MAJOR 2
|
#define PYBIND11_VERSION_MAJOR 2
|
||||||
#define PYBIND11_VERSION_MINOR 9
|
#define PYBIND11_VERSION_MINOR 10
|
||||||
#define PYBIND11_VERSION_PATCH 0
|
#define PYBIND11_VERSION_PATCH 0.dev1
|
||||||
|
|
||||||
// Similar to Python's convention: https://docs.python.org/3/c-api/apiabiversion.html
|
// Similar to Python's convention: https://docs.python.org/3/c-api/apiabiversion.html
|
||||||
// Additional convention: 0xD = dev
|
// Additional convention: 0xD = dev
|
||||||
#define PYBIND11_VERSION_HEX 0x02090000
|
#define PYBIND11_VERSION_HEX 0x020A00D1
|
||||||
|
|
||||||
#define PYBIND11_NAMESPACE_BEGIN(name) namespace name {
|
#define PYBIND11_NAMESPACE_BEGIN(name) namespace name {
|
||||||
#define PYBIND11_NAMESPACE_END(name) }
|
#define PYBIND11_NAMESPACE_END(name) }
|
||||||
|
@ -991,6 +991,7 @@ protected:
|
|||||||
#if PY_VERSION_HEX >= 0x03030000
|
#if PY_VERSION_HEX >= 0x03030000
|
||||||
// Attach additional error info to the exception if supported
|
// Attach additional error info to the exception if supported
|
||||||
if (PyErr_Occurred()) {
|
if (PyErr_Occurred()) {
|
||||||
|
// #HelpAppreciated: unit test coverage for this branch.
|
||||||
raise_from(PyExc_TypeError, msg.c_str());
|
raise_from(PyExc_TypeError, msg.c_str());
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -8,5 +8,5 @@ def _to_int(s):
|
|||||||
return s
|
return s
|
||||||
|
|
||||||
|
|
||||||
__version__ = "2.9.0"
|
__version__ = "2.10.0.dev1"
|
||||||
version_info = tuple(_to_int(s) for s in __version__.split("."))
|
version_info = tuple(_to_int(s) for s in __version__.split("."))
|
||||||
|
@ -31,8 +31,15 @@ keywords =
|
|||||||
C++11
|
C++11
|
||||||
Python bindings
|
Python bindings
|
||||||
|
|
||||||
|
project_urls =
|
||||||
|
Documentation = https://pybind11.readthedocs.io/
|
||||||
|
Bug Tracker = https://github.com/pybind/pybind11/issues
|
||||||
|
Discussions = https://github.com/pybind/pybind11/discussions
|
||||||
|
Changelog = https://pybind11.readthedocs.io/en/latest/changelog.html
|
||||||
|
Chat = https://gitter.im/pybind/Lobby
|
||||||
|
|
||||||
[options]
|
[options]
|
||||||
python_requires = >=2.7, !=3.0, !=3.1, !=3.2, !=3.3, !=3.4
|
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
|
||||||
zip_safe = False
|
zip_safe = False
|
||||||
|
|
||||||
[bdist_wheel]
|
[bdist_wheel]
|
||||||
|
7
setup.py
7
setup.py
@ -45,8 +45,11 @@ def build_expected_version_hex(matches):
|
|||||||
if serial is None:
|
if serial is None:
|
||||||
msg = 'Invalid PYBIND11_VERSION_PATCH: "{}"'.format(patch_level_serial)
|
msg = 'Invalid PYBIND11_VERSION_PATCH: "{}"'.format(patch_level_serial)
|
||||||
raise RuntimeError(msg)
|
raise RuntimeError(msg)
|
||||||
return "0x{:02x}{:02x}{:02x}{}{:x}".format(
|
return (
|
||||||
major, minor, patch, level[:1].upper(), serial
|
"0x"
|
||||||
|
+ "{:02x}{:02x}{:02x}{}{:x}".format(
|
||||||
|
major, minor, patch, level[:1], serial
|
||||||
|
).upper()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ def test_dtype(simple_dtype):
|
|||||||
|
|
||||||
e = "<" if byteorder == "little" else ">"
|
e = "<" if byteorder == "little" else ">"
|
||||||
|
|
||||||
assert m.print_dtypes() == [
|
assert [x.replace(" ", "") for x in m.print_dtypes()] == [
|
||||||
simple_dtype_fmt(),
|
simple_dtype_fmt(),
|
||||||
packed_dtype_fmt(),
|
packed_dtype_fmt(),
|
||||||
"[('a',{}),('b',{})]".format(simple_dtype_fmt(), packed_dtype_fmt()),
|
"[('a',{}),('b',{})]".format(simple_dtype_fmt(), packed_dtype_fmt()),
|
||||||
@ -238,7 +238,7 @@ def test_recarray(simple_dtype, packed_dtype):
|
|||||||
]
|
]
|
||||||
|
|
||||||
arr = m.create_rec_partial(3)
|
arr = m.create_rec_partial(3)
|
||||||
assert str(arr.dtype) == partial_dtype_fmt()
|
assert str(arr.dtype).replace(" ", "") == partial_dtype_fmt()
|
||||||
partial_dtype = arr.dtype
|
partial_dtype = arr.dtype
|
||||||
assert "" not in arr.dtype.fields
|
assert "" not in arr.dtype.fields
|
||||||
assert partial_dtype.itemsize > simple_dtype.itemsize
|
assert partial_dtype.itemsize > simple_dtype.itemsize
|
||||||
@ -246,7 +246,7 @@ def test_recarray(simple_dtype, packed_dtype):
|
|||||||
assert_equal(arr, elements, packed_dtype)
|
assert_equal(arr, elements, packed_dtype)
|
||||||
|
|
||||||
arr = m.create_rec_partial_nested(3)
|
arr = m.create_rec_partial_nested(3)
|
||||||
assert str(arr.dtype) == partial_nested_fmt()
|
assert str(arr.dtype).replace(" ", "") == partial_nested_fmt()
|
||||||
assert "" not in arr.dtype.fields
|
assert "" not in arr.dtype.fields
|
||||||
assert "" not in arr.dtype.fields["a"][0].fields
|
assert "" not in arr.dtype.fields["a"][0].fields
|
||||||
assert arr.dtype.itemsize > partial_dtype.itemsize
|
assert arr.dtype.itemsize > partial_dtype.itemsize
|
||||||
@ -285,7 +285,7 @@ def test_array_array():
|
|||||||
e = "<" if byteorder == "little" else ">"
|
e = "<" if byteorder == "little" else ">"
|
||||||
|
|
||||||
arr = m.create_array_array(3)
|
arr = m.create_array_array(3)
|
||||||
assert str(arr.dtype) == (
|
assert str(arr.dtype).replace(" ", "") == (
|
||||||
"{{'names':['a','b','c','d'],"
|
"{{'names':['a','b','c','d'],"
|
||||||
+ "'formats':[('S4',(3,)),('"
|
+ "'formats':[('S4',(3,)),('"
|
||||||
+ e
|
+ e
|
||||||
|
Loading…
Reference in New Issue
Block a user