ext: Update Pybind to Version 2.10.3
Updating Pybind11 is necessary for gem5 to compile correctly with Python 3.11. As of March 9th 2023, 2.10.3 is the latest version of Pybind11. Change-Id: I32c68c507770040d3fac2de442d88a8f46b48896 Issue-on: https://gem5.atlassian.net/browse/GEM5-1295 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/68818 Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
committed by
Bobby Bruce
parent
b305019ac4
commit
07fca546e6
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import pytest
|
||||
|
||||
import env # noqa: F401
|
||||
@@ -19,9 +18,7 @@ def test_dtypes():
|
||||
assert check.numpy == check.pybind11, check
|
||||
if check.numpy.num != check.pybind11.num:
|
||||
print(
|
||||
"NOTE: typenum mismatch for {}: {} != {}".format(
|
||||
check, check.numpy.num, check.pybind11.num
|
||||
)
|
||||
f"NOTE: typenum mismatch for {check}: {check.numpy.num} != {check.pybind11.num}"
|
||||
)
|
||||
|
||||
|
||||
@@ -117,9 +114,7 @@ def test_at_fail(arr, dim):
|
||||
for func in m.at_t, m.mutate_at_t:
|
||||
with pytest.raises(IndexError) as excinfo:
|
||||
func(arr, *([0] * dim))
|
||||
assert str(excinfo.value) == "index dimension mismatch: {} (ndim = 2)".format(
|
||||
dim
|
||||
)
|
||||
assert str(excinfo.value) == f"index dimension mismatch: {dim} (ndim = 2)"
|
||||
|
||||
|
||||
def test_at(arr):
|
||||
@@ -193,8 +188,6 @@ def test_make_empty_shaped_array():
|
||||
|
||||
def test_wrap():
|
||||
def assert_references(a, b, base=None):
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
if base is None:
|
||||
base = a
|
||||
assert a is not b
|
||||
@@ -205,7 +198,8 @@ def test_wrap():
|
||||
assert a.flags.f_contiguous == b.flags.f_contiguous
|
||||
assert a.flags.writeable == b.flags.writeable
|
||||
assert a.flags.aligned == b.flags.aligned
|
||||
if LooseVersion(np.__version__) >= LooseVersion("1.14.0"):
|
||||
# 1.13 supported Python 3.6
|
||||
if tuple(int(x) for x in np.__version__.split(".")[:2]) >= (1, 14):
|
||||
assert a.flags.writebackifcopy == b.flags.writebackifcopy
|
||||
else:
|
||||
assert a.flags.updateifcopy == b.flags.updateifcopy
|
||||
@@ -591,3 +585,9 @@ def test_dtype_refcount_leak():
|
||||
m.ndim(a)
|
||||
after = getrefcount(dtype)
|
||||
assert after == before
|
||||
|
||||
|
||||
def test_round_trip_float():
|
||||
arr = np.zeros((), np.float64)
|
||||
arr[()] = 37.2
|
||||
assert m.round_trip_float(arr) == 37.2
|
||||
|
||||
Reference in New Issue
Block a user