Skip to content

Commit f3b7c44

Browse files
authored
Move from isort to reorder-python-imports (#500)
It’s [way faster](https://twitter.com/codewithanthony/status/1553034384206438401) and its one-import-per-line style prevents merge conflicts.
1 parent 35278b3 commit f3b7c44

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

.pre-commit-config.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,16 @@ repos:
2828
- id: blacken-docs
2929
additional_dependencies:
3030
- black==22.10.0
31-
- repo: https://github.com/pycqa/isort
32-
rev: 5.10.1
31+
- repo: https://github.com/asottile/reorder_python_imports
32+
rev: v3.9.0
3333
hooks:
34-
- id: isort
34+
- id: reorder-python-imports
35+
args:
36+
- --py37-plus
37+
- --application-directories
38+
- .:example:src
39+
- --add-import
40+
- 'from __future__ import annotations'
3541
- repo: https://github.com/PyCQA/flake8
3642
rev: 5.0.4
3743
hooks:

pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ build-backend = "setuptools.build_meta"
55
[tool.black]
66
target-version = ['py37']
77

8-
[tool.isort]
9-
profile = "black"
10-
add_imports = "from __future__ import annotations"
11-
128
[tool.mypy]
139
mypy_path = "src/"
1410
show_error_codes = true

src/pytest_randomly/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
import sys
77
from itertools import groupby
88
from types import ModuleType
9-
from typing import Any, Callable, TypeVar
9+
from typing import Any
10+
from typing import Callable
11+
from typing import TypeVar
1012

1113
from _pytest.config import Config
1214
from _pytest.config.argparsing import Parser
1315
from _pytest.nodes import Item
14-
from pytest import Collector, fixture, hookimpl
16+
from pytest import Collector
17+
from pytest import fixture
18+
from pytest import hookimpl
1519

1620
from pytest_randomly.compat import md5
1721

0 commit comments

Comments
 (0)