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 abec390 commit 4b87a37
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 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 @@ -39,6 +39,13 @@ urls = {Changelog = "https://github.com/adamchainz/ec2-metadata/blob/main/CHANGE
[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
4 changes: 2 additions & 2 deletions tests/test_ec2_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import requests
from requests_mock import Mocker as RequestsMocker

from ec2_metadata import ec2_metadata
from ec2_metadata import TOKEN_TTL_SECONDS
from ec2_metadata import EC2Metadata
from ec2_metadata import InstanceIdentityDocumentDict
from ec2_metadata import NetworkInterface
from ec2_metadata import TOKEN_TTL_SECONDS
from ec2_metadata import ec2_metadata


@pytest.fixture(autouse=True)
Expand Down

0 comments on commit 4b87a37

Please sign in to comment.