Skip to content

Commit d0b9b28

Browse files
authored
Merge pull request #62 from csdms/mcflugen/update-linters
Update the linters
2 parents 0485a6d + 4d379b5 commit d0b9b28

File tree

10 files changed

+29
-21
lines changed

10 files changed

+29
-21
lines changed

.pre-commit-config.yaml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 23.12.1
3+
rev: 24.10.0
44
hooks:
55
- id: black
66
name: black
@@ -23,7 +23,7 @@ repos:
2323
additional_dependencies: [".[jupyter]"]
2424

2525
- repo: https://github.com/pycqa/flake8
26-
rev: 7.0.0
26+
rev: 7.1.1
2727
hooks:
2828
- id: flake8
2929
additional_dependencies:
@@ -42,19 +42,21 @@ repos:
4242
language: python
4343

4444
- repo: https://github.com/asottile/pyupgrade
45-
rev: v3.15.0
45+
rev: v3.19.1
4646
hooks:
4747
- id: pyupgrade
4848
args: [--py310-plus]
4949

50-
- repo: https://github.com/asottile/reorder-python-imports
51-
rev: v3.12.0
50+
- repo: https://github.com/PyCQA/isort
51+
rev: 5.13.2
5252
hooks:
53-
- id: reorder-python-imports
54-
args: [--py310-plus, --add-import, "from __future__ import annotations"]
53+
- id: isort
54+
name: isort (python)
55+
args: [--add-import, "from __future__ import annotations"]
56+
types: [python]
5557

5658
- repo: https://github.com/pre-commit/pre-commit-hooks
57-
rev: v4.5.0
59+
rev: v5.0.0
5860
hooks:
5961
- id: check-builtin-literals
6062
- id: check-added-large-files
@@ -86,9 +88,8 @@ repos:
8688
additional_dependencies: [".[toml]"]
8789

8890
- repo: https://github.com/pre-commit/mirrors-mypy
89-
rev: v1.8.0
91+
rev: v1.14.1
9092
hooks:
9193
- id: mypy
9294
language_version: python3.12
93-
additional_dependencies: [types-all]
9495
files: src/.*\.py$

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ where = [
6565
[tool.coverage.run]
6666
relative_files = true
6767

68+
[tool.isort]
69+
known_first_party = "bmipy"
70+
profile = "black"
71+
force_single_line = true
72+
6873
[tool.mypy]
6974
check_untyped_defs = true
7075
disallow_any_generics = true

setup.cfg

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
[flake8]
2-
exclude = docs, build, .nox
3-
ignore = C901, E203, E266, E501, W503, B905
2+
exclude = build, .nox
43
max-line-length = 88
5-
max-complexity = 18
6-
select = B,C,E,F,W,T4,B9
4+
max-complexity = 10

src/bmipy/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The Basic Model Interface (BMI) for Python."""
2+
23
from __future__ import annotations
34

45
from bmipy._version import __version__

src/bmipy/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The bmipy-render command."""
2+
23
from __future__ import annotations
34

45
from bmipy._cmd import main

src/bmipy/_cmd.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Command line interface that create template BMI implementations."""
2+
23
from __future__ import annotations
34

45
import argparse

src/bmipy/_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import os
55
import re
66
import textwrap
7-
from collections import defaultdict
87
from collections import OrderedDict
8+
from collections import defaultdict
99

1010
from bmipy.bmi import Bmi
1111

src/bmipy/bmi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This language specification is derived from the Scientific Interface
44
Definition Language (SIDL) file `bmi.sidl <https://github.com/csdms/bmi>`_.
55
"""
6+
67
from __future__ import annotations
78

89
from abc import ABC

tests/cli_test.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
from __future__ import annotations
22

3+
import contextlib
4+
35
import pytest
6+
47
from bmipy._cmd import main
58

69

710
def test_cli_version(capsys):
8-
try:
11+
with contextlib.suppress(SystemExit):
912
assert main(["--version"]) == 0
10-
except SystemExit:
11-
pass
1213
output = capsys.readouterr().out
1314

1415
assert "bmipy" in output
1516

1617

1718
def test_cli_help(capsys):
18-
try:
19+
with contextlib.suppress(SystemExit):
1920
assert main(["--help"]) == 0
20-
except SystemExit:
21-
pass
2221
output = capsys.readouterr().out
2322

2423
assert "help" in output

tests/template_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import pytest
4+
45
from bmipy._template import dedent_docstring
56
from bmipy._template import render_function_signature
67

0 commit comments

Comments
 (0)