Skip to content

Commit 1895041

Browse files
committed
Check for import order
1 parent 42c0c58 commit 1895041

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

coverage/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@
88
99
"""
1010

11-
from coverage.version import __version__, __url__, version_info
11+
import sys
1212

1313
from coverage.control import Coverage, process_startup
1414
from coverage.data import CoverageData
1515
from coverage.misc import CoverageException
1616
from coverage.plugin import CoveragePlugin, FileTracer, FileReporter
1717
from coverage.pytracer import PyTracer
18+
from coverage.version import __version__, __url__, version_info
1819

1920
# Backward compatibility.
2021
coverage = Coverage
2122

2223
# On Windows, we encode and decode deep enough that something goes wrong and
2324
# the encodings.utf_8 module is loaded and then unloaded, I don't know why.
2425
# Adding a reference here prevents it from being unloaded. Yuk.
25-
import encodings.utf_8
26+
import encodings.utf_8 # pylint: disable=wrong-import-position, wrong-import-order
2627

2728
# Because of the "from coverage.control import fooey" lines at the top of the
2829
# file, there's an entry for coverage.coverage in sys.modules, mapped to None.
2930
# This makes some inspection tools (like pydoc) unable to find the class
3031
# coverage.coverage. So remove that entry.
31-
import sys
3232
try:
3333
del sys.modules['coverage.coverage']
3434
except KeyError:

pylintrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ disable=
7474
too-many-ancestors,
7575
# Formatting stuff
7676
superfluous-parens,bad-continuation,
77-
# I'm fine deciding my own import order,
78-
wrong-import-position,
79-
wrong-import-order,
8077
# Messages that are noisy for now, eventually maybe we'll turn them on:
8178
invalid-name,
8279
protected-access,

setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
import os
1010
import sys
1111

12+
# Setuptools has to be imported before distutils, or things break.
1213
from setuptools import setup
13-
from distutils.core import Extension # pylint: disable=no-name-in-module, import-error
14-
from distutils.command.build_ext import build_ext # pylint: disable=no-name-in-module, import-error
15-
from distutils import errors # pylint: disable=no-name-in-module
14+
from distutils.core import Extension # pylint: disable=no-name-in-module, import-error, wrong-import-order
15+
from distutils.command.build_ext import build_ext # pylint: disable=no-name-in-module, import-error, wrong-import-order
16+
from distutils import errors # pylint: disable=no-name-in-module, wrong-import-order
17+
1618

1719
# Get or massage our metadata. We exec coverage/version.py so we can avoid
1820
# importing the product code into setup.py.

tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
This module is run automatically by pytest, to define and enable fixtures.
88
"""
99

10-
import pytest
1110
import warnings
1211

12+
import pytest
13+
1314
from coverage import env
1415

1516

0 commit comments

Comments
 (0)