package_control
package_control copied to clipboard
A package using dependencies.json as well as a module from Default is broken in ST4
The following situation is somewhat tragic:
- If a package uses only dependencies.json, then it will keep working in py33.
- If a package imports something from Default, but doesn't use dependencies.json, then it can easily fix this by adding a .python-version file.
However, the Default package is now running in py38. So if a package imports something from Default and it uses dependencies.json, then there is currently no way to fix this.
Example: https://github.com/rwols/CMakeBuilder/blob/master/plugin.py uses Default.exec and the tabulate dependency.
Nothing that PC can do about this in particular, outside of getting ~~dependencies~~libraries ready for Python 3.8, which we already have project for: https://github.com/wbond/package_control/projects/1
I'll see what I can do about https://github.com/wbond/package_control/issues/1517
What about finding and importing the Default module to python 3.3?
loader = sublime_plugin.multi_importer.find_module("Default")
mod = loader.load_module("Default")
sys.modules["Default"] = mod
import Default.exec
@randy3k that's clever, but won't work anymore once the Default package starts using e.g. f-strings. I don't expect the Default to start using py38 features any time soon though :) good idea!
With that comment you drive your whole request useless.
The way to go for plugins ported to python 3.8 is to get rid of "Default" dependencies and do their job on their own.
@deathaxe I'm not planning on using that hack, but I still think it's clever :)
You might want to have a look how packa_control handles that, then. In injects itself into lib of both hosts.