cinap_lenrekadd hg and python4bb9e2215 years agoHistory
41 lines · 2.1 KB · Text
RawDownload
This is versioncheck 1.0, a first stab at automatic checking of versions ofPython extension packages installed on your system. The basic idea is that each package contains a _checkversion.pysomewhere, probably at the root level of the package. In addition, eachpackage maintainer makes a file available on the net, through ftp orhttp, which contains the version number of the most recent distributionand some readable text explaining the differences with previousversions, where to download the package, etc. The checkversions.py script walks through the installed Python tree (orthrough a tree of choice), and runs each _checkversion.py script. Thesescripts retrieve the current-version file over the net, compares versionnumbers and tells the user about new versions of packages available. A boilerplate for the _checkversion.py file can be found here. Replacepackage name, version and the URL of the version-check file and put it inyour distribution. In stead of a single URL you can also specify a listof URLs. Each of these will be checked in order until one is available,this is handy for distributions that live in multiple places. Put theprimary distribution site (the most up-to-date site) before others.The script is executed with execfile(), not imported, and the currentdirectory is the checkversion directory, so be careful with globals,importing, etc. The version-check file consists of an rfc822-style header followed byplaintext. The only header field checked currently is'Current-Version:', which should contain te current version and ismatched against the string contained in the _checkversion.py script.The rest of the file is human-readable text and presented to the user ifthere is a version mismatch. It should contain at the very least a URLof either the current distribution or a webpage describing it. Pycheckversion.py is the module that does the actual checking of versions.It should be fine where it is, it is imported by checkversion before anythingelse is done, but if imports fail you may want to move it to somewherealong sys.path. 	Jack Jansen, CWI, 23-Dec-97.	<jack@cwi.nl>