Commit 0c173437 authored by aclark's avatar aclark

Modernize "selecting-python" test to work w/2.6 and 2.5 instead of 2.4 and 2.3


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@118514 62d5b8a3-27da-0310-9561-8e5933582275
parent ae33e690
...@@ -16,10 +16,11 @@ from zope.testing import renormalizing ...@@ -16,10 +16,11 @@ from zope.testing import renormalizing
import zc.buildout.tests import zc.buildout.tests
import zc.buildout.testing import zc.buildout.testing
if sys.version_info[:2] == (2, 4):
other_version = "2.5" if sys.version_info[:2] == (2, 5):
other_version = "2.6"
else: else:
other_version = "2.4" other_version = "2.5"
__test__ = dict( __test__ = dict(
test_selecting_python_via_easy_install= test_selecting_python_via_easy_install=
......
Controlling which Python to use Controlling which Python to use
------------------------------- -------------------------------
The following assumes that you have Python 2.4 installed. The following assumes that you have Python 2.5 installed.
We can specify the python to use by specifying the name of a section We can specify the python to use by specifying the name of a section
to read the Python executable from. The default is the section to read the Python executable from. The default is the section
...@@ -11,21 +11,21 @@ We have a link server: ...@@ -11,21 +11,21 @@ We have a link server:
>>> print get(link_server), >>> print get(link_server),
<html><body> <html><body>
<a href="bigdemo-0.1-py2.4.egg">bigdemo-0.1-py2.4.egg</a><br> <a href="bigdemo-0.1-py2.5.egg">bigdemo-0.1-py2.5.egg</a><br>
<a href="demo-0.1-py2.4.egg">demo-0.1-py2.4.egg</a><br> <a href="demo-0.1-py2.5.egg">demo-0.1-py2.5.egg</a><br>
<a href="demo-0.2-py2.4.egg">demo-0.2-py2.4.egg</a><br> <a href="demo-0.2-py2.5.egg">demo-0.2-py2.5.egg</a><br>
<a href="demo-0.3-py2.4.egg">demo-0.3-py2.4.egg</a><br> <a href="demo-0.3-py2.5.egg">demo-0.3-py2.5.egg</a><br>
<a href="demo-0.4c1-py2.4.egg">demo-0.4c1-py2.4.egg</a><br> <a href="demo-0.4c1-py2.5.egg">demo-0.4c1-py2.5.egg</a><br>
<a href="demoneeded-1.0.zip">demoneeded-1.0.zip</a><br> <a href="demoneeded-1.0.zip">demoneeded-1.0.zip</a><br>
<a href="demoneeded-1.1.zip">demoneeded-1.1.zip</a><br> <a href="demoneeded-1.1.zip">demoneeded-1.1.zip</a><br>
<a href="demoneeded-1.2c1.zip">demoneeded-1.2c1.zip</a><br> <a href="demoneeded-1.2c1.zip">demoneeded-1.2c1.zip</a><br>
<a href="extdemo-1.4.zip">extdemo-1.4.zip</a><br> <a href="extdemo-1.4.zip">extdemo-1.4.zip</a><br>
<a href="index/">index/</a><br> <a href="index/">index/</a><br>
<a href="other-1.0-py2.4.egg">other-1.0-py2.4.egg</a><br> <a href="other-1.0-py2.5.egg">other-1.0-py2.5.egg</a><br>
</body></html> </body></html>
We have a sample buildout. Let's update its configuration file to We have a sample buildout. Let's update its configuration file to
install the demo package using Python 2.4. install the demo package using Python 2.5.
>>> write(sample_buildout, 'buildout.cfg', >>> write(sample_buildout, 'buildout.cfg',
... """ ... """
...@@ -34,14 +34,14 @@ install the demo package using Python 2.4. ...@@ -34,14 +34,14 @@ install the demo package using Python 2.4.
... eggs-directory = eggs ... eggs-directory = eggs
... index = http://www.python.org/pypi/ ... index = http://www.python.org/pypi/
... ...
... [python2.4] ... [python2.5]
... executable = %(python24)s ... executable = %(python24)s
... ...
... [demo] ... [demo]
... recipe = zc.recipe.egg ... recipe = zc.recipe.egg
... eggs = demo <0.3 ... eggs = demo <0.3
... find-links = %(server)s ... find-links = %(server)s
... python = python2.4 ... python = python2.5
... interpreter = py-demo ... interpreter = py-demo
... """ % dict(server=link_server, python24=other_executable)) ... """ % dict(server=link_server, python24=other_executable))
...@@ -59,15 +59,15 @@ Now, if we run the buildout: ...@@ -59,15 +59,15 @@ Now, if we run the buildout:
Generated script '/sample-buildout/bin/demo'. Generated script '/sample-buildout/bin/demo'.
Generated interpreter '/sample-buildout/bin/py-demo'. Generated interpreter '/sample-buildout/bin/py-demo'.
we'll get the Python 2.4 eggs for demo and demoneeded: we'll get the Python 2.5 eggs for demo and demoneeded:
>>> ls(sample_buildout, 'eggs') >>> ls(sample_buildout, 'eggs')
- demo-0.2-py2.4.egg - demo-0.2-py2.5.egg
- demoneeded-1.2c1-py2.4.egg - demoneeded-1.2c1-py2.5.egg
d setuptools-0.6-py2.5.egg d setuptools-0.6-py2.5.egg
- zc.buildout-1.0-py2.5.egg - zc.buildout-1.0-py2.5.egg
And the generated scripts invoke Python 2.4: And the generated scripts invoke Python 2.5:
>>> import sys >>> import sys
>>> if sys.platform == 'win32': >>> if sys.platform == 'win32':
...@@ -84,8 +84,8 @@ And the generated scripts invoke Python 2.4: ...@@ -84,8 +84,8 @@ And the generated scripts invoke Python 2.4:
<BLANKLINE> <BLANKLINE>
import sys import sys
sys.path[0:0] = [ sys.path[0:0] = [
'/sample-buildout/eggs/demo-0.2-py2.4.egg', '/sample-buildout/eggs/demo-0.2-py2.5.egg',
'/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg', '/sample-buildout/eggs/demoneeded-1.2c1-py2.5.egg',
] ]
<BLANKLINE> <BLANKLINE>
import eggrecipedemo import eggrecipedemo
...@@ -108,8 +108,8 @@ And the generated scripts invoke Python 2.4: ...@@ -108,8 +108,8 @@ And the generated scripts invoke Python 2.4:
import sys import sys
<BLANKLINE> <BLANKLINE>
sys.path[0:0] = [ sys.path[0:0] = [
'/sample-buildout/eggs/demo-0.2-py2.4.egg', '/sample-buildout/eggs/demo-0.2-py2.5.egg',
'/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg', '/sample-buildout/eggs/demoneeded-1.2c1-py2.5.egg',
] ]
<BLANKLINE> <BLANKLINE>
_interactive = True _interactive = True
......
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