Merge lp:~jml/pkgme/buildout into lp:pkgme

Proposed by Jonathan Lange
Status: Merged
Approved by: Jonathan Lange
Approved revision: 137
Merged at revision: 126
Proposed branch: lp:~jml/pkgme/buildout
Merge into: lp:pkgme
Diff against target: 847 lines (+552/-66)
11 files modified
.bzrignore (+6/-0)
.testr.conf (+1/-1)
Makefile (+18/-0)
README.txt (+29/-22)
bootstrap.py (+262/-0)
buildout.cfg (+36/-0)
buildout.mk (+80/-0)
distribute_setup.py (+74/-36)
sphinx.mk (+3/-3)
tarmac_tests.sh (+7/-4)
versions.cfg (+36/-0)
To merge this branch: bzr merge lp:~jml/pkgme/buildout
Reviewer Review Type Date Requested Status
Jonathan Lange Approve
Review via email: mp+117924@code.launchpad.net

Commit message

Convert pkgme to buildout. (james_w)

Description of the change

Testing things.

To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) wrote :

Cheating.

review: Approve
Revision history for this message
ISD Branch Mangler (isd-branches-mangler) wrote :
Download full text (18.6 KiB)

The attempt to merge lp:~jml/pkgme/buildout into lp:pkgme failed. Below is the output from the failed tests.

[ -d ../download-cache ] || bzr checkout lp:ca-download-cache ../download-cache
ln -s ../download-cache download-cache
python2.7 bootstrap.py --distribute --setup-source distribute_setup.py \
    --download-base=download-cache/dist --eggs=eggs \
    --version 1.5.1
touch --no-create bin/buildout
./bin/py -m testtools.run pkgme.tests.test_suite
Tests running...
======================================================================
ERROR: pkgme.tests.test_backend.ExternalHelpersBackendTests.test_want_script_with_missing_reason
----------------------------------------------------------------------
Traceback (most recent call last):
  File "pkgme/tests/test_backend.py", line 129, in test_want_script_with_missing_reason
    self.assertEqual((10, None), backend.want(tempdir.path))
  File "pkgme/backend.py", line 205, in want
    return self._parse_want_output(out)
  File "pkgme/backend.py", line 168, in _parse_want_output
    "returned invalid score", str(result))
WantError: Backend pkgme.tests.test_backend.ExternalHelpersBackendTests.test_want_script_with_missing_reason-1 (/tmp/pkgme-tests-jUGbDV) returned invalid score from 'want' script: '\'import site\' failed; use -v for traceback\n{"score": 10}'
======================================================================
ERROR: pkgme.tests.test_backend.ExternalHelpersBackendTests.test_want_script_with_reason
----------------------------------------------------------------------
Traceback (most recent call last):
  File "pkgme/tests/test_backend.py", line 86, in test_want_script_with_reason
    self.assertEqual((10, reason), backend.want(tempdir.path))
  File "pkgme/backend.py", line 205, in want
    return self._parse_want_output(out)
  File "pkgme/backend.py", line 168, in _parse_want_output
    "returned invalid score", str(result))
WantError: Backend pkgme.tests.test_backend.ExternalHelpersBackendTests.test_want_script_with_reason-2 (/tmp/pkgme-tests-DfjfIv) returned invalid score from 'want' script: '\'import site\' failed; use -v for traceback\n{"reason": "pkgme.tests.test_backend.ExternalHelpersBackendTests.test_want_script_with_reason-1", "score": 10}'
======================================================================
ERROR: pkgme.tests.test_script.ScriptTests.test_builds_source_package
----------------------------------------------------------------------
Traceback (most recent call last):
  File "pkgme/tests/test_script.py", line 74, in test_builds_source_package
    self.run_script(tempdir.abspath('foo'))
  File "pkgme/tests/test_script.py", line 50, in run_script
    ep(argv=argv, target_dir=cwd, interactive=False)
  File "pkgme/bin/main.py", line 131, in main
    write_packaging(target_dir, distribution=options.distro)
  File "pkgme/__init__.py", line 39, in write_packaging
    info = get_info_for(path, allowed_backend_names=allowed_backend_names)
  File "pkgme/backend.py", line 82, in get_info_for
    return selector.get_info(path)
  File "pkgme/backend.py", line 344, in get_info
    eligble = self.get_eligible_backends(path)
  File "pkgme/backend.py", line 328, in get_elig...

Revision history for this message
ISD Branch Mangler (isd-branches-mangler) wrote :
Download full text (12.2 KiB)

The attempt to merge lp:~jml/pkgme/buildout into lp:pkgme failed. Below is the output from the failed tests.

[ -d ../download-cache ] || bzr checkout lp:ca-download-cache ../download-cache
ln -s ../download-cache download-cache
./bin/py -m testtools.run pkgme.tests.test_suite
Tests running...
======================================================================
ERROR: pkgme.tests.test_backend.ExternalHelpersBackendTests.test_want_script_with_missing_reason
----------------------------------------------------------------------
Traceback (most recent call last):
  File "pkgme/tests/test_backend.py", line 129, in test_want_script_with_missing_reason
    self.assertEqual((10, None), backend.want(tempdir.path))
  File "pkgme/backend.py", line 205, in want
    return self._parse_want_output(out)
  File "pkgme/backend.py", line 168, in _parse_want_output
    "returned invalid score", str(result))
