Commit 8f9e737a authored by jim's avatar jim

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.


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@72218 62d5b8a3-27da-0310-9561-8e5933582275
parent 52af614e
......@@ -20,6 +20,16 @@ priorities include:
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)
=====================
......
......@@ -7,7 +7,7 @@ def read(*rnames):
name = "zc.buildout"
setup(
name = name,
version = "1.0.0b18",
version = "1.0.0b19",
author = "Jim Fulton",
author_email = "jim@zope.com",
description = "System for managing development buildouts",
......
......@@ -56,7 +56,7 @@ def _get_version(executable):
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
......
......@@ -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?
## 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