Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode, TypeGuard, and TypeVar throw error #174

Closed
dsm-72 opened this issue Oct 24, 2023 · 4 comments
Closed

VSCode, TypeGuard, and TypeVar throw error #174

dsm-72 opened this issue Oct 24, 2023 · 4 comments

Comments

@dsm-72
Copy link

dsm-72 commented Oct 24, 2023

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
Copy link

This was fixed in typing-extensions 4.6.0 (python/typing_extensions#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
Copy link
Author

dsm-72 commented Oct 24, 2023

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

@zsol
Copy link

zsol commented Dec 2, 2023

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

@thatch
Copy link
Contributor

thatch commented Feb 14, 2024

The version of typing-extensions was changed in omnilib/vscode-ufmt@c1862df -- I suspect this should be fixed now.

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

No branches or pull requests

5 participants