Skip to content
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

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

Closed
rwols opened this issue May 24, 2021 · 7 comments

Comments

@rwols
Copy link
Contributor

rwols commented May 24, 2021

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.

@FichteFoll
Copy link
Collaborator

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
Copy link
Contributor Author

rwols commented May 24, 2021

I'll see what I can do about #1517

@randy3k
Copy link

randy3k commented May 28, 2021

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
Copy link
Contributor Author

rwols commented May 28, 2021

@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
Copy link
Collaborator

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
Copy link
Contributor Author

rwols commented May 30, 2021

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

@deathaxe
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants