[Distutils] Setuptools feature request: simplified version specification

Jim Fulton jim at zope.com
Fri Jul 6 20:09:34 CEST 2007

We (me and a bunch of my Zope friends) find that we'll often want  
version specifications of the form:

   project_name >=Vdev, <V+1dev  (e.g.  "foo >=1dev, <2dev")

We think this is so common that we'd like a short-hand way of  
spelling it.

I'll note that I'm not even sure I got the spelling above right. The  
intent is to request version 1, meaning any release of version 1.  I  
think that's what I spelled above, although I'm not sure.  If I got  
it wrong, maybe someone will correct me.  Aside from the verbosity of  
the spelling above, I think the difficulty in spelling it is a strike  
against it.  Note that a naive spelling: "foo >=1, <2" is wrong  
because it excludes pre-releases of 1 and includes pre-releases of 2.

I propose that a valid version that ends in a number and that isn't  
preceded by an operator be a valid version specifier and be  
interpreted as a range. So, assuming that I know how to spell the  
range, a specification of:

   project_name V  (e.g. "foo 1")

would be equivalent to:

   project_name >=Vdev, <V+1  (e.g. "foo >=1dev, <2dev")

This would work with multi-part versions, so "foo 1.2" would be  
equivalent to "foo >=1.2dev <1.3dev".

Note that this could be combined with other version specifiers.  For  
example, to require any version 1 or 2 of foo or versions 3.2 final  
or later:

   foo 1, 2, >=3.2

Also note that any version will do, so:

   foo 1.2a1

would be equivalent to:

   foo >=1.2a1dev <1.2a2dev

And note that versions that don't end in numbers wouldn't be valid  
version specifiers, so:

   foo 1a

would not be a valid specifier.



Jim Fulton			mailto:jim at zope.com		Python Powered!
CTO 				(540) 361-1714			http://www.python.org
Zope Corporation	http://www.zope.com		http://www.zope.org

More information about the Distutils-SIG mailing list