eve-val/evelink

Implement update_checker

flexd opened this issue · 5 comments

https://github.com/bboe/update_checker

Basically just needs to do this in a suitable place (init.py?)

__version__ = '0.3.0' # This will need to be defined somewhere (or grabbed from package ?)
from update_checker import update_check
update_check(__name__, __version__)

This is what PRAW uses if you have used that, it will tell you if there is a newer version of the library available.

I figured this might be something that could be nice for evelink too? :-)

Made the issue instead of a pull-request because I was a bit unsure where it would be best to put this.

It seems like that package is broken, given that the URL it tries to talk to gives a "cannot connect" error. It'd also a dependency which itself introduces other dependencies (e.g. requests), and add an extra HTTP request (to this random HTTP service) for every instance that imports the module (especially for appengine clients, where caching wouldn't work due to lack of a local filesystem).

Furthermore, using print as an output mechanism for library informational messages is sub-par - on AppEngine it won't even appear, and in regular Python apps the end user may not want messages printed out (e.g. if they're building a command line utility that outputs specific information which might be piped to another command line tool).

I wouldn't be opposed to having some method that a user could explicitly call to do an update check, but I don't think it's really worth having an automatic check no matter what on-import.

Hm, I might have accidentally linked to the wrong package, even though it seems to be that specific package based on the package name+version number required by praw. And it still works for them, they do not make any changes as far as I can see.

I think the idea is good, but using some kind of other mechanic than print (like log) would be better, and also being able to toggle the check in a config/settings object.

And perhaps only do the check every X-thousand requests or something else clever.

I would at least appreciate knowing that there is a new version out automatically.

One way to do that would be to simply add a check_for_update() function of some sort that the user could call - then "toggling the check" would simply be a matter of whether you choose to call it or not.

@ayust Yeah I guess, just figured it would be nice. :-)

I suggest using something like https://www.versioneye.com or https://requires.io/ to check all dependencies of your project.