wbond / package_control

The Sublime Text package manager
https://packagecontrol.io
4.78k stars 814 forks source link

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

Closed rwols closed 1 year ago

rwols commented 3 years ago

The following situation is somewhat tragic:

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.

FichteFoll commented 3 years ago

Nothing that PC can do about this in particular, outside of getting dependencieslibraries ready for Python 3.8, which we already have project for: https://github.com/wbond/package_control/projects/1

rwols commented 3 years ago

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

randy3k commented 3 years ago

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
rwols commented 3 years ago

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

deathaxe commented 3 years ago

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.

rwols commented 3 years ago

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

deathaxe commented 3 years ago

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