I have a set of python scripts that will potentially be shared with 3rd party users. When they were being used strictly internally, we had issues with our staff using deprecated versions of the script. I incorporated the following version check that forces users to update their scripts when an update is released.
CURRENT_VERSION = "61022050"
def version_check():
try:
response = urllib2.urlopen(url)
html = response.read()
d = json.loads(html)
except Exception: #Version Check Failed.
if (d["version"] != CURRENT_VERSION):
#Version Check Outdated. Provide link to download.
#Version Check Passed.
This form of version check worked really well, but I was told that in some use cases, internet access will not be available, so this form of version check will automatically fail in those cases.
Are there other forms of version checking that don't require internet use that can ensure that users are using the latest release of the scripts? I've considered releasing new versions each week and hard coding a date into the code, but it is so easy to change the system date and get around that.