Skip to content

Commit bdef915

Browse files
committed
Use ruff for import sorting as well
1 parent 7333378 commit bdef915

File tree

7 files changed

+27
-14
lines changed

7 files changed

+27
-14
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ repos:
2727
hooks:
2828
- id: ruff
2929

30-
- repo: https://github.com/PyCQA/isort
31-
rev: 5.12.0
32-
hooks:
33-
- id: isort
34-
files: \.py$
35-
3630
- repo: https://github.com/pre-commit/mirrors-mypy
3731
rev: v0.961
3832
hooks:

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,15 @@ select = [
9494
"W",
9595
"G",
9696
"ISC",
97+
"I",
9798
]
9899

99100
[tool.ruff.per-file-ignores]
100101
"noxfile.py" = ["G"]
101102
"tests/*" = ["B011"]
103+
104+
[tool.ruff.isort]
105+
# We need to explicitly make pip "first party" as it's imported by code in
106+
# the docs and tests directories.
107+
known-first-party = ["pip"]
108+
known-third-party = ["pip._vendor"]

tests/functional/test_install_compat.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77

88
import pytest
99

10-
from tests.lib import pyversion # noqa: F401
11-
from tests.lib import PipTestEnvironment, TestData, assert_all_changes
10+
from tests.lib import (
11+
PipTestEnvironment,
12+
TestData,
13+
assert_all_changes,
14+
pyversion, # noqa: F401
15+
)
1216

1317

1418
@pytest.mark.network

tests/functional/test_install_upgrade.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@
66

77
import pytest
88

9-
from tests.lib import pyversion # noqa: F401
10-
from tests.lib import PipTestEnvironment, ResolverVariant, TestData, assert_all_changes
9+
from tests.lib import (
10+
PipTestEnvironment,
11+
ResolverVariant,
12+
TestData,
13+
assert_all_changes,
14+
pyversion, # noqa: F401
15+
)
1116
from tests.lib.local_repos import local_checkout
1217
from tests.lib.wheel import make_wheel
1318

tests/functional/test_install_user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
import pytest
1010

11-
from tests.lib import pyversion # noqa: F401
1211
from tests.lib import (
1312
PipTestEnvironment,
1413
TestData,
1514
create_basic_wheel_for_package,
1615
need_svn,
16+
pyversion, # noqa: F401
1717
)
1818
from tests.lib.local_repos import local_checkout
1919
from tests.lib.venv import VirtualEnvironment

tests/functional/test_install_vcs_git.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
import pytest
55

6-
from tests.lib import pyversion # noqa: F401
76
from tests.lib import (
87
PipTestEnvironment,
98
_change_test_package_version,
109
_create_test_package,
10+
pyversion, # noqa: F401
1111
)
1212
from tests.lib.git_submodule_helpers import (
1313
_change_test_package_submodule,

tests/functional/test_wheel.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
import pytest
88

99
from pip._internal.cli.status_codes import ERROR
10-
from tests.lib import pyversion # noqa: F401
11-
from tests.lib import PipTestEnvironment, TestData
10+
from tests.lib import (
11+
PipTestEnvironment,
12+
TestData,
13+
pyversion, # noqa: F401
14+
)
1215

1316

1417
def add_files_to_dist_directory(folder: Path) -> None:

0 commit comments

Comments
 (0)