This is the first beta for isort 10. This version will contain a breaking style change to align the handling of non-aliased from imports (e.g., from package import module) with ruff and fix some related bugs.
Like ruff, isort will now group these imports into one statement. For example: from package import module, module_two.
Please let us know whether this change causes unintended problems in your projects.
There are a couple of less signficiant breaking changes discussed below.
💥 Breaking Changes
- Group non-aliased
fromimports by @DanielNoord in #2614 - Drop Python 3.10 support by @DanielNoord with @Copilot in #2697
- Remove shebang-based file detection by @DanielNoord with @Copilot in #2701
Previouslyisortwould open every file in the passed directories to see whether they contained a Python shebang line and then format these files. This is no longer supported and only files with the selected file extensions will be formatted. Not opening every file it encounters speeds upisortsignificantly. - Unify
--versionCLI arguments and always show quick guide by @DanielNoord in #2726
🚀 Features
🪲 Fixes
- Keep the multiline layout of a sorted literal that has a trailing comment by @youdie006 in #2686
- Fix combine_straight_imports mixing up module names on long lines by @APX403 in #2724
- Respect extension filters for explicit files with --filter-files by @00200200 in #2720* Keep an import that follows an indented import block with lines_before_imports by @Eljees in #2672
- Preserve atomic Cython output for write-only streams by @xiehuanyi in #2721
- grid: preserve trailing comment when no line wrap is needed by @Master-Norna in #2675
Other changes
- Bump the uv group with 4 updates by @dependabot[bot] in #2700
- Bump urllib3 from 2.7.0 to 2.8.0 by @dependabot[bot] in #2702
- Update dependencies in playground by @DanielNoord in #2713
- Several small typing improvements by @DanielNoord in #2714
- Document how imports are classified into sections by @abdull-ah-med in #2722
- Small cleanup before release by @DanielNoord in #2731
Full Changelog: 9.0.2...10.0.0b1