Skip to content

Commit 49f7d99

Browse files
committed
Add isort to the static env
Keep imports sorted.
1 parent b033514 commit 49f7d99

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎pyproject.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,7 @@ mypy = "pytest_mypy"
4040
[project.urls]
4141
homepage = "https://github.com/realpython/pytest-mypy"
4242

43+
[tool.isort]
44+
profile = "black"
45+
4346
[tool.setuptools_scm]

‎src/pytest_mypy/__init__.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
from __future__ import annotations
44

5+
import json
6+
import typing
57
from collections.abc import Iterator
68
from dataclasses import dataclass
7-
import json
89
from pathlib import Path
910
from tempfile import NamedTemporaryFile
10-
import typing
1111

12-
from filelock import FileLock
1312
import mypy.api
1413
import pytest
14+
from filelock import FileLock
1515

1616
if typing.TYPE_CHECKING: # pragma: no cover
1717

‎tests/test_pytest_mypy.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import textwrap
44

55
import mypy.version
6-
from packaging.version import Version
76
import pytest
7+
from packaging.version import Version
88

99
import pytest_mypy
1010

‎tox.ini‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,12 @@ deps =
6767
bandit ~= 1.9.0
6868
black ~= 26.5.0
6969
flake8 ~= 7.3.0
70+
isort ~= 9.0.0
7071
mypy ~= 2.1.0
7172
pytest-xdist >= 3.6.0 # needed for type-checking
7273
commands =
7374
black --check --target-version py310 src tests
75+
isort --check src tests
7476
flake8 src tests
7577
mypy --strict src
7678
bandit --recursive src

0 commit comments

Comments
 (0)