Skip to content

Commit ea68afa

Browse files
committed
Enable isort in pre-commit
1 parent 7224a11 commit ea68afa

File tree

12 files changed

+24
-23
lines changed

12 files changed

+24
-23
lines changed

.pre-commit-config.yaml

+5-6
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ repos:
1818
- id: trailing-whitespace
1919
exclude: .patch
2020

21-
# TODO: enable when fixed.
22-
# - repo: https://github.com/timothycrosley/isort
23-
# rev: 4.3.21
24-
# hooks:
25-
# - id: isort
26-
# files: \.py$
21+
- repo: https://github.com/timothycrosley/isort
22+
rev: 4.3.21
23+
hooks:
24+
- id: isort
25+
files: \.py$
2726

2827
- repo: https://github.com/pre-commit/mirrors-mypy
2928
rev: v0.720

src/pip/_internal/commands/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from __future__ import absolute_import
55

66
import importlib
7-
from collections import namedtuple, OrderedDict
7+
from collections import OrderedDict, namedtuple
88

99
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
1010

src/pip/_internal/distributions/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from pip._internal.distributions.source.legacy import SourceDistribution
22
from pip._internal.distributions.wheel import WheelDistribution
3-
43
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
54

65
if MYPY_CHECK_RUNNING:

src/pip/_internal/req/__init__.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55

66
import logging
77

8-
from .req_install import InstallRequirement
9-
from .req_set import RequirementSet
10-
from .req_file import parse_requirements
118
from pip._internal.utils.logging import indent_log
129
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
1310

11+
from .req_file import parse_requirements
12+
from .req_install import InstallRequirement
13+
from .req_set import RequirementSet
14+
1415
if MYPY_CHECK_RUNNING:
1516
from typing import Any, List, Sequence
1617

src/pip/_internal/vcs/__init__.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
# the vcs package don't need to import deeper than `pip._internal.vcs`.
33
# (The test directory and imports protected by MYPY_CHECK_RUNNING may
44
# still need to import from a vcs sub-package.)
5-
from pip._internal.vcs.versioncontrol import ( # noqa: F401
6-
RemoteNotFoundError, is_url, make_vcs_requirement_url, vcs,
7-
)
85
# Import all vcs modules to register each VCS in the VcsSupport object.
96
import pip._internal.vcs.bazaar
107
import pip._internal.vcs.git
118
import pip._internal.vcs.mercurial
129
import pip._internal.vcs.subversion # noqa: F401
10+
from pip._internal.vcs.versioncontrol import ( # noqa: F401
11+
RemoteNotFoundError,
12+
is_url,
13+
make_vcs_requirement_url,
14+
vcs,
15+
)

tasks/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import invoke
2-
32
from tools.automation import vendoring
43

54
ns = invoke.Collection(vendoring)
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
from setuptools import setup
2+
23
setup(name="dummy", version="0.1")
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
from setuptools import setup
2+
23
setup(name="dummy", version="0.1")

tests/data/src/pep518_with_namespace_package-1.0/setup.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import simple_namespace.module
44

5-
65
setup(
76
name='pep518_with_namespace_package',
87
version='1.0',

tests/data/src/simple_namespace/setup.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from setuptools import setup
22

3-
43
setup(
54
name='simple_namespace',
65
version='1.0',

tests/lib/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
from __future__ import absolute_import
22

3-
from contextlib import contextmanager
4-
from textwrap import dedent
53
import os
6-
import sys
74
import re
8-
import textwrap
9-
import site
105
import shutil
6+
import site
117
import subprocess
8+
import sys
9+
import textwrap
10+
from contextlib import contextmanager
11+
from textwrap import dedent
1212

1313
import pytest
1414
from scripttest import FoundDir, TestFileEnvironment

tools/automation/vendoring/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
""""Vendoring script, python 3.5 with requests needed"""
22

3-
from pathlib import Path
43
import os
54
import re
65
import shutil
76
import tarfile
87
import zipfile
8+
from pathlib import Path
99

1010
import invoke
1111
import requests

0 commit comments

Comments
 (0)