WantError: Backend pkgme.tests.test_backend.ExternalHelpersBackendTests.test_want_script_with_missing_reason-1 (/tmp/pkgme-tests-0yMH2h) returned invalid score from 'want' script: '\'import site\' failed; use -v for traceback\n{"score": 10}'
======================================================================
ERROR: pkgme.tests.test_backend.ExternalHelpersBackendTests.test_want_script_with_reason
----------------------------------------------------------------------
Traceback (most recent call last):
  File "pkgme/tests/test_backend.py", line 86, in test_want_script_with_reason
    self.assertEqual((10, reason), backend.want(tempdir.path))
  File "pkgme/backend.py", line 205, in want
    return self._parse_want_output(out)
  File "pkgme/backend.py", line 168, in _parse_want_output
    "returned invalid score", str(result))
WantError: Backend pkgme.tests.test_backend.ExternalHelpersBackendTests.test_want_script_with_reason-2 (/tmp/pkgme-tests-5TA4Ln) returned invalid score from 'want' script: '\'import site\' failed; use -v for traceback\n{"reason": "pkgme.tests.test_backend.ExternalHelpersBackendTests.test_want_script_with_reason-1", "score": 10}'
======================================================================
ERROR: pkgme.tests.test_script.ScriptTests.test_builds_source_package
----------------------------------------------------------------------
Traceback (most recent call last):
  File "pkgme/tests/test_script.py", line 74, in test_builds_source_package
    self.run_script(tempdir.abspath('foo'))
  File "pkgme/tests/test_script.py", line 50, in run_script
    ep(argv=argv, target_dir=cwd, interactive=False)
  File "pkgme/bin/main.py", line 131, in main
    write_packaging(target_dir, distribution=options.distro)
  File "pkgme/__init__.py", line 39, in write_packaging
    info = get_info_for(path, allowed_backend_names=allowed_backend_names)
  File "pkgme/backend.py", line 82, in get_info_for
    return selector.get_info(path)
  File "pkgme/backend.py", line 344, in get_info
    eligble = self.get_eligible_backends(path)
  File "pkgme/backend.py", line 328, in get_eligible_backends
    score, reason = backend.want(path)
  File "pkgme/backend.py", line 205, in want
    return self._parse_want_output(out)
  File "pkgme/backend.py", line 168, in ...

lp:~jml/pkgme/buildout updated
134. By Jonathan Lange

Get a traceback, hopefully

135. By Jonathan Lange

What happens if we don't specify which Python?

136. By Jonathan Lange

Go back to using env.

137. By Jonathan Lange

Require argparse, since Jenkins runs tests on Python 2.6

Revision history for this message
Jonathan Lange (jml) wrote :

