Skip to content

Commit 58f8164

Browse files
arturdryomovhashhar
authored andcommitted
Replace "isort" with "reorder-python-imports"
1 parent bd511a4 commit 58f8164

31 files changed

+254
-152
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ repos:
1111
- id: "mypy"
1212
name: "Python: types"
1313

14-
- repo: "https://github.com/PyCQA/isort"
15-
rev: "5.13.2"
14+
- repo: "https://github.com/asottile/reorder-python-imports"
15+
rev: "v3.14.0"
1616
hooks:
17-
- id: "isort"
17+
- id: "reorder-python-imports"
1818
name: "Python: imports"
19-
args: ["--profile", "black"]
19+
args: ["--py39-plus"]
2020

2121
- repo: "https://github.com/pre-commit/pre-commit-hooks"
2222
rev: "v5.0.0"

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env python
2-
32
# Licensed under the Apache License, Version 2.0 (the "License");
43
# you may not use this file except in compliance with the License.
54
# You may obtain a copy of the License at
@@ -11,12 +10,13 @@
1110
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1211
# See the License for the specific language governing permissions and
1312
# limitations under the License.
14-
1513
import os
1614
from codecs import open
17-
from typing import Any, Dict
15+
from typing import Any
16+
from typing import Dict
1817

19-
from setuptools import find_packages, setup
18+
from setuptools import find_packages
19+
from setuptools import setup
2020

2121
about: Dict[str, Any] = {}
2222
here = os.path.abspath(os.path.dirname(__file__))

tests/integration/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
12-
1312
import os
1413
import socket
1514
import subprocess
@@ -20,7 +19,9 @@
2019
import pytest
2120

2221
import trino.logging
23-
from trino.client import ClientSession, TrinoQuery, TrinoRequest
22+
from trino.client import ClientSession
23+
from trino.client import TrinoQuery
24+
from trino.client import TrinoRequest
2425
from trino.constants import DEFAULT_PORT
2526

2627
logger = trino.logging.get_logger(__name__)

tests/integration/test_dbapi_integration.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
import math
1313
import time as t
1414
import uuid
15-
from datetime import date, datetime, time, timedelta, timezone
15+
from datetime import date
16+
from datetime import datetime
17+
from datetime import time
18+
from datetime import timedelta
19+
from datetime import timezone
1620
from decimal import Decimal
1721
from typing import Tuple
1822
from zoneinfo import ZoneInfo
@@ -24,8 +28,12 @@
2428
import trino
2529
from tests.integration.conftest import trino_version
2630
from trino import constants
27-
from trino.dbapi import Cursor, DescribeOutput, TimeBoundLRUCache
28-
from trino.exceptions import NotSupportedError, TrinoQueryError, TrinoUserError
31+
from trino.dbapi import Cursor
32+
from trino.dbapi import DescribeOutput
33+
from trino.dbapi import TimeBoundLRUCache
34+
from trino.exceptions import NotSupportedError
35+
from trino.exceptions import TrinoQueryError
36+
from trino.exceptions import TrinoUserError
2937
from trino.transaction import IsolationLevel
3038

3139

tests/integration/test_sqlalchemy_integration.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@
1515

1616
import pytest
1717
import sqlalchemy as sqla
18-
from sqlalchemy.sql import and_, not_, or_
18+
from sqlalchemy.sql import and_
19+
from sqlalchemy.sql import not_
20+
from sqlalchemy.sql import or_
1921
from sqlalchemy.types import ARRAY
2022

2123
from tests.integration.conftest import trino_version
2224
from tests.unit.conftest import sqlalchemy_version
23-
from trino.sqlalchemy.datatype import JSON, MAP, ROW
25+
from trino.sqlalchemy.datatype import JSON
26+
from trino.sqlalchemy.datatype import MAP
27+
from trino.sqlalchemy.datatype import ROW
2428

2529

2630
@pytest.fixture

tests/integration/test_types_integration.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import math
22
import re
33
import uuid
4-
from datetime import date, datetime, time, timedelta, timezone, tzinfo
4+
from datetime import date
5+
from datetime import datetime
6+
from datetime import time
7+
from datetime import timedelta
8+
from datetime import timezone
9+
from datetime import tzinfo
510
from decimal import Decimal
611
from zoneinfo import ZoneInfo
712

tests/unit/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
12-
13-
from unittest.mock import MagicMock, patch
12+
from unittest.mock import MagicMock
13+
from unittest.mock import patch
1414

1515
import pytest
1616

tests/unit/oauth_test_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
12-
1312
import json
1413
import re
1514
import uuid

tests/unit/sqlalchemy/conftest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
import pytest
1313
from sqlalchemy.sql.sqltypes import ARRAY
1414

15-
from trino.sqlalchemy.datatype import MAP, ROW, TIME, TIMESTAMP, SQLType
15+
from trino.sqlalchemy.datatype import MAP
16+
from trino.sqlalchemy.datatype import ROW
17+
from trino.sqlalchemy.datatype import SQLType
18+
from trino.sqlalchemy.datatype import TIME
19+
from trino.sqlalchemy.datatype import TIMESTAMP
1620

1721

1822
@pytest.fixture(scope="session")

tests/unit/sqlalchemy/test_compiler.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
1212
import pytest
13-
from sqlalchemy import Column, Integer, MetaData, String, Table, func, insert, select
13+
from sqlalchemy import Column
14+
from sqlalchemy import func
15+
from sqlalchemy import insert
16+
from sqlalchemy import Integer
17+
from sqlalchemy import MetaData
18+
from sqlalchemy import select
19+
from sqlalchemy import String
20+
from sqlalchemy import Table
1421
from sqlalchemy.schema import CreateTable
15-
from sqlalchemy.sql import column, table
22+
from sqlalchemy.sql import column
23+
from sqlalchemy.sql import table
1624

1725
from tests.unit.conftest import sqlalchemy_version
1826
from trino.sqlalchemy.dialect import TrinoDialect

0 commit comments

Comments
 (0)