Skip to content

Commit a2951ab

Browse files
chore(deps): update pre-commit hooks (#5605)
* chore(deps): update pre-commit hooks updates: - [github.com/pre-commit/mirrors-clang-format: v19.1.7 → v20.1.0](pre-commit/mirrors-clang-format@v19.1.7...v20.1.0) - [github.com/astral-sh/ruff-pre-commit: v0.9.9 → v0.11.4](astral-sh/ruff-pre-commit@v0.9.9...v0.11.4) - [github.com/PyCQA/pylint: v3.3.4 → v3.3.6](pylint-dev/pylint@v3.3.4...v3.3.6) - [github.com/python-jsonschema/check-jsonschema: 0.31.2 → 0.32.1](python-jsonschema/check-jsonschema@0.31.2...0.32.1) * style: pre-commit fixes * Update setup.py * Update tests/test_enum.py * Update configure.yml --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
1 parent d25e91f commit a2951ab

File tree

7 files changed

+23
-25
lines changed

7 files changed

+23
-25
lines changed

.github/workflows/configure.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
runs-on: [ubuntu-20.04, macos-13, windows-latest]
27+
runs-on: [ubuntu-22.04, macos-13, windows-latest]
2828
arch: [x64]
2929
cmake: ["3.26"]
3030

3131
include:
32-
- runs-on: ubuntu-20.04
32+
- runs-on: ubuntu-22.04
3333
arch: x64
3434
cmake: "3.15"
3535

36-
- runs-on: ubuntu-20.04
36+
- runs-on: ubuntu-22.04
3737
arch: x64
3838
cmake: "3.29"
3939

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
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.7"
28+
rev: "v20.1.0"
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.9.9
35+
rev: v0.11.4
3636
hooks:
3737
- id: ruff
3838
args: ["--fix", "--show-fixes"]
@@ -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.4"
147+
rev: "v3.3.6"
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.31.2
154+
rev: 0.32.1
155155
hooks:
156156
- id: check-readthedocs
157157
- id: check-github-workflows

include/pybind11/pybind11.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ class cpp_function : public function {
277277
cpp_function(Return (Class::*f)(Arg...), const Extra &...extra) {
278278
initialize(
279279
[f](Class *c, Arg... args) -> Return { return (c->*f)(std::forward<Arg>(args)...); },
280-
(Return(*)(Class *, Arg...)) nullptr,
280+
(Return (*)(Class *, Arg...)) nullptr,
281281
extra...);
282282
}
283283

@@ -289,7 +289,7 @@ class cpp_function : public function {
289289
cpp_function(Return (Class::*f)(Arg...) &, const Extra &...extra) {
290290
initialize(
291291
[f](Class *c, Arg... args) -> Return { return (c->*f)(std::forward<Arg>(args)...); },
292-
(Return(*)(Class *, Arg...)) nullptr,
292+
(Return (*)(Class *, Arg...)) nullptr,
293293
extra...);
294294
}
295295

@@ -299,7 +299,7 @@ class cpp_function : public function {
299299
cpp_function(Return (Class::*f)(Arg...) const, const Extra &...extra) {
300300
initialize([f](const Class *c,
301301
Arg... args) -> Return { return (c->*f)(std::forward<Arg>(args)...); },
302-
(Return(*)(const Class *, Arg...)) nullptr,
302+
(Return (*)(const Class *, Arg...)) nullptr,
303303
extra...);
304304
}
305305

@@ -311,7 +311,7 @@ class cpp_function : public function {
311311
cpp_function(Return (Class::*f)(Arg...) const &, const Extra &...extra) {
312312
initialize([f](const Class *c,
313313
Arg... args) -> Return { return (c->*f)(std::forward<Arg>(args)...); },
314-
(Return(*)(const Class *, Arg...)) nullptr,
314+
(Return (*)(const Class *, Arg...)) nullptr,
315315
extra...);
316316
}
317317

@@ -874,7 +874,7 @@ class cpp_function : public function {
874874
function_call call(func, parent);
875875

876876
// Protect std::min with parentheses
877-
size_t args_to_copy = (std::min)(pos_args, n_args_in);
877+
size_t args_to_copy = (std::min) (pos_args, n_args_in);
878878
size_t args_copied = 0;
879879

880880
// 0. Inject new-style `self` argument

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def build_expected_version_hex(matches: dict[str, str]) -> str:
5151
# PYBIND11_GLOBAL_SDIST will build a different sdist, with the python-headers
5252
# files, and the sys.prefix files (CMake and headers).
5353

54-
global_sdist = os.environ.get("PYBIND11_GLOBAL_SDIST", False)
54+
global_sdist = os.environ.get("PYBIND11_GLOBAL_SDIST")
5555

5656
setup_py = Path(
5757
"tools/setup_global.py.in" if global_sdist else "tools/setup_main.py.in"

tests/test_buffers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,11 @@ TEST_SUBMODULE(buffers, m) {
237237
}
238238

239239
float operator()(py::ssize_t i, py::ssize_t j) const {
240-
return Matrix::operator()(i * m_row_factor, j * m_col_factor);
240+
return Matrix::operator()(i *m_row_factor, j *m_col_factor);
241241
}
242242

243243
float &operator()(py::ssize_t i, py::ssize_t j) {
244-
return Matrix::operator()(i * m_row_factor, j * m_col_factor);
244+
return Matrix::operator()(i *m_row_factor, j *m_col_factor);
245245
}
246246

247247
using Matrix::data;

tests/test_enum.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,13 @@ def test_unscoped_enum():
5959
"EThree": m.UnscopedEnum.EThree,
6060
}
6161

62-
for docstring_line in """An unscoped enumeration
63-
64-
Members:
65-
66-
EOne : Docstring for EOne
67-
68-
ETwo : Docstring for ETwo
69-
70-
EThree : Docstring for EThree""".split("\n"):
62+
for docstring_line in [
63+
"An unscoped enumeration",
64+
"Members:",
65+
" EOne : Docstring for EOne",
66+
" ETwo : Docstring for ETwo",
67+
" EThree : Docstring for EThree",
68+
]:
7169
assert docstring_line in m.UnscopedEnum.__doc__
7270

7371
# Unscoped enums will accept ==/!= int comparisons

tests/test_opaque_types.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ TEST_SUBMODULE(opaque_types, m) {
2828
.def(py::init<>())
2929
.def("pop_back", &StringList::pop_back)
3030
/* There are multiple versions of push_back(), etc. Select the right ones. */
31-
.def("push_back", (void(StringList::*)(const std::string &)) & StringList::push_back)
31+
.def("push_back", (void (StringList::*)(const std::string &)) &StringList::push_back)
3232
.def("back", (std::string & (StringList::*) ()) & StringList::back)
3333
.def("__len__", [](const StringList &v) { return v.size(); })
3434
.def(

0 commit comments

Comments
 (0)