diff options
-rw-r--r-- | isort/main.py | 4 | ||||
-rw-r--r-- | isort/settings.py | 1 | ||||
-rw-r--r-- | tests/test_comments.py | 1 | ||||
-rw-r--r-- | tests/test_output.py | 1 | ||||
-rw-r--r-- | tests/test_parse.py | 1 | ||||
-rw-r--r-- | tests/test_wrap_modes.py | 1 |
6 files changed, 3 insertions, 6 deletions
diff --git a/isort/main.py b/isort/main.py index 4447545e..2c30cfa0 100644 --- a/isort/main.py +++ b/isort/main.py @@ -14,7 +14,7 @@ import setuptools from . import SortImports, __version__, sections from .logo import ASCII_ART from .profiles import profiles -from .settings import DEFAULT_CONFIG, VALID_PY_TARGETS, Config, WrapModes +from .settings import DEFAULT_CONFIG, SUPPORTED_EXTENSIONS, VALID_PY_TARGETS, Config, WrapModes shebang_re = re.compile(br"^#!.*\bpython[23w]?\b") QUICK_GUIDE = f""" @@ -35,7 +35,7 @@ Visit https://timothycrosley.github.io/isort/ for complete information about how def is_python_file(path: str) -> bool: _root, ext = os.path.splitext(path) - if ext in (".py", ".pyi"): + if ext in SUPPORTED_EXTENSIONS: return True if ext in (".pex",): return False diff --git a/isort/settings.py b/isort/settings.py index ed5e4a51..387d10e4 100644 --- a/isort/settings.py +++ b/isort/settings.py @@ -55,6 +55,7 @@ try: except ImportError: appdirs = None +SUPPORTED_EXTENSIONS = (".py", ".pyi", ".pyx") FILE_SKIP_COMMENTS: Tuple[str, ...] = ( "isort:" + "skip_file", "isort: " + "skip_file", diff --git a/tests/test_comments.py b/tests/test_comments.py index b1b4ed7b..1805f137 100644 --- a/tests/test_comments.py +++ b/tests/test_comments.py @@ -1,5 +1,4 @@ from hypothesis_auto import auto_pytest_magic - from isort import comments auto_pytest_magic(comments.parse) diff --git a/tests/test_output.py b/tests/test_output.py index e42093b5..f9e04aec 100644 --- a/tests/test_output.py +++ b/tests/test_output.py @@ -1,7 +1,6 @@ import sys from hypothesis_auto import auto_pytest_magic - from isort import output auto_pytest_magic(output.with_comments, auto_allow_exceptions_=(ValueError,)) diff --git a/tests/test_parse.py b/tests/test_parse.py index efc3a22a..f5846bd7 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -1,5 +1,4 @@ from hypothesis_auto import auto_pytest_magic - from isort import parse from isort.settings import Config diff --git a/tests/test_wrap_modes.py b/tests/test_wrap_modes.py index dee26d4f..6c8a6655 100644 --- a/tests/test_wrap_modes.py +++ b/tests/test_wrap_modes.py @@ -1,7 +1,6 @@ import sys from hypothesis_auto import auto_pytest_magic - from isort import wrap_modes auto_pytest_magic(wrap_modes.grid, auto_allow_exceptions_=(ValueError,)) |