-
Notifications
You must be signed in to change notification settings - Fork 36
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
bundled/tool/*.py incompatibilities with packages in venv with importStrategy=fromEnvironment #369
Comments
As a workaround, you could upgrade your local/venv version of That said, it does appear that ms-python.black-formatter is bundling |
From https://github.com/microsoft/vscode-black-formatter/blob/main/bundled/tool/lsp_runner.py#L28-L32 it looks like package lookup order will end up as:
So if a dependency exists in the venv it will be used instead of a bundled equivalent. On top of that I expect https://github.com/microsoft/vscode-black-formatter/blob/main/bundled/tool/lsp_server.py#L372 will need to treat the |
We chose to load I think a better solution is to get rid if the dependency if possible on the server. see here openlawlibrary/pygls#409 |
Can the |
I think 4.6 and above is good enough. Ref: https://github.com/python/typing_extensions/blob/main/CHANGELOG.md#release-460-may-22-2023 Anyways, hopefully a better solution arises from all the discussions here. Thank you all. 😄 |
Since
The
https://www.attrs.org/en/stable/api.html#attrs.Attribute By upgrading to |
I have been having this exact issue too, and it happens regardless of the importStrategy setting. |
The
fromEnvironment
option for the extension settingblack-formatter.importStrategy
indicates that it controls where the black tool is used from, but the setting also affects the venv in which the bundled LSP server runs. If the venv contains old versions of dependencies of the LSP server (eg.typing_extensions==4.5.0
) then the extension fails to load with errors as below:This issue can currently be worked around by instead configuring
black-formatter.path
to invoke black from the desired venv.A cursory suggestion would be for the LSP server process to be sandboxed to only use only the bundled packages, regardless of whether
"fromEnvironment"
is configured.Note that this issue is also present in the other Microsoft LSP Python extensions.
The text was updated successfully, but these errors were encountered: