Skip to content

Commit

Permalink
Use isort to sort imports
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz committed Feb 11, 2024
1 parent 21036d1 commit 5f35ec3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
13 changes: 4 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,11 @@ repos:
- id: blacken-docs
additional_dependencies:
- black==23.1.0
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.12.0
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: reorder-python-imports
args:
- --py38-plus
- --application-directories
- .:example:src
- --add-import
- 'from __future__ import annotations'
- id: isort
name: isort (python)
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ time_machine = "time_machine"
[tool.black]
target-version = ['py38']

[tool.isort]
add_imports = [
"from __future__ import annotations"
]
force_single_line = true
profile = "black"

[tool.pytest.ini_options]
addopts = """\
--strict-config
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from setuptools import Extension
from setuptools import setup


if hasattr(sys, "pypy_version_info"):
raise RuntimeError(
"PyPy is not currently supported by time-machine, see "
Expand Down
6 changes: 3 additions & 3 deletions src/time_machine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
from typing import Any
from typing import Awaitable
from typing import Callable
from typing import cast
from typing import Generator as TypingGenerator
from typing import overload
from typing import Tuple
from typing import Type
from typing import TypeVar
from typing import Union
from unittest import mock
from typing import cast
from typing import overload
from unittest import TestCase
from unittest import mock

import _time_machine
from dateutil.parser import parse as parse_datetime
Expand Down
2 changes: 1 addition & 1 deletion tests/test_time_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from contextlib import contextmanager
from importlib.util import module_from_spec
from importlib.util import spec_from_file_location
from unittest import mock
from unittest import SkipTest
from unittest import TestCase
from unittest import mock

import pytest
from dateutil import tz
Expand Down

0 comments on commit 5f35ec3

Please sign in to comment.