omnilib / ufmt

Safe, atomic formatting with black and µsort
https://ufmt.omnilib.dev
MIT License
98 stars 11 forks source link

VSCode, TypeGuard, and TypeVar throw error #174

Closed dsm-72 closed 8 months ago

dsm-72 commented 1 year ago

I am using python 3.11

$ python --version
Python 3.11.4

Here is the output that I get from VSCode Output tab, any ideas?

Name: ufmt
Module: ufmt
Python extension loading
Waiting for interpreter from python extension.
Python extension loaded
Traceback (most recent call last):
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/tool/server.py", line 49, in <module>
    from pygls import protocol, server, uris, workspace
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/pygls/protocol.py", line 43, in <module>
    from pygls.feature_manager import FeatureManager, assign_help_attrs, is_thread_function
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/pygls/feature_manager.py", line 28, in <module>
    from pygls.lsp import get_method_options_type, is_instance
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/pygls/lsp/__init__.py", line 36, in <module>
    from typeguard import check_type
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/typeguard/__init__.py", line 27, in <module>
    from typing_extensions import Literal
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/typing_extensions.py", line 1174, in <module>
    class TypeVar(typing.TypeVar, _DefaultMixin, _root=True):
TypeError: type 'typing.TypeVar' is not an acceptable base type
[Info  - 8:34:49 AM] Connection to server got closed. Server will restart.
Traceback (most recent call last):
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/tool/server.py", line 49, in <module>
    from pygls import protocol, server, uris, workspace
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/pygls/protocol.py", line 43, in <module>
    from pygls.feature_manager import FeatureManager, assign_help_attrs, is_thread_function
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/pygls/feature_manager.py", line 28, in <module>
    from pygls.lsp import get_method_options_type, is_instance
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/pygls/lsp/__init__.py", line 36, in <module>
    from typeguard import check_type
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/typeguard/__init__.py", line 27, in <module>
    from typing_extensions import Literal
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/typing_extensions.py", line 1174, in <module>
    class TypeVar(typing.TypeVar, _DefaultMixin, _root=True):
TypeError: type 'typing.TypeVar' is not an acceptable base type
[Info  - 8:34:50 AM] Connection to server got closed. Server will restart.
Traceback (most recent call last):
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/tool/server.py", line 49, in <module>
    from pygls import protocol, server, uris, workspace
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/pygls/protocol.py", line 43, in <module>
    from pygls.feature_manager import FeatureManager, assign_help_attrs, is_thread_function
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/pygls/feature_manager.py", line 28, in <module>
    from pygls.lsp import get_method_options_type, is_instance
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/pygls/lsp/__init__.py", line 36, in <module>
    from typeguard import check_type
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/typeguard/__init__.py", line 27, in <module>
    from typing_extensions import Literal
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/typing_extensions.py", line 1174, in <module>
    class TypeVar(typing.TypeVar, _DefaultMixin, _root=True):
TypeError: type 'typing.TypeVar' is not an acceptable base type
[Info  - 8:34:50 AM] Connection to server got closed. Server will restart.
Traceback (most recent call last):
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/tool/server.py", line 49, in <module>
    from pygls import protocol, server, uris, workspace
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/pygls/protocol.py", line 43, in <module>
    from pygls.feature_manager import FeatureManager, assign_help_attrs, is_thread_function
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/pygls/feature_manager.py", line 28, in <module>
    from pygls.lsp import get_method_options_type, is_instance
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/pygls/lsp/__init__.py", line 36, in <module>
    from typeguard import check_type
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/typeguard/__init__.py", line 27, in <module>
    from typing_extensions import Literal
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/typing_extensions.py", line 1174, in <module>
    class TypeVar(typing.TypeVar, _DefaultMixin, _root=True):
TypeError: type 'typing.TypeVar' is not an acceptable base type
[Info  - 8:34:50 AM] Connection to server got closed. Server will restart.
Traceback (most recent call last):
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/tool/server.py", line 49, in <module>
    from pygls import protocol, server, uris, workspace
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/pygls/protocol.py", line 43, in <module>
    from pygls.feature_manager import FeatureManager, assign_help_attrs, is_thread_function
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/pygls/feature_manager.py", line 28, in <module>
    from pygls.lsp import get_method_options_type, is_instance
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/pygls/lsp/__init__.py", line 36, in <module>
    from typeguard import check_type
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/typeguard/__init__.py", line 27, in <module>
    from typing_extensions import Literal
  File "/Users/USER/.vscode/extensions/omnilib.ufmt-2023.4.3-darwin-arm64/bundled/libs/typing_extensions.py", line 1174, in <module>
    class TypeVar(typing.TypeVar, _DefaultMixin, _root=True):
TypeError: type 'typing.TypeVar' is not an acceptable base type
[Error - 8:34:51 AM] Connection to server got closed. Server will not be restarted.
JelleZijlstra commented 1 year ago

This was fixed in typing-extensions 4.6.0 (https://github.com/python/typing_extensions/issues/243). It looks from your output like you're using a ufmt VSCode extension that bundles an old version of typing-extensions. That extension should upgrade its bundled packages; not sure whether it's controlled by this repository or something else.

dsm-72 commented 1 year ago

@JelleZijlstra thank you for the info. So it seems that it is beyond my control for the moment.

zsol commented 11 months ago

It's controlled by https://github.com/omnilib/vscode-ufmt

thatch commented 8 months ago

The version of typing-extensions was changed in https://github.com/omnilib/vscode-ufmt/commit/c1862dfe4cc326f8d1888719cdb687b13e3654a4 -- I suspect this should be fixed now.