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

ValueError when running with python 3.11 (appears to be upstream pydantic bug) #4

Closed
clncy opened this issue Mar 25, 2023 · 2 comments

Comments

@clncy
Copy link

clncy commented Mar 25, 2023

Hi there,

Thank you for your work on this LS, I've really enjoyed using it with Neovim so far.

I'm getting the following error when I run cfn-lsp-extra:

  File "~/.local/pipx/venvs/cfn-lsp-extra/lib/python3.11/site-packages/pydantic/utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/inspect.py", line 2722, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name

It only occurs with python 3.11 (no issues with 3.9 and 3.10). It looks to be an upstream issue with Pydantic, which has now been resolved: pydantic/pydantic#4011

Manually installing pydantic 1.10.7 resolves the issue for me, so perhaps bumping the pydantic version up to 1.10 is all that is required.

@LaurenceWarne
Copy link
Owner

Hi, thanks for the report! I'm glad you've found the language server useful.

It only occurs with python 3.11 (no issues with 3.9 and 3.10). It looks to be an upstream issue with Pydantic, which has now been resolved: pydantic/pydantic#4011

Good spot, I've updated pydantic (unfortunately this meant updating the LSP backend (pygls), where there were multiple breaking changes 😅), and enabled 3.11 on ci, and everything looks good.

To be double sure, are you able to install cfn-lsp-extra from source to check? You should be able to do with this lovely command:

pipx install git+https://github.com/laurencewarne/cfn-lsp-extra.git@$(git ls-remote git@github.com:laurencewarne/cfn-lsp-extra.git | head -1 | cut -f1) --force

@clncy
Copy link
Author

clncy commented Mar 25, 2023

unfortunately this meant updating the LSP backend (pygls), where there were multiple breaking changes 😅

Fun times!

To be double sure, are you able to install cfn-lsp-extra from source to check?

I've just used your command to install from source and the issue looks to be resolved 😎

Thanks for the quick response

@clncy clncy closed this as completed Mar 25, 2023
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

2 participants