Skip to content

Commit 11e3aba

Browse files
authored
Merge pull request #786 from davidhassell/main
Update linting package versions for Python 3.12
2 parents e233717 + 23a389f commit 11e3aba

File tree

5 files changed

+21
-23
lines changed

5 files changed

+21
-23
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repos:
1010
# Use specific format-enforcing pre-commit hooks from the core library
1111
# with the default configuration (see pre-commit.com for documentation)
1212
- repo: https://github.com/pre-commit/pre-commit-hooks
13-
rev: v4.4.0
13+
rev: v4.6.0
1414
hooks:
1515
- id: check-ast
1616
- id: debug-statements
@@ -23,7 +23,7 @@ repos:
2323
# (see https://black.readthedocs.io/en/stable/ for documentation and see
2424
# the cf-python pyproject.toml file for our custom black configuration)
2525
- repo: https://github.com/ambv/black
26-
rev: 23.1.0
26+
rev: 24.4.2
2727
hooks:
2828
- id: black
2929
language_version: python3
@@ -53,7 +53,7 @@ repos:
5353
# (see https://flake8.pycqa.org/en/latest/ for documentation and see
5454
# the cf-python .flake8 file for our custom flake8 configuration)
5555
- repo: https://github.com/PyCQA/flake8
56-
rev: 6.0.0
56+
rev: 7.1.0
5757
hooks:
5858
- id: flake8
5959

@@ -62,7 +62,7 @@ repos:
6262
# compatible with 'black' with the lines set to ensure so in the repo's
6363
# pyproject.toml. Other than that and the below, no extra config is required.
6464
- repo: https://github.com/pycqa/isort
65-
rev: 5.12.0
65+
rev: 5.13.2
6666
hooks:
6767
- id: isort
6868
name: isort (python)

cf/field.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10479,9 +10479,9 @@ def convolution_filter(
1047910479
new_bounds[0 : length - lower_offset, 1:] = old_bounds[
1048010480
lower_offset:length, 1:
1048110481
]
10482-
new_bounds[
10483-
length - lower_offset : length, 1:
10484-
] = old_bounds[length - 1, 1:]
10482+
new_bounds[length - lower_offset : length, 1:] = (
10483+
old_bounds[length - 1, 1:]
10484+
)
1048510485

1048610486
coord.set_bounds(self._Bounds(data=new_bounds))
1048710487

cf/test/test_Data.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2389,9 +2389,7 @@ def test_Data_BINARY_AND_UNARY_OPERATORS(self):
23892389
except Exception:
23902390
pass
23912391
else:
2392-
self.assertTrue(
2393-
(x**d).all(), "{}**{}".format(x, repr(d))
2394-
)
2392+
self.assertTrue((x**d).all(), "{}**{}".format(x, repr(d)))
23952393

23962394
self.assertTrue(
23972395
d.__truediv__(x).equals(

cf/test/test_functions.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -389,24 +389,24 @@ def test_normalize_slice(self):
389389
cf.normalize_slice(slice(2, 5, -2), 8, cyclic=True),
390390
slice(2, -3, -2),
391391
)
392-
392+
393393
self.assertEqual(
394394
cf.normalize_slice(slice(-8, 0, 1), 8, cyclic=True),
395-
slice(-8, 0, 1)
396-
)
395+
slice(-8, 0, 1),
396+
)
397397
self.assertEqual(
398398
cf.normalize_slice(slice(0, 7, -1), 8, cyclic=True),
399-
slice(0, -1, -1)
400-
)
399+
slice(0, -1, -1),
400+
)
401401
self.assertEqual(
402402
cf.normalize_slice(slice(-1, -8, 1), 8, cyclic=True),
403-
slice(-1, 0, 1)
404-
)
403+
slice(-1, 0, 1),
404+
)
405405
self.assertEqual(
406406
cf.normalize_slice(slice(-8, -1, -1), 8, cyclic=True),
407-
slice(0, -1, -1)
408-
)
409-
407+
slice(0, -1, -1),
408+
)
409+
410410
with self.assertRaises(IndexError):
411411
cf.normalize_slice([1, 2], 8)
412412

cf/weights.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,9 +1461,9 @@ def linear(
14611461
else:
14621462
# Bounds exist
14631463
if methods:
1464-
weights[
1465-
(da_key,)
1466-
] = f"linear {f.constructs.domain_axis_identity(da_key)}"
1464+
weights[(da_key,)] = (
1465+
f"linear {f.constructs.domain_axis_identity(da_key)}"
1466+
)
14671467
else:
14681468
weights[(da_key,)] = dim.cellsize
14691469

0 commit comments

Comments
 (0)