I heard a lot of good things about nbdev so I started using it for my new project: a library of plugins for pyannote.audio speaker diarization toolkit.
I know that nbdev supports creating console_scripts entry-points out of the box thanks to the console_scripts option in settings.ini.
But does it support creating (plugin-like) entry-points (like those introduced in this blog post)?
Based on the absence of answer, I understand that this is not supported.
So I went ahead and thought about a possible syntax for this new feature, using the entry points defined in the aforementioned blog post as an example.
It would rely on an additional [PLUGINS] section in settings.ini:
I can definitely do that. Just wanted to know whether it would make sense to contribute this upstream since you already have this kind of support for console_scripts.
I am not sure that it does, perhaps if you show me more of an example of what you are trying to do and why this should be part of the library it might become more concrete
Basically, this allows to build a library that adds features to another library.
The aforementionned blog post does a good job explaining this (probably better than I would).
For instance, Explosion’s Prodigy supports this kind of plugin: Installation & Setup · Prodigy · An annotation tool for AI, Machine Learning & NLP
You would write Prodigy recipes in a separate (MyAwesomeRecipes, made by nbdev) library defining prodigy_recipes entrypoints, and these recipes would automatically be detected by Prodigy:
Thanks for the suggestion @hbredin. Personally, I just edit setup.py when creating entry points – I find this works pretty well. I’m not sure adding something to settings.ini for this is a big win personally, since the setup.py version works fine.