Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 10-10-2020, 08:23 AM   #1
t-8ch
Junior Member
t-8ch began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2013
Device: none
Systemwide installation of plugins / Discovery of installed plugins via pkg_resources

Hi,

I would like to develop a mechanism for Calibre to discover and use systemwide installed plugins in addition to builtin plugins and plugins loaded from the users settings.

This would allow users and Linux distributions to package third-party plugins the same way as the rest of the system, including custom distribution or pip package repositories.

My primary idea is to use the existing setuptools discovery mechanism for plugins: pkg_resource entrypoints.
This is the standard Python way, does not require any dependencies and should always work.
The only disadvantage I can see is that existing plugins probably don't have setuptools metadata. But that should be easy to add, first downstream by people packaging the plugins and later directly inside the plugins repository.

I am willing to implement this feature and see it through, but first I'd like to get feedback from the Calibre team whether this has a chance of being accepted.

Thanks
t-8ch is offline   Reply With Quote
Old 10-10-2020, 09:47 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,031
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Are there actual plugin authors that want this, or that are even interested in distributing their plugins via pip/linux distributions, or are willing to add the necessary metadata to their plugins?

As per https://calibre-ebook.com/dynamic/calibre-usage there are under 5% of calibre users on Linux, which is really the only platform where this would have even a chance of being used.

In order for me to consider this, there would need to be some demonstrated interest from plugin authors.
kovidgoyal is online now   Reply With Quote
Advert
Old 10-11-2020, 04:32 AM   #3
t-8ch
Junior Member
t-8ch began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2013
Device: none
My concrete usecase would be the DrDRM plugin.
(https://github.com/apprenticeharper/DeDRM_tools)

They are currently not part of the Calibre repository.
I'll ask them about their opinions.
t-8ch is offline   Reply With Quote
Old 10-11-2020, 06:28 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,031
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I highly doubt any linux distros would be willing to distribute that as it would violate the DMCA
kovidgoyal is online now   Reply With Quote
Old 10-13-2020, 12:27 AM   #5
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
I don't see any need for pkg_resources entry points, especially since calibre doesn't currently use setuptools or pkg_resources (though its dependencies might).

Furthermore, calibre is still not in site-packages (we would need to figure out a way to get upstream tinycss/odfpy to not be broken, and fork templite properly I suppose. css_selectors is custom code that could I suppose be turned into a generic library. polyglot can be phased out)

IMO it should be entirely sufficient to have calibre pick up plugins first, from e.g. /usr/share/calibre/plugins/

As for whether people would package plugins... I might update my current fanficfare CLI package to provide a calibre plugin too. Perhaps I'd package other plugins too, but not DeDRM software.
eschwartz is offline   Reply With Quote
Advert
Old 10-16-2020, 11:41 AM   #6
t-8ch
Junior Member
t-8ch began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2013
Device: none
@Eli
Loading a normal plugin ZIP from a central directory also sounds good. Especially as it does not need any change to plugins.
I intend to package that plugin for Arch in the AUR.
t-8ch is offline   Reply With Quote
Old 10-16-2020, 11:56 AM   #7
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,703
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by t-8ch View Post
@Eli
Loading a normal plugin ZIP from a central directory also sounds good. Especially as it does not need any change to plugins.
I intend to package that plugin for Arch in the AUR.
It's not worth the hassle for such a small return. Also, most repositories botch Calibre big time. So why would you risk the plugins being botched? Plugins work well as it is. You get updtaes when you should and you get a place to post about any problems or questions you may have.
JSWolf is offline   Reply With Quote
Old 10-16-2020, 12:29 PM   #8
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
I have no idea what JSWolf just said. But he's not permitted to have an opinion on what Linux distributions want to do, since he is not a linux user, linux users don't care about his negativity regarding linux, and no one cares how much better Windows 10 is, so he can go troll some other thread.

@t-8ch,

I'm primarily interested in plugins not needing changes, yes.

Though idk, it might be a performance boost to let them run extracted (since they're externally managed, a primary benefit of zipped plugins is not there). They could be byte-compiled and distributed by distro packages with better-than-zip compression.
Not sure if it's worth the added complexity, but... shower thoughts.
eschwartz is offline   Reply With Quote
Old 11-14-2020, 09:25 AM   #9
t-8ch
Junior Member
t-8ch began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2013
Device: none
The PR is here: https://github.com/kovidgoyal/calibre/pull/1284
t-8ch is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugins Help grumbleskin Plugins 7 11-25-2023 02:10 PM
Plugins BetterRed Sigil 20 09-24-2019 07:25 AM
What PlugIns Might I want/need? ShelaghDB Calibre 4 11-07-2015 07:16 PM
List of Installed Plugins stanking Development 7 10-04-2014 12:13 PM
Calibre 0.7.32 - Plugins not working after installation? hakan42 Plugins 2 12-05-2010 02:24 PM


All times are GMT -4. The time now is 03:05 AM.


MobileRead.com is a privately owned, operated and funded community.