-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugneeds investigation
Description
Steps to reproduce
- Make sure extension uses Python3.11
- Open python project without pydantic installed
- Observe server crash
Reason
Bundled version of pydantic is outdated, doesn't officialy support python 3.10 and crashes on 3.11
https://github.com/samuelcolvin/pydantic/pull/2885/files#diff-75ec66ee30c88591d87f430102cfbba45e2e0e31a50df8ab4862f03edc6d4072R237
Solution
- add pydantic to the requirements
or - fix version of pydantic installed with pygils (in pygils repo)
Formatter Name: Black
Formatter Module: black
Traceback (most recent call last):
File "/Users/bobronium/.vscode/extensions/ms-python.black-formatter-2022.1.11451003/bundled/formatter/format_server.py", line 19, in <module>
from pygls import lsp, protocol, server, uris, workspace
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bobronium/.vscode/extensions/ms-python.black-formatter-2022.1.11451003/bundled/libs/pygls/lsp/__init__.py", line 23, in <module>
from pygls.lsp.types import *
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bobronium/.vscode/extensions/ms-python.black-formatter-2022.1.11451003/bundled/libs/pygls/lsp/types/__init__.py", line 2, in <module>
from pygls.lsp.types.basic_structures import *
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bobronium/.vscode/extensions/ms-python.black-formatter-2022.1.11451003/bundled/libs/pygls/lsp/types/basic_structures.py", line 30, in <module>
from pydantic import BaseModel, root_validator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bobronium/.vscode/extensions/ms-python.black-formatter-2022.1.11451003/bundled/libs/pydantic/__init__.py", line 2, in <module>
from . import dataclasses
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bobronium/.vscode/extensions/ms-python.black-formatter-2022.1.11451003/bundled/libs/pydantic/dataclasses.py", line 7, in <module>
from .main import create_model, validate_model
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bobronium/.vscode/extensions/ms-python.black-formatter-2022.1.11451003/bundled/libs/pydantic/main.py", line 376, in <module>
class BaseModel(Representation, metaclass=ModelMetaclass):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bobronium/.vscode/extensions/ms-python.black-formatter-2022.1.11451003/bundled/libs/pydantic/main.py", line 369, in __new__
cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bobronium/.vscode/extensions/ms-python.black-formatter-2022.1.11451003/bundled/libs/pydantic/utils.py", line 235, in generate_model_signature
if config.extra is config.extra.allow:
^^^^^^^^^^^^^^^^^^
File "/Users/bobronium/.pyenv/versions/3.11.0a7/lib/python3.11/enum.py", line 169, in __get__
raise AttributeError(
^^^^^^^^^^^^^^^^^^^^^
AttributeError: <enum 'Extra'> member has no attribute 'allow'
[Info - 1:30:39 PM] Connection to server got closed. Server will restart.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugneeds investigation