Require argparse, float the Python version.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2011-11-16 10:31:43 +0000
+++ .bzrignore 2012-08-02 16:24:39 +0000
@@ -6,3 +6,9 @@
6fixtures-0.3.5-py2.6.egg6fixtures-0.3.5-py2.6.egg
7bzr-orphans7bzr-orphans
8virtualenv8virtualenv
9.installed.cfg
10./bin
11develop-eggs
12download-cache
13eggs
14parts
915
=== modified file '.testr.conf'
--- .testr.conf 2011-07-27 15:44:08 +0000
+++ .testr.conf 2012-08-02 16:24:39 +0000
@@ -1,3 +1,3 @@
1[DEFAULT]1[DEFAULT]
2test_command=PYTHONPATH=`pwd` python -m subunit.run $IDLIST2test_command=./bin/py -m subunit.run $IDLIST
3test_id_list_default=pkgme.tests.test_suite3test_id_list_default=pkgme.tests.test_suite
44
=== added file 'Makefile'
--- Makefile 1970-01-01 00:00:00 +0000
+++ Makefile 2012-08-02 16:24:39 +0000
@@ -0,0 +1,18 @@
1# Copyright (C) 2012 Canonical Ltd.
2#
3# This program is free software: you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation, version 3 of the License.
6#
7# This program is distributed in the hope that it will be useful,
8# but WITHOUT ANY WARRANTY; without even the implied warranty of
9# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10# GNU General Public License for more details.
11#
12# You should have received a copy of the GNU General Public License
13# along with this program. If not, see <http://www.gnu.org/licenses/>.
14
15include buildout.mk
16include sphinx.mk
17
18TEST_COMMAND=$(PY) -m testtools.run pkgme.tests.test_suite
019
=== modified file 'README.txt'
--- README.txt 2011-12-08 15:34:02 +0000
+++ README.txt 2012-08-02 16:24:39 +0000
@@ -34,16 +34,34 @@
34Developers34Developers
35==========35==========
3636
37Right now, the best way to hack on ``pkgme`` is in a virtualenv_. This allows37To get a development environment set up (using ``buildout``) run::
38you to hack on ``pkgme`` in a clean environment, without touching or changing38
39your system Python. You will need access to the internet in order to install39 $ make bootstrap
40``pkgme`` into your virtualenv. On Debian/Ubuntu, make sure you have the40
41`python-virtualenv` package installed, then do the following::41You can then run the tests with
4242
43 % virtualenv /arbitrary/path43 $ make check
44 % source /arbitrary/path/bin/activate44
45 % python setup.py develop45The bootstrap will fail if you have a system-wide install of buildout that
46 <hack>46is the same version as the one in use by this project. (You will see
47``DistributionNotFound: zc.buildout==<version>``). If you encounter
48that then you can either remove the site-wide install, or use a virtualenv
49to run the bootstrap step.
50
51You can get a shell to try code interactively by running ``./bin/py``.
52
53Buildout uses two directories as caches that can be shared between branches.
54The first is the ``download-cache`` directory. This contains all of the
55distributions of the Python dependencies. You can get this from
56``lp:ca-download-cache``, but the Makefile will grab it for you.
57
58The other directory is the ``eggs`` directory that holds built versions
59of the dependencies.
60
61The default for both of these is to symlink them from the parent directory,
62but if you wish to put them somewhere else you can set the locations with
63the ``CA_DOWNLOAD_CACHE_DIR`` and ``CA_EGGS_DIR`` environment variables.
64
4765
48If you want to override the default location of the backends, set the66If you want to override the default location of the backends, set the
49environment variable ``$PKGME_BACKEND_PATHS``. This is a colon-separated list67environment variable ``$PKGME_BACKEND_PATHS``. This is a colon-separated list
@@ -51,18 +69,7 @@
5169
52 % export PKGME_BACKEND_PATHS=/pkgme/foo-backends:/pkgme/bar-backends70 % export PKGME_BACKEND_PATHS=/pkgme/foo-backends:/pkgme/bar-backends
53 % cd my-about-to-be-packaged-code71 % cd my-about-to-be-packaged-code
54 % pkgme72 % ~/path/to/branch/bin/pkgme
55
56When you're done, just run the ``deactivate`` command and blow away
57`/arbitrary/path`.
58
59
60Testing
61-------
62
63While in your virtualenv, you can run the full test suite like so::
64
65 % python setup.py test
6673
6774
68Building the documentation75Building the documentation
6976
=== added file 'bootstrap.py'
--- bootstrap.py 1970-01-01 00:00:00 +0000
+++ bootstrap.py 2012-08-02 16:24:39 +0000
@@ -0,0 +1,262 @@
1##############################################################################
2#
3# Copyright (c) 2006 Zope Foundation and Contributors.
4# All Rights Reserved.
5#
6# This software is subject to the provisions of the Zope Public License,
7# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
8# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11# FOR A PARTICULAR PURPOSE.
12#
13##############################################################################
14"""Bootstrap a buildout-based project
15
16Simply run this script in a directory containing a buildout.cfg.
17The script accepts buildout command-line options, so you can
18use the -c option to specify an alternate configuration file.
19"""
20
21import os, shutil, sys, tempfile, urllib, urllib2, subprocess
22from optparse import OptionParser
23
24if sys.platform == 'win32':
25 def quote(c):
26 if ' ' in c:
27 return '"%s"' % c # work around spawn lamosity on windows
28 else:
29 return c
30else:
31 quote = str
32
33# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments.
34stdout, stderr = subprocess.Popen(
35 [sys.executable, '-Sc',
36 'try:\n'
37 ' import ConfigParser\n'
38 'except ImportError:\n'
39 ' print 1\n'
40 'else:\n'
41 ' print 0\n'],
42 stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
43has_broken_dash_S = bool(int(stdout.strip()))
44
45# In order to be more robust in the face of system Pythons, we want to
46# run without site-packages loaded. This is somewhat tricky, in
47# particular because Python 2.6's distutils imports site, so starting
48# with the -S flag is not sufficient. However, we'll start with that:
49if not has_broken_dash_S and 'site' in sys.modules:
50 # We will restart with python -S.
51 args = sys.argv[:]
52 args[0:0] = [sys.executable, '-S']
53 args = map(quote, args)
54 os.execv(sys.executable, args)
55# Now we are running with -S. We'll get the clean sys.path, import site
56# because distutils will do it later, and then reset the path and clean
57# out any namespace packages from site-packages that might have been
58# loaded by .pth files.
59clean_path = sys.path[:]
60import site # imported because of its side effects
61sys.path[:] = clean_path
62for k, v in sys.modules.items():
63 if k in ('setuptools', 'pkg_resources') or (
64 hasattr(v, '__path__') and
65 len(v.__path__) == 1 and
66 not os.path.exists(os.path.join(v.__path__[0], '__init__.py'))):
67 # This is a namespace package. Remove it.
68 sys.modules.pop(k)
69
70is_jython = sys.platform.startswith('java')
71
72setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py'
73distribute_source = 'http://python-distribute.org/distribute_setup.py'
74
75
76# parsing arguments
77def normalize_to_url(option, opt_str, value, parser):
78 if value:
79 if '://' not in value: # It doesn't smell like a URL.
80 value = 'file://%s' % (
81 urllib.pathname2url(
82 os.path.abspath(os.path.expanduser(value))),)
83 if opt_str == '--download-base' and not value.endswith('/'):
84 # Download base needs a trailing slash to make the world happy.
85 value += '/'
86 else:
87 value = None
88 name = opt_str[2:].replace('-', '_')
89 setattr(parser.values, name, value)
90
91usage = '''\
92[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options]
93
94Bootstraps a buildout-based project.
95
96Simply run this script in a directory containing a buildout.cfg, using the
97Python that you want bin/buildout to use.
98
99Note that by using --setup-source and --download-base to point to
100local resources, you can keep this script from going over the network.
101'''
102
103parser = OptionParser(usage=usage)
104parser.add_option("-v", "--version", dest="version",
105 help="use a specific zc.buildout version")
106parser.add_option("-d", "--distribute",
107 action="store_true", dest="use_distribute", default=False,
108 help="Use Distribute rather than Setuptools.")
109parser.add_option("--setup-source", action="callback", dest="setup_source",
110 callback=normalize_to_url, nargs=1, type="string",
111 help=("Specify a URL or file location for the setup file. "
112 "If you use Setuptools, this will default to " +
113 setuptools_source + "; if you use Distribute, this "
114 "will default to " + distribute_source + "."))
115parser.add_option("--download-base", action="callback", dest="download_base",
116 callback=normalize_to_url, nargs=1, type="string",
117 help=("Specify a URL or directory for downloading "
118 "zc.buildout and either Setuptools or Distribute. "
119 "Defaults to PyPI."))
120parser.add_option("--eggs",
121 help=("Specify a directory for storing eggs. Defaults to "
122 "a temporary directory that is deleted when the "
123 "bootstrap script completes."))
124parser.add_option("-t", "--accept-buildout-test-releases",
125 dest='accept_buildout_test_releases',
126 action="store_true", default=False,
127 help=("Normally, if you do not specify a --version, the "
128 "bootstrap script and buildout gets the newest "
129 "*final* versions of zc.buildout and its recipes and "
130 "extensions for you. If you use this flag, "
131 "bootstrap and buildout will get the newest releases "
132 "even if they are alphas or betas."))
133parser.add_option("-c", None, action="store", dest="config_file",
134 help=("Specify the path to the buildout configuration "
135 "file to be used."))
136
137options, args = parser.parse_args()
138
139# if -c was provided, we push it back into args for buildout's main function
140if options.config_file is not None:
141 args += ['-c', options.config_file]
142
143if options.eggs:
144 eggs_dir = os.path.abspath(os.path.expanduser(options.eggs))
145else:
146 eggs_dir = tempfile.mkdtemp()
147
148if options.setup_source is None:
149 if options.use_distribute:
150 options.setup_source = distribute_source
151 else:
152 options.setup_source = setuptools_source
153
154if options.accept_buildout_test_releases:
155 args.append('buildout:accept-buildout-test-releases=true')
156args.append('bootstrap')
157
158try:
159 import pkg_resources
160 import setuptools # A flag. Sometimes pkg_resources is installed alone.
161 if not hasattr(pkg_resources, '_distribute'):
162 raise ImportError
163except ImportError:
164 ez_code = urllib2.urlopen(
165 options.setup_source).read().replace('\r\n', '\n')
166 ez = {}
167 exec ez_code in ez
168 setup_args = dict(to_dir=eggs_dir, download_delay=0)
169 if options.download_base:
170 setup_args['download_base'] = options.download_base
171 if options.use_distribute:
172 setup_args['no_fake'] = True
173 ez['use_setuptools'](**setup_args)
174 if 'pkg_resources' in sys.modules:
175 reload(sys.modules['pkg_resources'])
176 import pkg_resources
177 # This does not (always?) update the default working set. We will
178 # do it.
179 for path in sys.path:
180 if path not in pkg_resources.working_set.entries:
181 pkg_resources.working_set.add_entry(path)
182
183cmd = [quote(sys.executable),
184 '-c',
185 quote('from setuptools.command.easy_install import main; main()'),
186 '-mqNxd',
187 quote(eggs_dir)]
188
189if not has_broken_dash_S:
190 cmd.insert(1, '-S')
191
192find_links = options.download_base
193if not find_links:
194 find_links = os.environ.get('bootstrap-testing-find-links')
195if find_links:
196 cmd.extend(['-f', quote(find_links)])
197
198if options.use_distribute:
199 setup_requirement = 'distribute'
200else:
201 setup_requirement = 'setuptools'
202ws = pkg_resources.working_set
203setup_requirement_path = ws.find(
204 pkg_resources.Requirement.parse(setup_requirement)).location
205env = dict(
206 os.environ,
207 PYTHONPATH=setup_requirement_path)
208
209requirement = 'zc.buildout'
210version = options.version
211if version is None and not options.accept_buildout_test_releases:
212 # Figure out the most recent final version of zc.buildout.
213 import setuptools.package_index
214 _final_parts = '*final-', '*final'
215
216 def _final_version(parsed_version):
217 for part in parsed_version:
218 if (part[:1] == '*') and (part not in _final_parts):
219 return False
220 return True
221 index = setuptools.package_index.PackageIndex(
222 search_path=[setup_requirement_path])
223 if find_links:
224 index.add_find_links((find_links,))
225 req = pkg_resources.Requirement.parse(requirement)
226 if index.obtain(req) is not None:
227 best = []
228 bestv = None
229 for dist in index[req.project_name]:
230 distv = dist.parsed_version
231 if _final_version(distv):
232 if bestv is None or distv > bestv:
233 best = [dist]
234 bestv = distv
235 elif distv == bestv:
236 best.append(dist)
237 if best:
238 best.sort()
239 version = best[-1].version
240if version:
241 requirement = '=='.join((requirement, version))
242cmd.append(requirement)
243
244if is_jython:
245 import subprocess
246 exitcode = subprocess.Popen(cmd, env=env).wait()
247else: # Windows prefers this, apparently; otherwise we would prefer subprocess
248 exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env]))
249if exitcode != 0:
250 sys.stdout.flush()
251 sys.stderr.flush()
252 print ("An error occurred when trying to install zc.buildout. "
253 "Look above this message for any errors that "
254 "were output by easy_install.")
255 sys.exit(exitcode)
256
257ws.add_entry(eggs_dir)
258ws.require(requirement)
259import zc.buildout.buildout
260zc.buildout.buildout.main(args)
261if not options.eggs: # clean up temporary egg directory
262 shutil.rmtree(eggs_dir)
0263
=== added file 'buildout.cfg'
--- buildout.cfg 1970-01-01 00:00:00 +0000
+++ buildout.cfg 2012-08-02 16:24:39 +0000
@@ -0,0 +1,36 @@
1# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4[buildout]
5parts =
6 scripts
7unzip = true
8eggs-directory = eggs
9download-cache = download-cache
10relative-paths = true
11
12# Disable this option temporarily if you want buildout to find software
13# dependencies *other* than those in our download-cache. Once you have the
14# desired software, reenable this option (and check in the new software to
15# lp:ca-dependencies if this is going to be reviewed/merged/deployed.)
16install-from-cache = true
17
18# This also will need to be temporarily disabled or changed for package
19# upgrades. Newly-added packages should also add their desired version number
20# to versions.cfg.
21extends = versions.cfg
22
23allow-picked-versions = false
24
25prefer-final = true
26
27develop = .
28
29[scripts]
30recipe = z3c.recipe.scripts
31# Test dependencies get added here
32# python-subunit is needed for those that use testr
33eggs = pkgme
34 python-subunit
35include-site-packages = false
36interpreter = py
037
=== added file 'buildout.mk'
--- buildout.mk 1970-01-01 00:00:00 +0000
+++ buildout.mk 2012-08-02 16:24:39 +0000
@@ -0,0 +1,80 @@
1# Copyright (C) 2012 Canonical Ltd.
2#
3# This program is free software: you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation, version 3 of the License.
6#
7# This program is distributed in the hope that it will be useful,
8# but WITHOUT ANY WARRANTY; without even the implied warranty of
9# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10# GNU General Public License for more details.
11#
12# You should have received a copy of the GNU General Public License
13# along with this program. If not, see <http://www.gnu.org/licenses/>.
14
15EXTERNAL_PY?=python
16PY=./bin/py
17
18EXTERNAL_BUILDOUT?=$(EXTERNAL_PY) bootstrap.py
19BUILDOUT=./bin/buildout
20
21CA_EGGS_DIR?=../eggs
22CA_DOWNLOAD_CACHE_DIR?=../download-cache
23
24clean:
25 $(RM) -r bin
26 $(RM) -r develop-eggs
27ifeq ($(CA_EGGS_DIR),eggs)
28 $(RM) -r eggs
29else
30 $(RM) eggs
31endif
32ifeq ($(CA_DOWNLOAD_CACHE_DIR),download-cache)
33 $(RM) -r download-cache
34else
35 $(RM) download-cache
36endif
37 $(RM) -r parts
38 $(RM) -r .installed.cfg
39
40eggs:
41ifeq ($(CA_EGGS_DIR),$@)
42 mkdir $@
43else
44 [ -d $(CA_EGGS_DIR) ] || mkdir $(CA_EGGS_DIR)
45 ln -s $(CA_EGGS_DIR) $@
46endif
47
48download-cache:
49ifeq ($(CA_DOWNLOAD_CACHE_DIR),$@)
50 bzr checkout lp:ca-download-cache $@
51else
52 [ -d $(CA_DOWNLOAD_CACHE_DIR) ] || bzr checkout lp:ca-download-cache $(CA_DOWNLOAD_CACHE_DIR)
53 ln -s $(CA_DOWNLOAD_CACHE_DIR) $@
54endif
55
56$(BUILDOUT): bootstrap.py distribute_setup.py eggs download-cache
57 $(EXTERNAL_BUILDOUT) --distribute --setup-source distribute_setup.py \
58 --download-base=download-cache/dist --eggs=eggs \
59 --version 1.5.1
60 touch --no-create $@
61
62$(PY): $(BUILDOUT)
63 $(BUILDOUT)
64 touch --no-create $@
65
66bootstrap: clean $(PY)
67
68test: $(PY)
69 $(TEST_COMMAND)
70
71check: test
72
73# Can be used to update the dependencies when you change something
74# in versions.cfg.
75update-deps: $(BUILDOUT)
76 $(BUILDOUT) buildout:install-from-cache=false
77
78
79.PHONY: bootstrap test check clean fetch-deps
80.DEFAULT_GOAL := $(PY)
081
=== modified file 'distribute_setup.py'
--- distribute_setup.py 2010-11-10 22:19:38 +0000
+++ distribute_setup.py 2012-08-02 16:24:39 +0000
@@ -46,7 +46,7 @@
46 args = [quote(arg) for arg in args]46 args = [quote(arg) for arg in args]
47 return os.spawnl(os.P_WAIT, sys.executable, *args) == 047 return os.spawnl(os.P_WAIT, sys.executable, *args) == 0
4848
49DEFAULT_VERSION = "0.6.10"49DEFAULT_VERSION = "0.6.28"
50DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"50DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"
51SETUPTOOLS_FAKED_VERSION = "0.6c11"51SETUPTOOLS_FAKED_VERSION = "0.6c11"
5252
@@ -63,7 +63,7 @@
63""" % SETUPTOOLS_FAKED_VERSION63""" % SETUPTOOLS_FAKED_VERSION
6464
6565
66def _install(tarball):66def _install(tarball, install_args=()):
67 # extracting the tarball67 # extracting the tarball
68 tmpdir = tempfile.mkdtemp()68 tmpdir = tempfile.mkdtemp()
69 log.warn('Extracting in %s', tmpdir)69 log.warn('Extracting in %s', tmpdir)
@@ -81,7 +81,7 @@
8181
82 # installing82 # installing
83 log.warn('Installing Distribute')83 log.warn('Installing Distribute')
84 if not _python_cmd('setup.py', 'install'):84 if not _python_cmd('setup.py', 'install', *install_args):
85 log.warn('Something went wrong during the installation.')85 log.warn('Something went wrong during the installation.')
86 log.warn('See the error message above.')86 log.warn('See the error message above.')
87 finally:87 finally:
@@ -144,7 +144,7 @@
144 except ImportError:144 except ImportError:
145 return _do_download(version, download_base, to_dir, download_delay)145 return _do_download(version, download_base, to_dir, download_delay)
146 try:146 try:
147 pkg_resources.require("distribute>="+version)147 pkg_resources.require("distribute>=" + version)
148 return148 return
149 except pkg_resources.VersionConflict:149 except pkg_resources.VersionConflict:
150 e = sys.exc_info()[1]150 e = sys.exc_info()[1]
@@ -167,6 +167,7 @@
167 if not no_fake:167 if not no_fake:
168 _create_fake_setuptools_pkg_info(to_dir)168 _create_fake_setuptools_pkg_info(to_dir)
169169
170
170def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,171def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
171 to_dir=os.curdir, delay=15):172 to_dir=os.curdir, delay=15):
172 """Download distribute from a specified location and return its filename173 """Download distribute from a specified location and return its filename
@@ -204,6 +205,31 @@
204 return os.path.realpath(saveto)205 return os.path.realpath(saveto)
205206
206207
208def _no_sandbox(function):
209 def __no_sandbox(*args, **kw):
210 try:
211 from setuptools.sandbox import DirectorySandbox
212 if not hasattr(DirectorySandbox, '_old'):
213 def violation(*args):
214 pass
215 DirectorySandbox._old = DirectorySandbox._violation
216 DirectorySandbox._violation = violation
217 patched = True
218 else:
219 patched = False
220 except ImportError:
221 patched = False
222
223 try:
224 return function(*args, **kw)
225 finally:
226 if patched:
227 DirectorySandbox._violation = DirectorySandbox._old
228 del DirectorySandbox._old
229
230 return __no_sandbox
231
232
207def _patch_file(path, content):233def _patch_file(path, content):
208 """Will backup the file then patch it"""234 """Will backup the file then patch it"""
209 existing_content = open(path).read()235 existing_content = open(path).read()
@@ -220,38 +246,20 @@
220 f.close()246 f.close()
221 return True247 return True
222248
249_patch_file = _no_sandbox(_patch_file)
250
223251
224def _same_content(path, content):252def _same_content(path, content):
225 return open(path).read() == content253 return open(path).read() == content
226254
227def _no_sandbox(function):255
228 def __no_sandbox(*args, **kw):
229 try:
230 from setuptools.sandbox import DirectorySandbox
231 def violation(*args):
232 pass
233 DirectorySandbox._old = DirectorySandbox._violation
234 DirectorySandbox._violation = violation
235 patched = True
236 except ImportError:
237 patched = False
238
239 try:
240 return function(*args, **kw)
241 finally:
242 if patched:
243 DirectorySandbox._violation = DirectorySandbox._old
244 del DirectorySandbox._old
245
246 return __no_sandbox
247
248@_no_sandbox
249def _rename_path(path):256def _rename_path(path):
250 new_name = path + '.OLD.%s' % time.time()257 new_name = path + '.OLD.%s' % time.time()
251 log.warn('Renaming %s into %s', path, new_name)258 log.warn('Renaming %s into %s', path, new_name)
252 os.rename(path, new_name)259 os.rename(path, new_name)
253 return new_name260 return new_name
254261
262
255def _remove_flat_installation(placeholder):263def _remove_flat_installation(placeholder):
256 if not os.path.isdir(placeholder):264 if not os.path.isdir(placeholder):
257 log.warn('Unkown installation at %s', placeholder)265 log.warn('Unkown installation at %s', placeholder)
@@ -285,13 +293,15 @@
285 'Setuptools distribution', element)293 'Setuptools distribution', element)
286 return True294 return True
287295
296_remove_flat_installation = _no_sandbox(_remove_flat_installation)
297
288298
289def _after_install(dist):299def _after_install(dist):
290 log.warn('After install bootstrap.')300 log.warn('After install bootstrap.')
291 placeholder = dist.get_command_obj('install').install_purelib301 placeholder = dist.get_command_obj('install').install_purelib
292 _create_fake_setuptools_pkg_info(placeholder)302 _create_fake_setuptools_pkg_info(placeholder)
293303
294@_no_sandbox304
295def _create_fake_setuptools_pkg_info(placeholder):305def _create_fake_setuptools_pkg_info(placeholder):
296 if not placeholder or not os.path.exists(placeholder):306 if not placeholder or not os.path.exists(placeholder):
297 log.warn('Could not find the install location')307 log.warn('Could not find the install location')
@@ -304,6 +314,9 @@
304 log.warn('%s already exists', pkg_info)314 log.warn('%s already exists', pkg_info)
305 return315 return
306316
317 if not os.access(pkg_info, os.W_OK):
318 log.warn("Don't have permissions to write %s, skipping", pkg_info)
319
307 log.warn('Creating %s', pkg_info)320 log.warn('Creating %s', pkg_info)
308 f = open(pkg_info, 'w')321 f = open(pkg_info, 'w')
309 try:322 try:
@@ -319,6 +332,11 @@
319 finally:332 finally:
320 f.close()333 f.close()
321334
335_create_fake_setuptools_pkg_info = _no_sandbox(
336 _create_fake_setuptools_pkg_info
337)
338
339
322def _patch_egg_dir(path):340def _patch_egg_dir(path):
323 # let's check if it's already patched341 # let's check if it's already patched
324 pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')342 pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
@@ -337,6 +355,8 @@
337 f.close()355 f.close()
338 return True356 return True
339357
358_patch_egg_dir = _no_sandbox(_patch_egg_dir)
359
340360
341def _before_install():361def _before_install():
342 log.warn('Before install bootstrap.')362 log.warn('Before install bootstrap.')
@@ -346,7 +366,7 @@
346def _under_prefix(location):366def _under_prefix(location):
347 if 'install' not in sys.argv:367 if 'install' not in sys.argv:
348 return True368 return True
349 args = sys.argv[sys.argv.index('install')+1:]369 args = sys.argv[sys.argv.index('install') + 1:]
350 for index, arg in enumerate(args):370 for index, arg in enumerate(args):
351 for option in ('--root', '--prefix'):371 for option in ('--root', '--prefix'):
352 if arg.startswith('%s=' % option):372 if arg.startswith('%s=' % option):
@@ -354,10 +374,10 @@
354 return location.startswith(top_dir)374 return location.startswith(top_dir)
355 elif arg == option:375 elif arg == option:
356 if len(args) > index:376 if len(args) > index:
357 top_dir = args[index+1]377 top_dir = args[index + 1]
358 return location.startswith(top_dir)378 return location.startswith(top_dir)
359 elif option == '--user' and USER_SITE is not None:379 if arg == '--user' and USER_SITE is not None:
360 return location.startswith(USER_SITE)380 return location.startswith(USER_SITE)
361 return True381 return True
362382
363383
@@ -371,11 +391,14 @@
371 return391 return
372 ws = pkg_resources.working_set392 ws = pkg_resources.working_set
373 try:393 try:
374 setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools',394 setuptools_dist = ws.find(
375 replacement=False))395 pkg_resources.Requirement.parse('setuptools', replacement=False)
396 )
376 except TypeError:397 except TypeError:
377 # old distribute API398 # old distribute API
378 setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools'))399 setuptools_dist = ws.find(
400 pkg_resources.Requirement.parse('setuptools')
401 )
379402
380 if setuptools_dist is None:403 if setuptools_dist is None:
381 log.warn('No setuptools distribution found')404 log.warn('No setuptools distribution found')
@@ -416,6 +439,10 @@
416def _relaunch():439def _relaunch():
417 log.warn('Relaunching...')440 log.warn('Relaunching...')
418 # we have to relaunch the process441 # we have to relaunch the process
442 # pip marker to avoid a relaunch bug
443 _cmd = ['-c', 'install', '--single-version-externally-managed']
444 if sys.argv[:3] == _cmd:
445 sys.argv[0] = 'setup.py'
419 args = [sys.executable] + sys.argv446 args = [sys.executable] + sys.argv
420 sys.exit(subprocess.call(args))447 sys.exit(subprocess.call(args))
421448
@@ -440,7 +467,7 @@
440 # Extract directories with a safe mode.467 # Extract directories with a safe mode.
441 directories.append(tarinfo)468 directories.append(tarinfo)
442 tarinfo = copy.copy(tarinfo)469 tarinfo = copy.copy(tarinfo)
443 tarinfo.mode = 448 # decimal for oct 0700470 tarinfo.mode = 448 # decimal for oct 0700
444 self.extract(tarinfo, path)471 self.extract(tarinfo, path)
445472
446 # Reverse sort directories.473 # Reverse sort directories.
@@ -467,10 +494,21 @@
467 self._dbg(1, "tarfile: %s" % e)494 self._dbg(1, "tarfile: %s" % e)
468495
469496
497def _build_install_args(argv):
498 install_args = []
499 user_install = '--user' in argv
500 if user_install and sys.version_info < (2, 6):
501 log.warn("--user requires Python 2.6 or later")
502 raise SystemExit(1)
503 if user_install:
504 install_args.append('--user')
505 return install_args
506
507
470def main(argv, version=DEFAULT_VERSION):508def main(argv, version=DEFAULT_VERSION):
471 """Install or upgrade setuptools and EasyInstall"""509 """Install or upgrade setuptools and EasyInstall"""
472 tarball = download_setuptools()510 tarball = download_setuptools()
473 _install(tarball)511 _install(tarball, _build_install_args(argv))
474512
475513
476if __name__ == '__main__':514if __name__ == '__main__':
477515
=== renamed file 'Makefile' => 'sphinx.mk'
--- Makefile 2010-11-10 22:42:51 +0000
+++ sphinx.mk 2012-08-02 16:24:39 +0000
@@ -11,9 +11,9 @@
11PAPEROPT_letter = -D latex_paper_size=letter11PAPEROPT_letter = -D latex_paper_size=letter
12ALLSPHINXOPTS = -d _build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .12ALLSPHINXOPTS = -d _build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
1313
14.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest14.PHONY: sphinx-help clean-sphinx html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
1515
16help:16sphinx-help:
17 @echo "Please use \`make <target>' where <target> is one of"17 @echo "Please use \`make <target>' where <target> is one of"
18 @echo " html to make standalone HTML files"18 @echo " html to make standalone HTML files"
19 @echo " dirhtml to make HTML files named index.html in directories"19 @echo " dirhtml to make HTML files named index.html in directories"
@@ -26,7 +26,7 @@
26 @echo " linkcheck to check all external links for integrity"26 @echo " linkcheck to check all external links for integrity"
27 @echo " doctest to run all doctests embedded in the documentation (if enabled)"27 @echo " doctest to run all doctests embedded in the documentation (if enabled)"
2828
29clean:29clean-sphinx:
30 -rm -rf _build/*30 -rm -rf _build/*
3131
32html:32html:
3333
=== modified file 'tarmac_tests.sh'
--- tarmac_tests.sh 2011-12-07 20:59:39 +0000
+++ tarmac_tests.sh 2012-08-02 16:24:39 +0000
@@ -2,7 +2,10 @@
22
3set -e3set -e
44
5virtualenv --no-site-packages virtualenv > log5LOG_FILE=log
6. virtualenv/bin/activate >> log6
7python setup.py develop >> log7echo "Running pkgme tests in tarmac" > $LOG_FILE
8python -m testtools.run pkgme.tests.test_suite8make download-cache
9bzr up download-cache
10make bootstrap >> $LOG_FILE
11make test
912
=== added file 'versions.cfg'
--- versions.cfg 1970-01-01 00:00:00 +0000
+++ versions.cfg 2012-08-02 16:24:39 +0000
@@ -0,0 +1,36 @@
1[buildout]
2versions = versions
3
4# Update the version number here to upgrade to a new version.
5# You'll likely want to run 'make update-deps' when you have
6# changed something here.
7#
8# If you are forking a dependency then make sure you include a pointer
9# to the branch where the fork is maintained.
10#
11# Alphabetical, case-insensitive, please! :-)
12[versions]
13# Only needed for Python 2.6, in turn only needed for Jenkins.
14argparse = 1.2.1
15Cheetah = 2.4.4
16distribute = 0.6.28
17fixtures = 0.3.9
18httplib2 = 0.7.4
19keyring = 0.9.2
20launchpadlib = 1.10.2
21lazr.authentication = 0.1.2
22lazr.restfulclient = 0.13.0
23lazr.uri = 1.0.3
24Markdown = 2.2.0
25oauth = 1.0.1
26python-debian = 0.1.16
27python-subunit = 0.0.8
28simplejson = 2.6.1
29testresources = 0.2.5
30testtools = 0.9.15
31wadllib = 1.3.1
32wsgi-intercept = 0.5.1
33z3c.recipe.scripts = 1.0.1
34zc.buildout = 1.5.1
35zc.recipe.egg = 1.3.2
36zope.interface = 4.0.1

Subscribers

People subscribed via source and target branches