I want to include some kind of self-updating mechanism in the python package, and I do not want to cause the code to be updated before the script runs, since it is very slow, I'm looking for a smart mechanism.
Each time it is used, it can make an HTTP call, possibly for PyPi, and if it detects a new version, it will display a warning on STDERR.
Obviously, as part of this process, I would also like to cache the result of the last call, so the library will not check for updates more than once a day, say.
Is there something like this already implemented? Do you have an example that can be used to cache results from HTTP calls between different executions so that it does not impose significant delays?
sorin source
share