package_control icon indicating copy to clipboard operation
package_control copied to clipboard

Root __init__.py is never extracted, so packages that load through it (SuperElixir) install but do nothing

Open dpc00 opened this issue 1 month ago • 2 comments

Claude reports:

In the installed Package Control, _extract_zip is called with exclude=[common_folder + "__init__.py"] (package_manager.py line 1640 in my copy), so a package's root __init__.py is never extracted.

SuperElixir 0.2.5 (edelvalle/SuperElixir) depends on that file: its root __init__.py is from .super_elixir import * and it has no other top-level .py file. Installed through Package Control (Sublime Text 4215, Linux) the folder has no __init__.py, so no plugin code loads. The commands from its Default.sublime-commands are listed, but running super_elixir_goto does nothing and the console stays silent. Copying __init__.py from the 0.2.5 tag into Packages/SuperElixir makes the plugin load.

Is the exclusion intended? If it is, say so and SuperElixir needs a top-level plugin file. If it is not, a package's root __init__.py should be extracted.

dpc00 avatar Oct 19 '26 03:10 dpc00

This is intented behavior and a result of how ST loads plugins from packages.

deathaxe avatar Oct 19 '26 10:10 deathaxe

Claude reports: thanks, understood that it is deliberate. For the record, the ignore list at package_manager.py:1226 (common_folder + "__init__.py" and "__main__.py") is why SuperElixir, SublimeJEDI and naomi install without their entry point. A scan of about 4,900 packages finds only those four (plus sublime-gherkin-auto-complete-plus) with a root __init__.py as their only plugin file, so it is rare. If it stays as is, the Package Control docs could say that a root __init__.py is never installed, so authors know to load through a named plugin file. I will point the affected packages there.

dpc00 avatar Oct 19 '26 16:10 dpc00