ext: Update pybind11 to v2.8.1

Change-Id: Ia1c7081377f53fd470addf35526f8b28a949a7b0
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52523
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
This commit is contained in:
Jason Lowe-Power
2021-11-06 13:16:21 -07:00
committed by Jason Lowe-Power
parent ba5f68db3d
commit 1e8aeee698
161 changed files with 7820 additions and 3191 deletions

View File

@@ -25,6 +25,7 @@ main_headers = {
"include/pybind11/embed.h",
"include/pybind11/eval.h",
"include/pybind11/functional.h",
"include/pybind11/gil.h",
"include/pybind11/iostream.h",
"include/pybind11/numpy.h",
"include/pybind11/operators.h",
@@ -41,9 +42,14 @@ detail_headers = {
"include/pybind11/detail/descr.h",
"include/pybind11/detail/init.h",
"include/pybind11/detail/internals.h",
"include/pybind11/detail/type_caster_base.h",
"include/pybind11/detail/typeid.h",
}
stl_headers = {
"include/pybind11/stl/filesystem.h",
}
cmake_files = {
"share/cmake/pybind11/FindPythonLibsNew.cmake",
"share/cmake/pybind11/pybind11Common.cmake",
@@ -65,7 +71,7 @@ py_files = {
"setup_helpers.pyi",
}
headers = main_headers | detail_headers
headers = main_headers | detail_headers | stl_headers
src_files = headers | cmake_files
all_files = src_files | py_files
@@ -75,6 +81,7 @@ sdist_files = {
"pybind11/include",
"pybind11/include/pybind11",
"pybind11/include/pybind11/detail",
"pybind11/include/pybind11/stl",
"pybind11/share",
"pybind11/share/cmake",
"pybind11/share/cmake/pybind11",
@@ -119,7 +126,7 @@ def test_build_sdist(monkeypatch, tmpdir):
with tarfile.open(str(sdist)) as tar:
start = tar.getnames()[0] + "/"
version = start[9:-1]
simpler = set(n.split("/", 1)[-1] for n in tar.getnames()[1:])
simpler = {n.split("/", 1)[-1] for n in tar.getnames()[1:]}
with contextlib.closing(
tar.extractfile(tar.getmember(start + "setup.py"))
@@ -131,9 +138,19 @@ def test_build_sdist(monkeypatch, tmpdir):
) as f:
pyproject_toml = f.read()
files = set("pybind11/{}".format(n) for n in all_files)
with contextlib.closing(
tar.extractfile(
tar.getmember(
start + "pybind11/share/cmake/pybind11/pybind11Config.cmake"
)
)
) as f:
contents = f.read().decode("utf8")
assert 'set(pybind11_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include")' in contents
files = {"pybind11/{}".format(n) for n in all_files}
files |= sdist_files
files |= set("pybind11{}".format(n) for n in local_sdist_files)
files |= {"pybind11{}".format(n) for n in local_sdist_files}
files.add("pybind11.egg-info/entry_points.txt")
files.add("pybind11.egg-info/requires.txt")
assert simpler == files
@@ -144,11 +161,11 @@ def test_build_sdist(monkeypatch, tmpdir):
.substitute(version=version, extra_cmd="")
.encode()
)
assert setup_py == contents
assert setup_py == contents
with open(os.path.join(MAIN_DIR, "tools", "pyproject.toml"), "rb") as f:
contents = f.read()
assert pyproject_toml == contents
assert pyproject_toml == contents
def test_build_global_dist(monkeypatch, tmpdir):
@@ -174,7 +191,7 @@ def test_build_global_dist(monkeypatch, tmpdir):
with tarfile.open(str(sdist)) as tar:
start = tar.getnames()[0] + "/"
version = start[16:-1]
simpler = set(n.split("/", 1)[-1] for n in tar.getnames()[1:])
simpler = {n.split("/", 1)[-1] for n in tar.getnames()[1:]}
with contextlib.closing(
tar.extractfile(tar.getmember(start + "setup.py"))
@@ -186,9 +203,9 @@ def test_build_global_dist(monkeypatch, tmpdir):
) as f:
pyproject_toml = f.read()
files = set("pybind11/{}".format(n) for n in all_files)
files = {"pybind11/{}".format(n) for n in all_files}
files |= sdist_files
files |= set("pybind11_global{}".format(n) for n in local_sdist_files)
files |= {"pybind11_global{}".format(n) for n in local_sdist_files}
assert simpler == files
with open(os.path.join(MAIN_DIR, "tools", "setup_global.py.in"), "rb") as f:
@@ -213,7 +230,7 @@ def tests_build_wheel(monkeypatch, tmpdir):
(wheel,) = tmpdir.visit("*.whl")
files = set("pybind11/{}".format(n) for n in all_files)
files = {"pybind11/{}".format(n) for n in all_files}
files |= {
"dist-info/LICENSE",
"dist-info/METADATA",
@@ -226,10 +243,10 @@ def tests_build_wheel(monkeypatch, tmpdir):
with zipfile.ZipFile(str(wheel)) as z:
names = z.namelist()
trimmed = set(n for n in names if "dist-info" not in n)
trimmed |= set(
trimmed = {n for n in names if "dist-info" not in n}
trimmed |= {
"dist-info/{}".format(n.split("/", 1)[-1]) for n in names if "dist-info" in n
)
}
assert files == trimmed
@@ -243,8 +260,8 @@ def tests_build_global_wheel(monkeypatch, tmpdir):
(wheel,) = tmpdir.visit("*.whl")
files = set("data/data/{}".format(n) for n in src_files)
files |= set("data/headers/{}".format(n[8:]) for n in headers)
files = {"data/data/{}".format(n) for n in src_files}
files |= {"data/headers/{}".format(n[8:]) for n in headers}
files |= {
"dist-info/LICENSE",
"dist-info/METADATA",
@@ -257,6 +274,6 @@ def tests_build_global_wheel(monkeypatch, tmpdir):
names = z.namelist()
beginning = names[0].split("/", 1)[0].rsplit(".", 1)[0]
trimmed = set(n[len(beginning) + 1 :] for n in names)
trimmed = {n[len(beginning) + 1 :] for n in names}
assert files == trimmed