On packaging Leo plugins

35 views
Skip to first unread message

Matt Wilkie

unread,
Mar 22, 2020, 12:53:04 PM3/22/20
to leo-editor

Working on Stand-alone distro for leoAst.py #1532 I've been semi-successful. The structure of https://github.com/leo-editor/ast-token-tools is approximately correct but I've run into difficulty cleanly importing the commit history. It's okay for the first import but attempting to merge or import subsequent development yields disconnected branches and/or duplicate commits with different IDs. There's probably a way to do this using git magic but I don't know it.


Pondering this has me wondering if it's this hard to maybe the approach is wrong. Maybe the long term way would be to make it a stand alone package for Leo too, ie. a dependency, and handle it the same as black or pyflakes or any of the other 3rd party requirements. This got me thinking about plugins. Maybe they too could independent packages, and maybe they'd even be happier that way. (I'm continually cautious/nervous whenever I make changes as most of Leo is way over my head.)

It's relatively easy to make a new python project and make it available to the world via `pip install {thing}`. What I don't know is how to integrate with something like Leo if a person wants to do more with it than `import leo-plugin-foo`. For instance: how would I access the plugin's "Leo-Docs-plugin-foo.leo" or "Leo-Settings-plugin-foo.leo"? (how does the plugin inform and register with Leo their location.)

Does anyone have thoughts on the topic? Know of other python projects with independent plugins we could learn from?

-matt

Edward K. Ream

unread,
Mar 22, 2020, 3:03:01 PM3/22/20
to leo-editor
On Sun, Mar 22, 2020 at 11:53 AM Matt Wilkie <map...@gmail.com> wrote:

> Does anyone have thoughts on the topic?

Imo, there is no need to make plugins separate projects. That would be lots of work for you, and others, and imo would offer no benefits to anyone. It usually makes no sense to have a Leo plugin packaged separately.

Edward

Matt Wilkie

unread,
Mar 24, 2020, 8:51:08 AM3/24/20
to leo-editor
> Does anyone have thoughts on the topic?

Imo, there is no need to make plugins separate projects. That would be lots of work for you, and others, and imo would offer no benefits to anyone. It usually makes no sense to have a Leo plugin packaged separately.

Thanks for your perspective. Re-reflecting on the question later I found myself wondering if I really was contemplating starting yet another endeavour when there are so many others withering on the vine from lack of attention! (like how to package ast-token-tools and keep revision currency)

-matt
Reply all
Reply to author
Forward
0 new messages