lilydjwg / nvchecker

New version checker for software releases
MIT License
439 stars 70 forks source link

RFE: Support external/custom version sources (plugins) #133

Closed jruzicka-nic closed 4 years ago

jruzicka-nic commented 4 years ago

After inspecting nvchecker source code I found no way to include custom version handlers without core code modification as they seem to be hardcoded into handlers_precedence list and loading is always done from nvchecker.source package.

Instead of forking/rewriting/reinventing the wheel, I'd prefer to extend nvchecker with a simple plugin system:

That way, users can:

I'm willing and able to implement this if upstream is interested - please do let me know and I'll start hacking. Otherwise I'll be forced to create a competing project :)

jruzicka-nic commented 4 years ago

@lilydjwg you seem to be the benevolent ruler of this project - please let me what you think.

If this goes well, I'd love to contribute more to nvchecker over time as I always need such tool in my packaging adventures and your implementation is quite nice πŸ‘Œ

lilydjwg commented 4 years ago

A rewrite is ongoing to address several issues e.g. #132. Alongside those changes, I'm planning to use Python's native namespace packages for plugins.

Please wait for a few days for a test version of 2.0 to come out. This will be a breaking-changes version and target Python 3.7+.

jruzicka-nic commented 4 years ago

Awesome, I'm looking forward to test that hot new stuff α••( ᐛ )α•—

lilydjwg commented 4 years ago

The new version (at branch nvchecker2) works now but only a small number of source modules are ported: https://github.com/lilydjwg/nvchecker/tree/nvchecker2/nvchecker_source. Two types of modules are supported, a simpler one for single-function cases and a class-based one for stuff like batch processing (see aur.py).

Documentation hasn't been updated yet.

jruzicka-nic commented 4 years ago

I briefly looked at nvchecker2 - it looks nice, I see you're not afraid to use latest python features :) But there are no docs or examples of howto use custom source yet (it's mentioned as TODO item in NEW file πŸ‘Œ) so I'm gonna wait for that before testing further.

Happy Hacking!

lilydjwg commented 4 years ago

The documentation is done!