Skip to content

Commit 5f35ec3

Browse files
committed
Use isort to sort imports
1 parent 21036d1 commit 5f35ec3

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,11 @@ repos:
4242
- id: blacken-docs
4343
additional_dependencies:
4444
- black==23.1.0
45-
- repo: https://github.com/asottile/reorder-python-imports
46-
rev: v3.12.0
45+
- repo: https://github.com/pycqa/isort
46+
rev: 5.13.2
4747
hooks:
48-
- id: reorder-python-imports
49-
args:
50-
- --py38-plus
51-
- --application-directories
52-
- .:example:src
53-
- --add-import
54-
- 'from __future__ import annotations'
48+
- id: isort
49+
name: isort (python)
5550
- repo: https://github.com/PyCQA/flake8
5651
rev: 7.0.0
5752
hooks:

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ time_machine = "time_machine"
5050
[tool.black]
5151
target-version = ['py38']
5252

53+
[tool.isort]
54+
add_imports = [
55+
"from __future__ import annotations"
56+
]
57+
force_single_line = true
58+
profile = "black"
59+
5360
[tool.pytest.ini_options]
5461
addopts = """\
5562
--strict-config

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from setuptools import Extension
66
from setuptools import setup
77

8-
98
if hasattr(sys, "pypy_version_info"):
109
raise RuntimeError(
1110
"PyPy is not currently supported by time-machine, see "

src/time_machine/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
from typing import Any
1414
from typing import Awaitable
1515
from typing import Callable
16-
from typing import cast
1716
from typing import Generator as TypingGenerator
18-
from typing import overload
1917
from typing import Tuple
2018
from typing import Type
2119
from typing import TypeVar
2220
from typing import Union
23-
from unittest import mock
21+
from typing import cast
22+
from typing import overload
2423
from unittest import TestCase
24+
from unittest import mock
2525

2626
import _time_machine
2727
from dateutil.parser import parse as parse_datetime

tests/test_time_machine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
from contextlib import contextmanager
1111
from importlib.util import module_from_spec
1212
from importlib.util import spec_from_file_location
13-
from unittest import mock
1413
from unittest import SkipTest
1514
from unittest import TestCase
15+
from unittest import mock
1616

1717
import pytest
1818
from dateutil import tz

0 commit comments

Comments
 (0)