kupfer icon indicating copy to clipboard operation
kupfer copied to clipboard

Suggestion: Easier way to find/install plugins

Open hugosenari opened this issue 9 years ago • 9 comments

Define a method for plugin distribution. Create an interface based on this method. This will help spread new/third party plugins.

My solution uses python packages and PyPI as repository, so we can install plugin as any python package with pip.

Ie: pip install kupfer_plugin_marketplace (this plugin list PyPI packages that starts with kupfer_plugin and add action to install them)

The main hack at this is a custom setup.py that copy plugin file to userspace plugin directory.

The proper solution could have more integrated interface (maybe in preferences) and do things I don't know how to do (enable plugin after install, install in other thread...).

If we stay with PyPI/pip approach, there is also a cookiecutter that help with boring part of package creation.

hugosenari avatar Feb 12 '17 04:02 hugosenari

To discuss a new feature pointed by @bluss in #33

hugosenari avatar Feb 12 '17 04:02 hugosenari

It needs to be clean in some way to be included in kupfer, so not entangle itself with the user's own pip files. I don't know much about pip.

bluss avatar Feb 12 '17 13:02 bluss

One interesting feature is that Kupfer supports (*) importing plugins from .zip files (this is a common Python feature to support packages in .zip). That would enable installing plugins as single .zip files, even if they have a multifile package or included icons.

(*) This has now been tested after the port. Of course it needed one patch, https://github.com/kupferlauncher/kupfer/commit/a78bdc7dc1daed1a53dcb92d6e4e8d223492a2b9

bluss avatar Feb 12 '17 14:02 bluss

Update: install plugins using new thread hugosenari/Kupfer-Plugins@e88c4393ae594a768a45d2476f21da519cc05933

Pip download package and run package setup.py. And my packages setup.py just copy plugin_file.py to ~/.local/share/kupfer/plugins/ I don't think this will mess with user pip files.

hugosenari avatar Feb 22 '17 02:02 hugosenari

Oh you've updated it to Python 3, that's great. Does it work with new kupfer?

bluss avatar Feb 22 '17 10:02 bluss

Yes, it works. I tested with py3 and py2.

hugosenari avatar Feb 22 '17 14:02 hugosenari

I get this when installing marketplace with the setup.py file, which is installing a lot of junk (pip3 etc) that disrupts my install.

python3 setup.py install
running install
mkdir ~/.local/share/kupfer/plugins
Copy ~/src/Kupfer-Plugins/marketplace/marketplace.py to ~/.local/share/kupfer/plugins
Install dependency
Searching for pip
Best match: pip 8.1.2
Adding pip 8.1.2 to easy-install.pth file
Installing pip script to ~/.local/bin
Installing pip3 script to ~/.local/bin
Installing pip3.5 script to ~/.local/bin

Using ~/anaconda3/lib/python3.5/site-packages
Processing dependencies for pip
Finished processing dependencies for pip

bluss avatar Feb 22 '17 15:02 bluss

Your project is cool, it's along the lines of what Kupfer needs. I'll just give you my feedback and tell you what my approach would be.

It must be clean. No installing other files than the kupfer plugins. I'd using XDG_DATA_HOME with the ~/.local/share just a fallback, as is usual.

bluss avatar Feb 22 '17 15:02 bluss

Removed pip dependency: hugosenari/Kupfer-Plugins@334701e78a175e3687d27f150e48deb823689fe1 Use XDG_DATA_HOME: hugosenari/Kupfer-Plugins@d2b59a7c0df82a9ee6eaa4da97bda464b0c6b418

hugosenari avatar Feb 22 '17 19:02 hugosenari