package_control icon indicating copy to clipboard operation
package_control copied to clipboard

A package using dependencies.json as well as a module from Default is broken in ST4

Open rwols opened this issue 4 years ago • 7 comments

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.

rwols avatar May 24 '21 21:05 rwols

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

FichteFoll avatar May 24 '21 22:05 FichteFoll

I'll see what I can do about https://github.com/wbond/package_control/issues/1517

rwols avatar May 24 '21 22:05 rwols

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 avatar May 28 '21 06:05 randy3k

@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!

rwols avatar May 28 '21 20:05 rwols

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 avatar May 29 '21 09:05 deathaxe

@deathaxe I'm not planning on using that hack, but I still think it's clever :)

rwols avatar May 30 '21 13:05 rwols

You might want to have a look how packa_control handles that, then. In injects itself into lib of both hosts.

deathaxe avatar May 30 '21 15:05 deathaxe