-
Notifications
You must be signed in to change notification settings - Fork 180
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
Switch to python 3.8 #1389
Comments
Package Control WIP branch is at https://github.com/wbond/package_control/tree/four-point-oh |
Realistically also I only really use |
I think the time for Python 3.8 if finally here :) Just a small note,
I did a quick experiment. I have only LSP and LSP-pyright setup. Once I did that, I expected that I need to change something in lsp_utils, I don't know why I didn't need to change anything in lsp_utils...
|
I don't really know how Package Control works, but I can see two unmerged pull requests wbond/package_control_channel#8713 and wbond/packagecontrol.io#157 for the channel and for the website, whose descriptions indicate that they are required to install dependencies/libraries on the 3.8 environment:
So, as far as I understand, the linked PR needs to be merged first, and even after that we can't upgrade to Python 3.8 unless we drop the pathlib dependency. Is that correct? Edit: Ah, pathlib is of course part of the Python 3.8 stdlib, so we can just remove it from the dependencies and import from the stdlib directly in the code. I guess then it makes sense why the dependency is only for Python 3.3 😄 Also as far as I understand, all LSP-* helper packages will need a
|
I believe the purpose is to clearly define what is a public interface and what is internal. Especially for the plugin packages accessing those. I'm not sure how well it's working in practice... I suppose there are cases already where the plugins just override the type and access things anyway. |
Besides the fact that there is no way in Python to enforce this (those are only type annotations in the plugin class methods anyway) and as you wrote plugins can easily workaround it, Python already has a convention to mark private methods with an underscore. So in my opinion those protocol classes have zero advantages and only make working with the code harder if you use tools like Pyright which use the type annotations as source for "Goto Definition". And around half of the methods from the protocol classes are not meant to be used by plugins anyway and instead were just added there to satify the type checker. Furthermore, there are other classes exposed in the plugin API which apparently also work fine without having a protocol class, e.g. I can also see no indication in https://peps.python.org/pep-0544/ that the intention of |
I get your point. It seems a bit excessive given that we have only one implementation for each of those protocols. That said, regardless if misuse or not, it does make things easier for plugin developers to limit the stuff that they can see (type-wise). For example I do think removing those would simplify things within the LSP code base which would be nice. But do we want to accept the before-mentioned drawback? Probably the ideal way would be to have more restricted public |
From what I remember, the reason the two protocol classes Maybe that circular import problem doesn't exist anymore, in which case it's totally fine to remove them if possible (from a technical standpoint). |
This is most likely still a problem |
I've checked it and it turns out that both if TYPE_CHECKING:
from ..session_view import SessionView
from ..session_buffer import SessionBuffer and make those type annotations to be strings. AFAIK the latter is not even necessary anymore on Python 3.8 if you add |
FWIW, I am running LSP and all its helpers seamlessly on python 3.8 for years, since it was initially possible to somehow install dependencies for python 3.8 in early PC4.0 dev builds. Package Control 4 uses https://github.com/packagecontrol/channel to organize python 3.8 dependencies until there's a chance to upgrade packagecontrol.io. New depednecies/libraries need to be registered at https://github.com/packagecontrol/channel. So basically any package/plugin can migrate to python 3.8 The only challenge is probably to migrate LSP and all its helpers at the same time as those need to runn all on same plugin_host. lsp_utils is registered at https://github.com/packagecontrol/channel/blob/8142a3b67d2ee640d8769cbfcec593e6e4df5554/repository.json#L478-L497 to provide smooth transition experience. |
So in order for LSP to update, can you help me figure out what is needed:
Q1 Do I need to add/change something in |
Here is the complete lists of LSP-* packages:
The following list of LSP-* packages are outside of the org. We would need to figure out how to sync the LSP release and the release of LSP-* packages outside of the org.
The following packages will not be updated to py3.8:
|
No. It's working fine as it is.
The 3. steps described, are technically everything, which is needed.
It isn't a breaking change functionality wise. It is however a breaking change for LSP-* helper packages as they need to opt-in to python 3.8 as well to ensure to run on same plugin_host. This probably deserves a milestone or landmark to see which versions of LSP and LSP-* are compatible. That's however only an organizational thing as there's no dependency and version management available accross packages. At least a message for users would be good, to point this change out. |
I don't know if a message to users would be needed if the intention is that there will be no visible changes in the behavior... I don't think most users would really care about some internal detail regarding the runtime version the package runs on. |
Note that when I've tried LSP on python 3.8 before I've noticed that there is some breaking behavior regarding string enum handling. In 3.3 runtime it's not handled any differently than without annotation while in 3.8 I think there were issues with stringifying the value or something... |
If so, I - as an end user - haven't noticed them. |
I would say this is clearly a breaking change. There could be people using a local helper plugin instead of the There is (at least) one other package outside of the sublimelsp org that you missed above and which needs to be updated: |
This comment was marked as outdated.
This comment was marked as outdated.
I've added the proposed versions for each LSP package and it can be seen in this issue #2417 The format is the following: Example: Others feel free to take a look and suggest changes. @deathaxe I know that LSP-astro tries to follow the server version releases. I put |
I would suggest not picking a "deadline" until UnitTesting works with PC4 dependencies. There is no control over UnitTesting and we can't guarantee it'll even be fixed before March 9. |
That 9th March means nothing if the two bullet points get in the way. (currently, one of them is getting in the way) And I know that things will not be fix by themself, I want to have an optimistic point of view |
Small update, I saw that deathaxe proposed some fix on the LSP discord channel. I haven't took the time to understand it. (I took a look but I didn't understand what to do with that info) So, I will wait for things to get resolved one at a time, |
UnitTesting currently ships OS dependend scripts (Bash/Powershell) to roughly perform the following
then ...
... all running on a custom docker image. What my proposal or better proof of concept does is to perform everything after downloading ST from within the running ST instance using an installer_plugin - which actually already exists to perform step 5. This way setup and test action could hopefully be merged and ST wouldn't need to be restarted, which might even reduce runtime. |
P.S.: I wouldn't count on things resolving themself. |
I know.. I know 🙂 I just hesitate to open another Pandora box, where I need to invest time to learn. And thanks for the above explanation. |
When switching to 38 we have to also inform @daveleroy to update the LSP bridge in Debugger. |
I have some news! 🎉 LSP and LSP-* packages by SublimeLSP are moving to Python 3.8 on April 19, 2024. Important DateFri Apr 19 2024 17:00:00 GMT+0000 The Plan
For maintainers of LSP-* packages outside SublimeLSP:
To assist maintainers outside the organization, I've already made the PRs:
Please react with 👀 when you see this message :) Other things to know
If someone has any questions/concerns feel free to ask. |
It makes sense that LSP gets a major version update, I planned to do a major version update for LSP-* packages, I'll update this ticket accordingly soon. |
Hello 👋 in ~one hour the LSP release will be created :) |
The LSP v2 release is created -> https://github.com/sublimelsp/LSP/releases/tag/4070-2.0.0 Maintainers who maintain LSP-* packages outside of the SublimeLSP organization. |
I think that this can also be closed now :) |
This is complete |
Before we can use asyncio in all of its glory, we need to switch to the Python 3.8 runtime. To do that, we have to wait for a few things:
As far as I understand, this is also going to be a hard backwards-incompatible break. So we have to announce it.
The text was updated successfully, but these errors were encountered: