[Checkins] SVN: zc.buildout/trunk/ Fixed bug:

Jim Fulton jim at zope.com
Wed Jan 24 18:11:12 EST 2007


Log message for revision 72218:
  Fixed bug:
  Explicitly specifying a Python executable failed if the output of
  running Python with the -V option included a 2-digit (rather than a
  3-digit) version number.
  

Changed:
  U   zc.buildout/trunk/CHANGES.txt
  U   zc.buildout/trunk/setup.py
  U   zc.buildout/trunk/src/zc/buildout/easy_install.py
  U   zc.buildout/trunk/src/zc/buildout/tests.py

-=-
Modified: zc.buildout/trunk/CHANGES.txt
===================================================================
--- zc.buildout/trunk/CHANGES.txt	2007-01-24 19:37:00 UTC (rev 72217)
+++ zc.buildout/trunk/CHANGES.txt	2007-01-24 23:11:02 UTC (rev 72218)
@@ -20,6 +20,16 @@
 Change History
 **************
 
+1.0.0b19 (2007-01-24)
+=====================
+
+Bugs Fixed
+----------
+
+- Explicitly specifying a Python executable failed if the output of
+  running Python with the -V option included a 2-digit (rather than a
+  3-digit) version number.
+
 1.0.0b18 (2007-01-22)
 =====================
 

Modified: zc.buildout/trunk/setup.py
===================================================================
--- zc.buildout/trunk/setup.py	2007-01-24 19:37:00 UTC (rev 72217)
+++ zc.buildout/trunk/setup.py	2007-01-24 23:11:02 UTC (rev 72218)
@@ -7,7 +7,7 @@
 name = "zc.buildout"
 setup(
     name = name,
-    version = "1.0.0b18",
+    version = "1.0.0b19",
     author = "Jim Fulton",
     author_email = "jim at zope.com",
     description = "System for managing development buildouts",

Modified: zc.buildout/trunk/src/zc/buildout/easy_install.py
===================================================================
--- zc.buildout/trunk/src/zc/buildout/easy_install.py	2007-01-24 19:37:00 UTC (rev 72217)
+++ zc.buildout/trunk/src/zc/buildout/easy_install.py	2007-01-24 23:11:02 UTC (rev 72218)
@@ -56,7 +56,7 @@
         o.close()
         pystring, version = version.split()
         assert pystring == 'Python'
-        version = re.match('(\d[.]\d)[.]\d$', version).group(1)
+        version = re.match('(\d[.]\d)([.]\d)?$', version).group(1)
         _versions[executable] = version
         return version
 

Modified: zc.buildout/trunk/src/zc/buildout/tests.py
===================================================================
--- zc.buildout/trunk/src/zc/buildout/tests.py	2007-01-24 19:37:00 UTC (rev 72217)
+++ zc.buildout/trunk/src/zc/buildout/tests.py	2007-01-24 23:11:02 UTC (rev 72218)
@@ -315,6 +315,55 @@
 
     """
 
+def make_sure__get_version_works_with_2_digit_python_versions():
+    """
+
+This is a test of an internal function used by higher-level machinery.
+
+We'll start by creating a faux 'python' that executable that prints a
+2-digit version. This is a bit of a pain to do portably. :(
+
+    >>> mkdir('demo')
+    >>> write('demo', 'setup.py',
+    ... '''
+    ... from setuptools import setup
+    ... setup(name='demo',
+    ...       entry_points = {'console_scripts': ['demo = demo:main']},
+    ...       )
+    ... ''')
+    >>> write('demo', 'demo.py',
+    ... '''
+    ... def main():
+    ...     print 'Python 2.5'
+    ... ''')
+
+    >>> write('buildout.cfg',
+    ... '''
+    ... [buildout]
+    ... develop = demo
+    ... parts = 
+    ... ''')
+
+    >>> print system(join('bin', 'buildout')),
+    buildout: Develop: /sample-buildout/demo
+
+    >>> import zc.buildout.easy_install
+    >>> ws = zc.buildout.easy_install.working_set(
+    ...    ['demo'], sys.executable, ['develop-eggs'])
+    >>> zc.buildout.easy_install.scripts(
+    ...    ['demo'], ws, sys.executable, 'bin')
+    ['bin/demo']
+
+    >>> print system(join('bin', 'demo')),
+    Python 2.5
+
+Now, finally, let's test _get_version:
+
+    >>> zc.buildout.easy_install._get_version(join('bin', 'demo'))
+    '2.5'
+
+    """
+
 # Why?
 ## def error_for_undefined_install_parts():
 ##     """



More information about the Checkins mailing list