-
-
Notifications
You must be signed in to change notification settings - Fork 804
Add support for plugin_host-3.13 #1708
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67a80c3 to
2343a35
Compare
Prepare for 3.13
This commit fixes an issue with compiled python module path detection. Location differs depending on portable or non-portable ST builds, which hasn't been taken into account up to this commit. Hence module caches haven't been deleted when uninstalling libraries or packages in non-portable setups, before.
This commit dynamically evaluates supported python environments, depending on `disable_plugin_host_3.3` setting and existing plugin_host executables to return correct paths regardless ST versions. It should help reducing maintenance burden with upcoming transitions: 3.3/3.8 => 3.3/3.13 => 3.13
if a legacy dependency doesn't contain `st4_py313` folder, fallback to `st4_py38` or `st4` folders for implicit wheel conversion. It ensures existing dependencies, such as lsp_utils to continue working as good as possible, assuming no code-specific incompatibilities exist. It continues existing fallback strategies, also available for py38->py33.
This commit adjusts the algorithm to detect which plugin_host a plugin runs on. The following cases are covered. ST3143 .. 3211: - only py33 ST4000 .. 4192: - plugin in "User" package => py38 - .python-version present and contains "38" => py38 - otherwise => py33 ST4193 .. 4200: - plugin in "User" package => py38 - disable_plugin_host_3.3 = True => py38 - .python-version present and contains "38" => py38 - otherwise => py33 ST4201 .. 42??: - plugin in "User" package => py313 - disable_plugin_host_3.3 = True => py313 - .python-version present => py313 - otherwise => py33 ST42??+ - only py313
This commit satisfies required libraries after all packages have been installed, instead of resolving and installing each required library before a package is. Advantages: 1. not yet installed package source doesn't need to be scanned for required libraries or the plugin host it will run on. Reduces code duplication. 2. package and library installation/upgrade can be parallelized in a future version, without risk to install a library twice due to race conditions. 3. separation of concerns; low-level `install_package()` function just installs a package and `install_library()` just a library.
2343a35 to
701bd0d
Compare
Python 3.1x moves on to replace __file__ and __package__ entirely by __spec__. This commit ensures to keep up and avoid issues with former 2 being no longer maintained or even removed at some point in future.
05a57e2 to
f8a858a
Compare
This commit creates dedicated asset templates for value of "python_version" key to make sure PyPiClient downloads latest available package for each python version. The issue to solve is that pure python packages don't carry any information about supported python versions in their name. name-1.0.0-py3-any.whl maybe 3.8+ name-1.1.0-py3-any.whl maybe 3.13+
This commit explicitly sets `__name__` and `__package__` in plugin.py as those are heavily used despite probably no longer being initialized on python 3.13, if Package Control is loaded from .sublime-package.
1. ensure python 3.13 compatibility with regards to `__file__` vs. `__spec__` 2. ensure module produces same behavior on all available plugin_hosts 3. remove writing `__spec__` as it has no effect. Final value always contains information from original injector module. 4. as no sublime API is required, install injector module at import time so it is eventually available earlier. 5. ensure injector module is also re-installed in cases, the original one causes import errors in package_disabler module, auto-repair so to say.
Contributor
|
How is this distributed? I'm currently seeing errors about a non-existant python3.13 directory. |
Contributor
Author
|
This PR is already part of v4.2.2 PR #1713 adjusts the expected library folder name. All open PRs however require action by the original author and repo owner to be released via known update channels. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.