Drop Python 3.10 support - #2697
Conversation
| for statement in statements: | ||
| line, raw_line = normalize_line(statement) | ||
| type_of_import = import_type(line, config) or "" | ||
| type_of_import = cast( |
There was a problem hiding this comment.
@copilot This cast should be removable by using proper types
There was a problem hiding this comment.
Removed the cast by returning the import-kind Literal union directly from import_type. Mypy and parser/identifier tests pass in commit acd585d.
| strict = true | ||
| follow_imports = "silent" | ||
| packages = ["isort", "tests"] | ||
| exclude = "isort/_vendored|tests/unit/example_projects|tests/unit/example_crlf_file.py" |
There was a problem hiding this comment.
@copilot I don't think we need _vendored anymore. Remove it and any referneces to it.
There was a problem hiding this comment.
Removed the stale _vendored excludes from coverage, mypy, Flake8/Ruff, DeepSource, and Bandit configuration. No _vendored path references remain; committed as acd585d.
|
|
||
|
|
||
| # TODO: Return a `StrEnum` once we no longer support Python 3.10. | ||
| def import_type( |
There was a problem hiding this comment.
@copilot Add the StrEnum from the earlier commits back but make sure it is used everywhere in the codebase correctly.
There was a problem hiding this comment.
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.
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>
6dba557 to
4f22f7a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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:
|
Raise isort’s minimum runtime to Python 3.11 and remove compatibility code that is no longer needed.
tomllibdirectly, remove vendoredtomli, and replace the import-kind TODO withStrEnum.