Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ codecov:
notify:
# Wait on all test jobs so Github merge queue doesn't remove PRs from the queue due to codecov
# eagerly reporting the status
after_n_builds: 36
after_n_builds: 30
1 change: 0 additions & 1 deletion .deepsource.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ test_patterns = ["tests/**"]
exclude_patterns = [
"tests/**",
"scripts/**",
"isort/_vendored/**",
]


Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
os: [ubuntu-latest, macos-latest, windows-latest]
compiled: [true, false]
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ isort is a Python utility / library to sort imports alphabetically and
automatically separate into sections and by type. It provides a command line
utility, Python library and [plugins for various
editors](https://github.com/pycqa/isort/wiki/isort-Plugins) to
quickly sort all your imports. It requires Python 3.10+ to run but
quickly sort all your imports. It requires Python 3.11+ to run but
supports formatting Python 2 code too.

- [Try isort now from your browser!](docs/quick_start/0.-try.md)
Expand Down
3 changes: 1 addition & 2 deletions docs/contributing/1.-contributing-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Account Requirements:

Base System Requirements:

- Python3.10+
- Python3.11+
- uv
- bash or a bash compatible shell (should be auto-installed on Linux / Mac)
- WSL users running Ubuntu may need to install Python's venv module even after installing Python.
Expand Down Expand Up @@ -78,4 +78,3 @@ I can not tell you how thankful I am for the hard work done by isort contributor
Thank you!

~Timothy Crosley

2 changes: 1 addition & 1 deletion example_isort_formatting_plugin/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.1"
description = "An example plugin that modifies isort formatting using black."
authors = [{name = "Timothy Crosley", email = "timothy.crosley@gmail.com"}, {name = "staticdev", email = "staticdev-support@proton.me"}]
license = "MIT"
requires-python = ">=3.10.0"
requires-python = ">=3.11.0"
dependencies = [
"isort>=5.13.2",
"black>=24.3.0",
Expand Down
62 changes: 1 addition & 61 deletions example_isort_formatting_plugin/uv.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example_isort_sorting_plugin/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
description = "An example plugin that modifies isorts sorting order to provide an even more natural sort by utilizing natsort."
authors = [{name = "Timothy Crosley", email = "timothy.crosley@gmail.com"}, {name = "staticdev", email = "staticdev-support@proton.me"}]
license = "MIT"
requires-python = ">=3.10.0"
requires-python = ">=3.11.0"
dependencies = [
"natsort>=7.1.1"
]
Expand Down
2 changes: 1 addition & 1 deletion example_isort_sorting_plugin/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example_shared_isort_profile/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
description = "An example shared isort profile"
authors = [{name = "Timothy Crosley", email = "timothy.crosley@gmail.com"}, {name = "staticdev", email = "staticdev-support@proton.me"}]
license = "MIT"
requires-python = ">=3.10.0"
requires-python = ">=3.11.0"

[project.entry-points."isort.profiles"]
example = "example_shared_isort_profile:PROFILE"
Expand Down
2 changes: 1 addition & 1 deletion example_shared_isort_profile/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 14 additions & 9 deletions isort/_parse_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import re
from collections.abc import Callable
from typing import Literal, NamedTuple
from enum import StrEnum
from typing import NamedTuple

from .settings import Config

Expand Down Expand Up @@ -165,21 +166,25 @@ def normalize_from_import_string(import_string: str) -> str:
)


# TODO: Return a `StrEnum` once we no longer support Python 3.10.
def import_type(
line: str, config: Config
) -> Literal["from", "straight", "lazy_from", "lazy_straight"] | None:
class _ImportType(StrEnum):
FROM = "from"
STRAIGHT = "straight"
LAZY_FROM = "lazy_from"
LAZY_STRAIGHT = "lazy_straight"


def import_type(line: str, config: Config) -> _ImportType | None:
"""If the current line is an import line it will return its type."""
if config.honor_noqa and line.lower().rstrip().endswith("noqa"):
return None
if "isort:skip" in line or "isort: skip" in line or "isort: split" in line:
return None
if line.startswith(("import ", "cimport ")):
return "straight"
return _ImportType.STRAIGHT
if line.startswith("from "):
return "from"
return _ImportType.FROM
if line.startswith("lazy import "):
return "lazy_straight"
return _ImportType.LAZY_STRAIGHT
if line.startswith("lazy from "):
return "lazy_from"
return _ImportType.LAZY_FROM
return None
21 changes: 0 additions & 21 deletions isort/_vendored/tomli/LICENSE

This file was deleted.

8 changes: 0 additions & 8 deletions isort/_vendored/tomli/__init__.py

This file was deleted.

Loading
Loading