E&S CVS Commit: setuptools - Added basic 'Require()' class that can check whether a requirement is

pje at eby-sarna.com pje at eby-sarna.com
Mon Mar 8 15:08:00 EST 2004


Module Name:	setuptools
Committed By:	pje
Date:		Mon Mar  8 20:07:25 UTC 2004

Modified Files:
	setuptools/setuptools/tests: __init__.py
Added Files:
	setuptools/setuptools: depends.py

Log Message:
Added basic 'Require()' class that can check whether a requirement is
installed in a particular location or set of locations, and up-to-date.
Smart defaults make most version checks trivial, e.g.:

    Require('Something','1.2','some.thing').is_current()

    Require('Other',None,'other.thing',attribute='someFunc').is_current()

    Require('Existentialism',None,'existenz').is_current()

The first line checks whether the 'some.thing' module defines a
'__version__' constant that compares >='1.2' (using smart version parsing
from 'distutils.version').  The second checks whether 'other.thing' defines
'someFunc'.  (This latter form ('requested_version=None') is used to do
version sniffing on modules that don't define a version attribute.)
The third format just checks for the existence of the named module.


To view diffs of this commit, you can use the following URL(s):
http://cvs.eby-sarna.com/setuptools/setuptools/depends.py?rev=1.1&content-type=text/vnd.viewcvs-markup
http://cvs.eby-sarna.com/setuptools/setuptools/tests/__init__.py.diff?r1=1.3&r2=1.4

To generate a diff of this commit:
cvs rdiff -r0 -r1.1 setuptools/setuptools/depends.py
cvs rdiff -r1.3 -r1.4 setuptools/setuptools/tests/__init__.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




More information about the source-changes mailing list