Commit f752e932 authored by Jim Fulton's avatar Jim Fulton

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.
parent be183182
...@@ -20,6 +20,16 @@ priorities include: ...@@ -20,6 +20,16 @@ priorities include:
Change History 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) 1.0.0b18 (2007-01-22)
===================== =====================
......
...@@ -7,7 +7,7 @@ def read(*rnames): ...@@ -7,7 +7,7 @@ def read(*rnames):
name = "zc.buildout" name = "zc.buildout"
setup( setup(
name = name, name = name,
version = "1.0.0b18", version = "1.0.0b19",
author = "Jim Fulton", author = "Jim Fulton",
author_email = "jim@zope.com", author_email = "jim@zope.com",
description = "System for managing development buildouts", description = "System for managing development buildouts",
......
...@@ -56,7 +56,7 @@ def _get_version(executable): ...@@ -56,7 +56,7 @@ def _get_version(executable):
o.close() o.close()
pystring, version = version.split() pystring, version = version.split()
assert pystring == 'Python' assert pystring == 'Python'
version = re.match('(\d[.]\d)[.]\d$', version).group(1) version = re.match('(\d[.]\d)([.]\d)?$', version).group(1)
_versions[executable] = version _versions[executable] = version
return version return version
......
...@@ -315,6 +315,55 @@ Then try to install it again: ...@@ -315,6 +315,55 @@ Then try to install it again:
""" """
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? # Why?
## def error_for_undefined_install_parts(): ## def error_for_undefined_install_parts():
## """ ## """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment