Python auto updater from github -
i know if of had implemented autoupdate feature python app. idea download first 100-200 bytes (using requests?) github url, contanining version tag. ex.
#!/usr/bin/env python ####################### __author__ = '<a href="mailto:xxxx@gmail.com">xxx</a>' __program__ = 'theprogram' __package__ = '' __description__ = '''this program things''' __version__ = '0.0.0' ...
so if version tag greater 1 in local module, updater download whole file , replace it, , (either way) run it.
what best way this?
thanks!
you can use pip programmatically schedule updates modules in cron, won't needing request version because pip update when necessary.
pip install --upgrade yourpackage
or
pip install --upgrade git+https://github.com/youracc/yourepo.git
also, @riotburn pointed out, should using virtualenv isolate environment , may rollback previous 1 if necessary. in last scenario, may find virtualenv wrapper helpful.
Comments
Post a Comment