Skip to content

Commit 664876e

Browse files
committed
Merge branch 'master' into sh_merge_master
2 parents 84017e8 + d2e7e8c commit 664876e

File tree

8 files changed

+31
-28
lines changed

8 files changed

+31
-28
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ jobs:
11531153
uses: jwlawson/[email protected]
11541154

11551155
- name: Install ninja-build tool
1156-
uses: seanmiddleditch/gha-setup-ninja@v5
1156+
uses: seanmiddleditch/gha-setup-ninja@v6
11571157

11581158
- name: Run pip installs
11591159
run: |

.pre-commit-config.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ repos:
2525

2626
# Clang format the codebase automatically
2727
- repo: https://github.com/pre-commit/mirrors-clang-format
28-
rev: "v19.1.6"
28+
rev: "v19.1.7"
2929
hooks:
3030
- id: clang-format
3131
types_or: [c++, c, cuda]
3232

3333
# Ruff, the Python auto-correcting linter/formatter written in Rust
3434
- repo: https://github.com/astral-sh/ruff-pre-commit
35-
rev: v0.8.6
35+
rev: v0.9.4
3636
hooks:
3737
- id: ruff
3838
args: ["--fix", "--show-fixes"]
@@ -121,7 +121,7 @@ repos:
121121
# Use tools/codespell_ignore_lines_from_errors.py
122122
# to rebuild .codespell-ignore-lines
123123
- repo: https://github.com/codespell-project/codespell
124-
rev: "v2.3.0"
124+
rev: "v2.4.1"
125125
hooks:
126126
- id: codespell
127127
exclude: ".supp$"
@@ -144,14 +144,14 @@ repos:
144144

145145
# PyLint has native support - not always usable, but works for us
146146
- repo: https://github.com/PyCQA/pylint
147-
rev: "v3.3.3"
147+
rev: "v3.3.4"
148148
hooks:
149149
- id: pylint
150150
files: ^pybind11
151151

152152
# Check schemas on some of our YAML files
153153
- repo: https://github.com/python-jsonschema/check-jsonschema
154-
rev: 0.30.0
154+
rev: 0.31.1
155155
hooks:
156156
- id: check-readthedocs
157157
- id: check-github-workflows

include/pybind11/detail/class.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,9 @@ extern "C" inline int pybind11_clear(PyObject *self) {
576576
inline void enable_dynamic_attributes(PyHeapTypeObject *heap_type) {
577577
auto *type = &heap_type->ht_type;
578578
type->tp_flags |= Py_TPFLAGS_HAVE_GC;
579-
#if PY_VERSION_HEX < 0x030B0000
580-
type->tp_dictoffset = type->tp_basicsize; // place dict at the end
581-
type->tp_basicsize += (ssize_t) sizeof(PyObject *); // and allocate enough space for it
579+
#if PY_VERSION_HEX < 0x030B0000 || defined(PYPY_VERSION) // For PyPy see PR #5508
580+
type->tp_dictoffset = type->tp_basicsize; // place dict at the end
581+
type->tp_basicsize += (ssize_t) sizeof(PyObject *); // and allocate enough space for it
582582
#else
583583
type->tp_flags |= Py_TPFLAGS_MANAGED_DICT;
584584
#endif

tests/conftest.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ def pytest_configure():
212212

213213
def pytest_report_header(config):
214214
del config # Unused.
215-
assert (
216-
pybind11_tests.compiler_info is not None
217-
), "Please update pybind11_tests.cpp if this assert fails."
215+
assert pybind11_tests.compiler_info is not None, (
216+
"Please update pybind11_tests.cpp if this assert fails."
217+
)
218218
return (
219219
"C++ Info:"
220220
f" {pybind11_tests.compiler_info}"

tests/test_eigen_matrix.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ def test_eigen_ref_to_python():
244244
chols = [m.cholesky1, m.cholesky2, m.cholesky3, m.cholesky4]
245245
for i, chol in enumerate(chols, start=1):
246246
mymat = chol(np.array([[1.0, 2, 4], [2, 13, 23], [4, 23, 77]]))
247-
assert np.all(
248-
mymat == np.array([[1, 0, 0], [2, 3, 0], [4, 5, 6]])
249-
), f"cholesky{i}"
247+
assert np.all(mymat == np.array([[1, 0, 0], [2, 3, 0], [4, 5, 6]])), (
248+
f"cholesky{i}"
249+
)
250250

251251

252252
def assign_both(a1, a2, r, c, v):

tests/test_gil_scoped.py

+4
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ def test_nested_acquire():
108108

109109

110110
@pytest.mark.skipif(sys.platform.startswith("emscripten"), reason="Requires threads")
111+
@pytest.mark.skipif(
112+
env.GRAALPY and sys.platform == "darwin",
113+
reason="Transiently crashes on GraalPy on OS X",
114+
)
111115
def test_multi_acquire_release_cross_module():
112116
for bits in range(16 * 8):
113117
internals_ids = m.test_multi_acquire_release_cross_module(bits)

tests/test_pytypes.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ def test_from_iterable(pytype, from_iter_func):
5252

5353
def test_iterable(doc):
5454
assert doc(m.get_iterable) == "get_iterable() -> Iterable"
55-
lins = [1, 2, 3]
56-
i = m.get_first_item_from_iterable(lins)
55+
lst = [1, 2, 3]
56+
i = m.get_first_item_from_iterable(lst)
5757
assert i == 1
58-
i = m.get_second_item_from_iterable(lins)
58+
i = m.get_second_item_from_iterable(lst)
5959
assert i == 2
6060

6161

@@ -67,13 +67,13 @@ def test_list(capture, doc):
6767
assert m.list_no_args() == []
6868
assert m.list_ssize_t() == []
6969
assert m.list_size_t() == []
70-
lins = [1, 2]
71-
m.list_insert_ssize_t(lins)
72-
assert lins == [1, 83, 2]
73-
m.list_insert_size_t(lins)
74-
assert lins == [1, 83, 2, 57]
75-
m.list_clear(lins)
76-
assert lins == []
70+
lst = [1, 2]
71+
m.list_insert_ssize_t(lst)
72+
assert lst == [1, 83, 2]
73+
m.list_insert_size_t(lst)
74+
assert lst == [1, 83, 2, 57]
75+
m.list_clear(lst)
76+
assert lst == []
7777

7878
with capture:
7979
lst = m.get_list()

tests/test_smart_ptr.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,8 @@ def test_smart_ptr_from_default():
313313
instance = m.HeldByDefaultHolder()
314314
with pytest.raises(RuntimeError) as excinfo:
315315
m.HeldByDefaultHolder.load_shared_ptr(instance)
316-
assert (
317-
"Unable to load a custom holder type from a "
318-
"default-holder instance" in str(excinfo.value)
316+
assert "Unable to load a custom holder type from a default-holder instance" in str(
317+
excinfo.value
319318
)
320319

321320

0 commit comments

Comments
 (0)