[Distutils] [buildout] specifying the required python version

Chris Withers chris at python.org
Fri Feb 15 19:23:18 CET 2013

On 28/01/2013 11:38, Jim Fulton wrote:
> I think so.  Python itself is not a distutils distribution.

...and isn't that a shame? :-(
Wouldn't it be great if Python itself and all the packages in the 
standard library all had their own version numbers so you could upgrade 
them independently and have them evolve separately to the core?

> Also, the implementation shouldn't simply test whether the version is
> in the version string.  It's too easy to get false matches.  The
> implementation should parse the version (maybe as simple as splitting
> on dots) and check it against sys.version_info.

Just to note that 'version in string' was a very careful choice as it 
lets you be as specific or general as you like.

- buildout doesn't work with Python 3.x, just put '2.' in the option
- want a very specific 3rd point release? put '3.3.1'
- use a different python distro and need that? (my original use case!) 
put '2.7.2 |EPD 7.2-2 (32-bit)'

sys.version_info doesn't cut it:

buzzkill:testfixtures chris$ python
Enthought Python Distribution -- www.enthought.com
Version: 7.2-2 (32-bit)

Python 2.7.2 |EPD 7.2-2 (32-bit)| (default, Sep  7 2011, 09:16:50)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "packages", "demo" or "enthought" for more information.
 >>> import sys
 >>> sys.version_info
sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)
 >>> sys.version
'2.7.2 |EPD 7.2-2 (32-bit)| (default, Sep  7 2011, 09:16:50) \n[GCC 
4.0.1 (Apple Inc. build 5493)]'



Simplistix - Content Management, Batch Processing & Python Consulting
             - http://www.simplistix.co.uk

More information about the Distutils-SIG mailing list