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

Migrate to pygls v1.0 #484

Merged
merged 10 commits into from Jan 14, 2023
Merged

Migrate to pygls v1.0 #484

merged 10 commits into from Jan 14, 2023

Conversation

alcarney
Copy link
Member

@alcarney alcarney commented Nov 5, 2022

This is very early and very rough but I think it's worth giving people the heads up that this is coming.

pygls, the library that esbonio relies on for it's language server protocol implementation has released v1.0 with some breaking changes (see openlawlibrary/pygls#273 more details), this PR migrates esbonio to this new version.
These changes may or may not affect you, depending on how you use esbonio.

End Users

Apart from dropping Python v3.6 support, there should be no breaking changes in esbonio

Integrators

As mentioned above Python v3.6 will no longer be supported, and some transitive dependencies will change but everything else (config values, notifications etc) should remain the same.

Extension Authors

There unfortunately, will be breaking changes but they will be due to implementation details from pygls leaking through rather than any changes to esbonio's APIs. Hopefully this means the migration is not too painful.

A migration guide for pygls is still being worked on, but here's some of the highlights.

  • The pygls.lsp.types and pygls.lsp.methods modules have been removed, all LSP type and method definitions are now provided by the lsprotocol package
  • LSP type and method definitions are no longer defined using pydantic, but with attrs and using cattrs for serialization/deserialization

While testing will certainly be appreciated, I don't think this PR is quite ready for that as I am already aware of some issues that require further changes upstream in pygls. I am also not expecting this to land for a while yet and intend to make at least one more release based on the old version of pygls.

Pinging some people who probably have an interest in this
@lextm @yaegassy @danwos @haiyangToAI

Let me know if you have any thoughts

Closes #400

@alcarney
Copy link
Member Author

alcarney commented Dec 3, 2022

pygls v1.0 is now out and the migration is done, I just need to get an updated version of pytest-lsp out so that the test suite passes in CI.

I'd say this was ready to test if anyone fancies trying this branch out. There is also a migration guide for pygls which you might find useful if you're an extension author.

The plan is to include this in the next feature release v0.16.0

@polyzen
Copy link

polyzen commented Dec 22, 2022

Happy holidays! Any ETA on this? Latest jedi-language-server and the new ruff-lsp require pygls 1.0.0. Esbonio and jedi-ls are available for system installation in the Arch repos, and I would like to make a ruff-lsp package for the AUR.

@alcarney
Copy link
Member Author

Happy holidays to you too! 😄
ETA I expect will be sometime in January (hopefully sooner rather than later).

Technically the only thing holding this up is a new release of pytest-lsp which will unblock CI.

That said, I'd also like to get #514 merged first as I'd rather not force the migration onto @stsewd if I can help it, but we'll see how it goes.

@polyzen
Copy link

polyzen commented Dec 27, 2022

Works for me, backported this PR in the meantime:
archlinux/svntogit-community@38bb6aa

@alcarney alcarney marked this pull request as ready for review January 12, 2023 22:54
@alcarney alcarney changed the title [WIP] Migrate to pygls v1.0 Migrate to pygls v1.0 Jan 12, 2023
Finally figured out how to run `mypy` as a pre-commit hook in a
way that allows `mypy` to resolve imports correctly.
Turns out each module within a namespace requires its own `py.typed`
file

> For namespace packages (see PEP 420), the py.typed file should be in
> the submodules of the namespace, to avoid conflicts and for clarity.

> This PEP does not support distributing typing information as part of
> module-only distributions or single-file modules within namespace
> packages.

> The single-file module should be refactored into a package and
> indicate that the package supports typing as described above.

See: https://peps.python.org/pep-0561/#packaging-type-information
They won't work with the latest `lsp-devtools` anyway...
@alcarney alcarney merged commit 1121d06 into swyddfa:develop Jan 14, 2023
@alcarney alcarney deleted the pygls-1.0 branch January 14, 2023 14:12
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

Successfully merging this pull request may close these issues.

Dropping Python 3.6
2 participants