Skip to content

Comments

Update isort to 7.0.0 for Python 3.14 compatibility#521

Merged
edvilme merged 3 commits intomainfrom
copilot/update-isort-dependency-version
Feb 17, 2026
Merged

Update isort to 7.0.0 for Python 3.14 compatibility#521
edvilme merged 3 commits intomainfrom
copilot/update-isort-dependency-version

Conversation

Copy link
Contributor

Copilot AI commented Feb 17, 2026

Python 3.14 removed ast.Str, ast.Num, ast.Bytes, ast.NameConstant, and ast.Ellipsis (deprecated since 3.8). The bundled isort 6.1.0 still references these classes internally, causing the LSP server to crash on Python 3.14 interpreters.

Changes

Dependencies

  • Pin isort>=7.0.0 in requirements.in
  • Regenerate requirements.txt (removes importlib-metadata, exceptiongroup, zipp - no longer needed by isort 7.x)

Version constraints

  • Update MIN_VERSION in bundled/tool/lsp_server.py: "5.10.1""7.0.0"
  • Update README.md and NOTICE.txt to reflect shipped version

isort 7.0.0 removes all references to deprecated AST node types via PyCQA/isort#2433 and PyCQA/isort#2425.

Original prompt

Problem

Issue #479 reports that the vscode-isort extension crashes on Python 3.14 with:

ImportError: cannot import name 'Str' from 'ast'

Python 3.14 removed the deprecated ast.Str, ast.Num, ast.Bytes, ast.NameConstant, and ast.Ellipsis classes (deprecated since Python 3.8). The currently bundled isort==6.1.0 still references these removed classes internally, causing the server to crash repeatedly when users have Python 3.14 set as their interpreter.

Solution

Update the bundled isort dependency from 6.1.0 to 7.0.0 or later. The isort 7.0.0 release includes explicit Python 3.14 compatibility fixes (PRs #2433 and #2425 in PyCQA/isort).

Steps

  1. Update requirements.in to pin isort>=7.0.0 (currently it just says isort with no version constraint).
  2. Recompile requirements.txt by running:
    uv pip compile --generate-hashes --upgrade -o ./requirements.txt ./requirements.in
    
  3. Update MIN_VERSION in bundled/tool/lsp_server.py (line 86) from "5.10.1" to the new minimum version if appropriate.
  4. Update any references to the old isort version in NOTICE.txt or other files if needed.
  5. Ensure the extension still works correctly with isort 7.x (the LSP server invokes isort as a module and parses its stdout/stderr output).

Fixes #479

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
@edvilme edvilme added the dependencies Pull requests that update a dependency file label Feb 17, 2026
Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
@edvilme edvilme added the debt Technical debt or repo cleanup label Feb 17, 2026
Copilot AI changed the title [WIP] Update isort dependency for Python 3.14 compatibility Update isort to 7.0.0 for Python 3.14 compatibility Feb 17, 2026
@edvilme edvilme marked this pull request as ready for review February 17, 2026 22:14
Copilot AI requested a review from edvilme February 17, 2026 22:14
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 17, 2026
@edvilme edvilme merged commit d55260b into main Feb 17, 2026
20 checks passed
@edvilme edvilme deleted the copilot/update-isort-dependency-version branch February 17, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debt Technical debt or repo cleanup dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python 3.14 sort is broken due to import

3 participants