Skip to content

Commit 2282385

Browse files
autoupdate pre-commit hooks (#59)
* autoupdate pre-commit hooks updates: - [github.com/google/yamlfmt: v0.16.0 → v0.17.2](google/yamlfmt@v0.16.0...v0.17.2) - [github.com/macisamuele/language-formatters-pre-commit-hooks: v2.14.0 → v2.15.0](macisamuele/language-formatters-pre-commit-hooks@v2.14.0...v2.15.0) - [github.com/pre-commit/mirrors-mypy: v1.15.0 → v1.16.1](pre-commit/mirrors-mypy@v1.15.0...v1.16.1) - [github.com/pycqa/pylint: v3.3.6 → v3.3.7](pylint-dev/pylint@v3.3.6...v3.3.7) - [github.com/astral-sh/ruff-pre-commit: v0.11.4 → v0.12.2](astral-sh/ruff-pre-commit@v0.11.4...v0.12.2) - [github.com/PyCQA/doc8: v1.1.2 → v2.0.0](PyCQA/doc8@v1.1.2...v2.0.0) --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Kevin Meagher <[email protected]>
1 parent f153e10 commit 2282385

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ ci:
66
autoupdate_schedule: quarterly
77
repos:
88
- repo: https://github.com/google/yamlfmt
9-
rev: v0.16.0
9+
rev: v0.17.2
1010
hooks:
1111
- id: yamlfmt
1212
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
13-
rev: v2.14.0
13+
rev: v2.15.0
1414
hooks:
1515
- id: pretty-format-toml
1616
args: [--autofix]
@@ -28,27 +28,27 @@ repos:
2828
- id: blacken-docs
2929
args: [-l 100]
3030
- repo: https://github.com/pre-commit/mirrors-mypy
31-
rev: v1.15.0
31+
rev: v1.16.1
3232
hooks:
3333
- id: mypy
3434
files: simweights
3535
additional_dependencies: [numpy]
3636
exclude: ^contrib/
3737
- repo: https://github.com/pycqa/pylint
38-
rev: v3.3.6
38+
rev: v3.3.7
3939
hooks:
4040
- id: pylint
4141
files: simweights
4242
exclude: ^contrib/
4343
additional_dependencies: [numpy, pandas]
4444
- repo: https://github.com/astral-sh/ruff-pre-commit
45-
rev: v0.11.4
45+
rev: v0.12.2
4646
hooks:
4747
- id: ruff
4848
args: [--fix, --show-fixes]
4949
- id: ruff-format
5050
- repo: https://github.com/PyCQA/doc8
51-
rev: "v1.1.2"
51+
rev: "v2.0.0"
5252
hooks:
5353
- id: doc8
5454
- repo: https://github.com/pre-commit/pygrep-hooks

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ ignore = [
100100
"COM812", # conflicts with ruff formatter
101101
"ISC001", # conflicts with ruff formatter
102102
"PLR0913", # Too many arguments in function definition
103-
"PLR0911" # Too many return statement
103+
"PLR0911", # Too many return statement
104+
"PLW1641" # object does not implement `__hash__` method
104105
]
105106
select = ["ALL"]
106107

tests/test_weighter.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
#
55
# SPDX-License-Identifier: BSD-2-Clause
66

7+
import contextlib
78
import unittest
89
from copy import copy
910

1011
import numpy as np
1112

1213
from simweights import TIG1996, NaturalRateCylinder, PowerLaw, Weighter, generation_surface
1314

15+
with contextlib.suppress(ImportError):
16+
import nuflux
17+
1418

1519
def fluxfun1(energy):
1620
return energy**2
@@ -299,12 +303,8 @@ def test_weighter_addition(self):
299303
with self.assertRaises(TypeError):
300304
self.weighter1 + object()
301305

306+
@unittest.skipIf("nuflux" not in globals(), "Nuflux not available")
302307
def test_nuflux(self):
303-
try:
304-
import nuflux
305-
except ImportError:
306-
self.skipTest("nuflux not found")
307-
308308
N1 = 15
309309
data1 = {
310310
"I3Weight": {

0 commit comments

Comments
 (0)