Skip to content

Drop Python 3.10 support - #2697

Merged
DanielNoord merged 6 commits into
mainfrom
copilot/drop-python-3-10-support
Oct 1, 2026
Merged

DanielNoord merged 6 commits into
mainfrom
copilot/drop-python-3-10-support

Conversation

Copilot AI commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Raise isort’s minimum runtime to Python 3.11 and remove compatibility code that is no longer needed.

  • Runtime: Require Python 3.11+, use tomllib directly, remove vendored tomli, and replace the import-kind TODO with StrEnum.
  • Project configuration: Update CI, tox, Docker, type-checker and linter targets, documentation, example package metadata, and lockfiles.
  • Sorting targets: Retain Python 3.10 standard-library data; it supports sorting for that target version, independent of isort’s runtime requirement.

Comment thread isort/parse.py Outdated
for statement in statements:
line, raw_line = normalize_line(statement)
type_of_import = import_type(line, config) or ""
type_of_import = cast(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot This cast should be removable by using proper types

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the cast by returning the import-kind Literal union directly from import_type. Mypy and parser/identifier tests pass in commit acd585d.

Comment thread pyproject.toml Outdated
strict = true
follow_imports = "silent"
packages = ["isort", "tests"]
exclude = "isort/_vendored|tests/unit/example_projects|tests/unit/example_crlf_file.py"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot I don't think we need _vendored anymore. Remove it and any referneces to it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the stale _vendored excludes from coverage, mypy, Flake8/Ruff, DeepSource, and Bandit configuration. No _vendored path references remain; committed as acd585d.

Comment thread isort/_parse_utils.py Outdated


# TODO: Return a `StrEnum` once we no longer support Python 3.10.
def import_type(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Add the StrEnum from the earlier commits back but make sure it is used everywhere in the codebase correctly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored _ImportType as a StrEnum and updated parser and identifier checks to use its members consistently. Typed import-bucket access remains statically checked without casts. Mypy, lint, and all 45 focused tests pass in commit 448d088.

Copilot AI requested a review from DanielNoord October 1, 2026 10:04
@DanielNoord
DanielNoord marked this pull request as ready for review October 1, 2026 13:36
@DanielNoord
DanielNoord enabled auto-merge October 1, 2026 19:42
Copilot AI and others added 6 commits October 1, 2026 21:53
Co-authored-by: DanielNoord <13665637+DanielNoord@users.noreply.github.com>
Co-authored-by: DanielNoord <13665637+DanielNoord@users.noreply.github.com>
Co-authored-by: DanielNoord <13665637+DanielNoord@users.noreply.github.com>
Co-authored-by: DanielNoord <13665637+DanielNoord@users.noreply.github.com>
@DanielNoord
DanielNoord force-pushed the copilot/drop-python-3-10-support branch from 6dba557 to 4f22f7a Compare October 1, 2026 19:53
@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.41%. Comparing base (9c00c1f) to head (4f22f7a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2697   +/-   ##
=======================================
  Coverage   99.41%   99.41%           
=======================================
  Files          41       41           
  Lines        3231     3235    +4     
  Branches      690      689    -1     
=======================================
+ Hits         3212     3216    +4     
  Misses         12       12           
  Partials        7        7           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DanielNoord
DanielNoord added this pull request to the merge queue Oct 1, 2026
Merged via the queue into main with commit 795d278 Oct 1, 2026
37 checks passed
@DanielNoord
DanielNoord deleted the copilot/drop-python-3-10-support branch October 1, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants