Merge lp:~allenap/rabbitfixture/update-for-raring into lp:rabbitfixture

Proposed by Gavin Panella
Status: Merged
Merged at revision: 29
Proposed branch: lp:~allenap/rabbitfixture/update-for-raring
Merge into: lp:rabbitfixture
Diff against target: 178 lines (+34/-22)
2 files modified
bootstrap.py (+34/-17)
buildout.cfg (+0/-5)
To merge this branch: bzr merge lp:~allenap/rabbitfixture/update-for-raring
Reviewer Review Type Date Requested Status
Julian Edwards (community) Approve
Review via email: mp+158621@code.launchpad.net

Commit message

Get the development environment working in Raring Ringtail.

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) wrote :

The change to bootstrap.py is not my code; it's just a more recent bootstrap.py from upstream.

I removed the tags target in buildout.cfg because installing it was not working, a version dependency conflict or something. It's not very useful anyway, and I personally never used it.

Revision history for this message
Julian Edwards (julian-edwards) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bootstrap.py'
2--- bootstrap.py 2011-06-28 10:54:22 +0000
3+++ bootstrap.py 2013-04-12 14:02:26 +0000
4@@ -18,13 +18,13 @@
5 use the -c option to specify an alternate configuration file.
6 """
7
8-import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess
9+import os, shutil, sys, tempfile, urllib, urllib2, subprocess
10 from optparse import OptionParser
11
12 if sys.platform == 'win32':
13 def quote(c):
14 if ' ' in c:
15- return '"%s"' % c # work around spawn lamosity on windows
16+ return '"%s"' % c # work around spawn lamosity on windows
17 else:
18 return c
19 else:
20@@ -57,13 +57,13 @@
21 # out any namespace packages from site-packages that might have been
22 # loaded by .pth files.
23 clean_path = sys.path[:]
24-import site
25+import site # imported because of its side effects
26 sys.path[:] = clean_path
27 for k, v in sys.modules.items():
28 if k in ('setuptools', 'pkg_resources') or (
29 hasattr(v, '__path__') and
30- len(v.__path__)==1 and
31- not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))):
32+ len(v.__path__) == 1 and
33+ not os.path.exists(os.path.join(v.__path__[0], '__init__.py'))):
34 # This is a namespace package. Remove it.
35 sys.modules.pop(k)
36
37@@ -72,10 +72,11 @@
38 setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py'
39 distribute_source = 'http://python-distribute.org/distribute_setup.py'
40
41+
42 # parsing arguments
43 def normalize_to_url(option, opt_str, value, parser):
44 if value:
45- if '://' not in value: # It doesn't smell like a URL.
46+ if '://' not in value: # It doesn't smell like a URL.
47 value = 'file://%s' % (
48 urllib.pathname2url(
49 os.path.abspath(os.path.expanduser(value))),)
50@@ -110,7 +111,7 @@
51 help=("Specify a URL or file location for the setup file. "
52 "If you use Setuptools, this will default to " +
53 setuptools_source + "; if you use Distribute, this "
54- "will default to " + distribute_source +"."))
55+ "will default to " + distribute_source + "."))
56 parser.add_option("--download-base", action="callback", dest="download_base",
57 callback=normalize_to_url, nargs=1, type="string",
58 help=("Specify a URL or directory for downloading "
59@@ -135,10 +136,6 @@
60
61 options, args = parser.parse_args()
62
63-# if -c was provided, we push it back into args for buildout's main function
64-if options.config_file is not None:
65- args += ['-c', options.config_file]
66-
67 if options.eggs:
68 eggs_dir = os.path.abspath(os.path.expanduser(options.eggs))
69 else:
70@@ -151,12 +148,11 @@
71 options.setup_source = setuptools_source
72
73 if options.accept_buildout_test_releases:
74- args.append('buildout:accept-buildout-test-releases=true')
75-args.append('bootstrap')
76+ args.insert(0, 'buildout:accept-buildout-test-releases=true')
77
78 try:
79 import pkg_resources
80- import setuptools # A flag. Sometimes pkg_resources is installed alone.
81+ import setuptools # A flag. Sometimes pkg_resources is installed alone.
82 if not hasattr(pkg_resources, '_distribute'):
83 raise ImportError
84 except ImportError:
85@@ -169,6 +165,8 @@
86 setup_args['download_base'] = options.download_base
87 if options.use_distribute:
88 setup_args['no_fake'] = True
89+ if sys.version_info[:2] == (2, 4):
90+ setup_args['version'] = '0.6.32'
91 ez['use_setuptools'](**setup_args)
92 if 'pkg_resources' in sys.modules:
93 reload(sys.modules['pkg_resources'])
94@@ -191,6 +189,8 @@
95 find_links = options.download_base
96 if not find_links:
97 find_links = os.environ.get('bootstrap-testing-find-links')
98+if not find_links and options.accept_buildout_test_releases:
99+ find_links = 'http://downloads.buildout.org/'
100 if find_links:
101 cmd.extend(['-f', quote(find_links)])
102
103@@ -211,6 +211,7 @@
104 # Figure out the most recent final version of zc.buildout.
105 import setuptools.package_index
106 _final_parts = '*final-', '*final'
107+
108 def _final_version(parsed_version):
109 for part in parsed_version:
110 if (part[:1] == '*') and (part not in _final_parts):
111@@ -226,6 +227,8 @@
112 bestv = None
113 for dist in index[req.project_name]:
114 distv = dist.parsed_version
115+ if distv >= pkg_resources.parse_version('2dev'):
116+ continue
117 if _final_version(distv):
118 if bestv is None or distv > bestv:
119 best = [dist]
120@@ -235,14 +238,18 @@
121 if best:
122 best.sort()
123 version = best[-1].version
124+
125 if version:
126- requirement = '=='.join((requirement, version))
127+ requirement += '=='+version
128+else:
129+ requirement += '<2dev'
130+
131 cmd.append(requirement)
132
133 if is_jython:
134 import subprocess
135 exitcode = subprocess.Popen(cmd, env=env).wait()
136-else: # Windows prefers this, apparently; otherwise we would prefer subprocess
137+else: # Windows prefers this, apparently; otherwise we would prefer subprocess
138 exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env]))
139 if exitcode != 0:
140 sys.stdout.flush()
141@@ -255,6 +262,16 @@
142 ws.add_entry(eggs_dir)
143 ws.require(requirement)
144 import zc.buildout.buildout
145+
146+# If there isn't already a command in the args, add bootstrap
147+if not [a for a in args if '=' not in a]:
148+ args.append('bootstrap')
149+
150+
151+# if -c was provided, we push it back into args for buildout's main function
152+if options.config_file is not None:
153+ args[0:0] = ['-c', options.config_file]
154+
155 zc.buildout.buildout.main(args)
156-if not options.eggs: # clean up temporary egg directory
157+if not options.eggs: # clean up temporary egg directory
158 shutil.rmtree(eggs_dir)
159
160=== modified file 'buildout.cfg'
161--- buildout.cfg 2011-06-28 14:23:36 +0000
162+++ buildout.cfg 2013-04-12 14:02:26 +0000
163@@ -2,7 +2,6 @@
164 parts =
165 interpreter
166 test
167- tags
168 use-dependency-links = false
169 unzip = true
170 include-site-packages = false
171@@ -20,7 +19,3 @@
172 recipe = z3c.recipe.scripts
173 interpreter = py
174 eggs = rabbitfixture
175-
176-[tags]
177-recipe = z3c.recipe.tag:tags
178-eggs = rabbitfixture

Subscribers

People subscribed via source and target branches

to all changes: