Merge lp:~cjwatson/launchpad/virtualenv-pip into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18517
Proposed branch: lp:~cjwatson/launchpad/virtualenv-pip
Merge into: lp:launchpad
Diff against target: 3021 lines (+859/-1585)
29 files modified
.bzrignore (+1/-2)
Makefile (+93/-77)
_pythonpath.py (+44/-12)
bootstrap.py (+0/-258)
buildout.cfg (+0/-53)
bzr-trunk-buildout.cfg (+0/-12)
bzrplugins/lpserve/test_lpserve.py (+3/-11)
constraints.txt (+356/-0)
doc/index.txt (+1/-1)
doc/pip.txt (+176/-441)
ez_setup.py (+0/-288)
lib/lp/codehosting/__init__.py (+2/-10)
lib/lp/scripts/harness.py (+2/-4)
lib/lp/scripts/utilities/bzr.py (+0/-13)
lib/lp/scripts/utilities/importfascist.py (+4/-0)
lib/lp/services/job/runner.py (+2/-1)
lib/lp/services/mailman/monkeypatches/mm_cfg.py.in (+2/-3)
lib/lp/services/scripts/tests/test_logger.txt (+0/-6)
lib/lp_sitecustomize.py (+12/-10)
pip-requirements.txt (+1/-0)
setup.cfg (+0/-12)
setup.py (+130/-14)
utilities/link-external-sourcecode (+2/-2)
utilities/relocate-virtualenv (+25/-0)
utilities/rocketfuel-branch (+1/-6)
utilities/rocketfuel-get (+2/-4)
versions.cfg (+0/-193)
zopeapp-versions.cfg (+0/-40)
ztk-versions.cfg (+0/-112)
To merge this branch: bzr merge lp:~cjwatson/launchpad/virtualenv-pip
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+331388@code.launchpad.net

Commit message

Convert build system to virtualenv and pip.

Description of the change

Convert build system to virtualenv and pip.

This is a more or less complete rewrite of the build system to get us to the
point where we can upgrade packages with non-trivial uses of setup_requires.
It will only work on xenial (precise would be possible in principle, but
requires somewhat more complicated bootstrapping of the virtualenv that
doesn't seem worth it now).

This requires some package upgrades:

Twisted: 13.0.0-p2 -> 13.0.0post3
  Use PEP 440-compliant version.
d2to1: 0.2.10 -> 0.2.12
  Cope with modern setuptools.
distribute: 0.6.36 -> 0.7.3
  Switch to legacy wrapper for modern setuptools.
launchpad-buildd: 136 -> 157
  Normalise Python packaging to avoid buildd-slave.tac being installed at
  the root of the virtualenv.
pip: 1.4 -> 9.0.1
  Modern pip.
setuptools: 0.6c11 -> 36.4.0
  Modern setuptools.
setuptools-git: 1.0 -> 1.2
  Avoid a significant performance regression.
virtualenv-tools3: None -> 2.0.0
  Used to relocate virtualenvs.
wheel: None -> 0.29.0
  For now we're still mostly using sdists, but some eggs need to be replaced
  with corresponding wheels.
z3c.recipe.tag: 0.6 -> None
  No longer needed. The ID Makefile target was already broken so I removed
  it, and it's relatively easy to provide good-enough reimplementations of
  TAGS and tags.
zope.pagetemplate: 3.5.0-p1 -> 3.5.0.post2
  Cherry-pick dependency tweak; use PEP 440-compliant version.

Some bits of application code need minor adjustments to cope with the
changes to the Python module path.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

We may need a bit of extra care to make this work properly with deployments. At the moment we do "make build_eggs" (which also runs buildout in the old world, or builds the virtualenv in the new world), sync that out everywhere, and then run "make compile" on each deployment target. That isn't quite good enough here though, because "make compile" won't rebuild the virtualenv to account for changed paths, and in any case if we can avoid building a virtualenv on each deployment target then we wouldn't have to cope with deployments being significantly slower.

I think the best approach is probably to use something like virtualenv-tools to relocate the environment. I'm not thrilled about this, but it may be the least bad answer for now. If that doesn't work, we can probably arrange for "make compile" to check whether the virtualenv's paths are correct and rebuild it if they aren't.

Revision history for this message
Colin Watson (cjwatson) wrote :

This seems to do the job. There's a bit of care needed because virtualenv-tools3 misses a couple of things, but it's close enough that we can fix the rest up manually.

Revision history for this message
William Grant (wgrant) wrote :

I've played with it locally and can't obviously break it. I'm sure it'll break the build process and production in unknown ways, but we can hardly avoid that.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2017-07-24 12:47:04 +0000
+++ .bzrignore 2017-12-19 09:48:36 +0000
@@ -33,15 +33,14 @@
33lib/canonical/launchpad/icing/build/*33lib/canonical/launchpad/icing/build/*
34lib/canonical/launchpad/icing/combo.css34lib/canonical/launchpad/icing/combo.css
35bin35bin
36develop-eggs
37.installed.cfg36.installed.cfg
38parts37parts
39*.egg-info38*.egg-info
40build39build
41*.egg
42dist40dist
43./eggs41./eggs
44./download-cache42./download-cache
43./env
45./production-configs44./production-configs
46bzr.dev45bzr.dev
47_trial_temp46_trial_temp
4847
=== modified file 'Makefile'
--- Makefile 2017-10-20 13:03:40 +0000
+++ Makefile 2017-12-19 09:48:36 +0000
@@ -6,9 +6,24 @@
6WD:=$(shell pwd)6WD:=$(shell pwd)
7PY=$(WD)/bin/py7PY=$(WD)/bin/py
8PYTHONPATH:=$(WD)/lib:${PYTHONPATH}8PYTHONPATH:=$(WD)/lib:${PYTHONPATH}
9BUILDOUT_CFG=buildout.cfg
10VERBOSITY=-vv9VERBOSITY=-vv
1110
11# virtualenv and pip fail if setlocale fails, so force a valid locale.
12VIRTUALENV := LC_ALL=C.UTF-8 virtualenv
13PIP := PYTHONPATH= LC_ALL=C.UTF-8 env/bin/pip
14# Run with "make PIP_NO_INDEX=" if you want pip to find software
15# dependencies *other* than those in our download-cache. Once you have the
16# desired software, commit it to lp:lp-source-dependencies if it is going to
17# be reviewed/merged/deployed.
18# Although --ignore-installed is slower, we need it to avoid confusion with
19# system-installed Python packages. If we ever manage to remove the need
20# for virtualenv --system-site-packages, then we can remove this too.
21PIP_NO_INDEX := --no-index
22PIP_INSTALL_ARGS := \
23 $(PIP_NO_INDEX) \
24 --ignore-installed \
25 --find-links=file://$(WD)/download-cache/dist/ \
26
12TESTFLAGS=-p $(VERBOSITY)27TESTFLAGS=-p $(VERBOSITY)
13TESTOPTS=28TESTOPTS=
1429
@@ -40,22 +55,32 @@
40APIDOC_TMPDIR = $(APIDOC_DIR).tmp/55APIDOC_TMPDIR = $(APIDOC_DIR).tmp/
41API_INDEX = $(APIDOC_DIR)/index.html56API_INDEX = $(APIDOC_DIR)/index.html
4257
43# Do not add bin/buildout to this list.58# It is impossible to get pip to tell us all the files it would build, since
44# It is impossible to get buildout to tell us all the files it would59# each package's setup.py doesn't tell us that information.
45# build, since each egg's setup.py doesn't tell us that information.
46#60#
47# NB: It's important BUILDOUT_BIN only mentions things genuinely produced by61# NB: It's important PIP_BIN only mentions things genuinely produced by pip.
48# buildout.62PIP_BIN = \
49BUILDOUT_BIN = \63 $(PY) \
50 $(PY) bin/build-twisted-plugin-cache bin/bzr \64 bin/build-twisted-plugin-cache \
51 bin/combine-css bin/fl-build-report \65 bin/combine-css \
52 bin/fl-credential-ctl bin/fl-install-demo bin/fl-monitor-ctl \66 bin/googletestservice \
53 bin/fl-record bin/fl-run-bench bin/fl-run-test bin/googletestservice \67 bin/harness \
54 bin/harness bin/iharness bin/ipy bin/jsbuild bin/lpjsmin\68 bin/iharness \
55 bin/killservice bin/kill-test-services bin/retest \69 bin/ipy \
56 bin/run bin/run-testapp bin/sprite-util bin/start_librarian \70 bin/jsbuild \
57 bin/tags bin/test bin/tracereport bin/twistd \71 bin/lpjsmin \
58 bin/watch_jsbuild bin/with-xvfb72 bin/killservice \
73 bin/kill-test-services \
74 bin/retest \
75 bin/run \
76 bin/run-testapp \
77 bin/sprite-util \
78 bin/start_librarian \
79 bin/test \
80 bin/tracereport \
81 bin/twistd \
82 bin/watch_jsbuild \
83 bin/with-xvfb
5984
60# DO NOT ALTER : this should just build by default85# DO NOT ALTER : this should just build by default
61default: inplace86default: inplace
@@ -131,7 +156,7 @@
131build: compile apidoc jsbuild css_combine156build: compile apidoc jsbuild css_combine
132157
133# LP_SOURCEDEPS_PATH should point to the sourcecode directory, but we158# LP_SOURCEDEPS_PATH should point to the sourcecode directory, but we
134# want the parent directory where the download-cache and eggs directory159# want the parent directory where the download-cache and env directories
135# are. We re-use the variable that is using for the rocketfuel-get script.160# are. We re-use the variable that is using for the rocketfuel-get script.
136download-cache:161download-cache:
137ifdef LP_SOURCEDEPS_PATH162ifdef LP_SOURCEDEPS_PATH
@@ -189,55 +214,48 @@
189 build/js/lp/meta.js >/dev/null214 build/js/lp/meta.js >/dev/null
190 utilities/check-js-deps215 utilities/check-js-deps
191216
192eggs:
193 # Usually this is linked via link-external-sourcecode, but in
194 # deployment we create this ourselves.
195 mkdir eggs
196
197buildonce_eggs: $(PY)
198 find eggs -name '*.pyc' -exec rm {} \;
199
200# The download-cache dependency comes *before* eggs so that developers get the
201# warning before the eggs directory is made. The target for the eggs
202# directory is only there for deployment convenience.
203# Note that the buildout version must be maintained here and in versions.cfg
204# to make sure that the build does not go over the network.
205#
206# buildout won't touch files that would have the same contents, but for Make's
207# sake we need them to get fresh timestamps, so we touch them after building.
208bin/buildout: download-cache eggs
209 $(SHHH) PYTHONPATH= $(PYTHON) bootstrap.py\
210 --setup-source=ez_setup.py \
211 --download-base=download-cache/dist --eggs=eggs \
212 --version=1.7.1
213 touch --no-create $@
214
215# This target is used by LOSAs to prepare a build to be pushed out to217# This target is used by LOSAs to prepare a build to be pushed out to
216# destination machines. We only want eggs: they are the expensive bits,218# destination machines. We only want wheels: they are the expensive bits,
217# and the other bits might run into problems like bug 575037. This219# and the other bits might run into problems like bug 575037. This
218# target runs buildout, and then removes everything created except for220# target runs pip, and then removes everything created except for the
219# the eggs.221# wheels.
220build_eggs: $(BUILDOUT_BIN) clean_buildout222build_wheels: $(PIP_BIN) clean_pip
221223
222# This builds bin/py and all the other bin files except bin/buildout.224# Compatibility.
223# Remove the target before calling buildout to ensure that buildout225build_eggs: build_wheels
224# updates the timestamp.226
225buildout_bin: $(BUILDOUT_BIN)227# setuptools won't touch files that would have the same contents, but for
226228# Make's sake we need them to get fresh timestamps, so we touch them after
227# buildout won't touch files that would have the same contents, but for Make's229# building.
228# sake we need them to get fresh timestamps, so we touch them after building.
229#230#
230# If we listed every target on the left-hand side, a parallel make would try231# If we listed every target on the left-hand side, a parallel make would try
231# multiple copies of this rule to build them all. Instead, we nominally build232# multiple copies of this rule to build them all. Instead, we nominally build
232# just $(PY), and everything else is implicitly updated by that.233# just $(PY), and everything else is implicitly updated by that.
233$(PY): bin/buildout versions.cfg $(BUILDOUT_CFG) setup.py234$(PY): download-cache constraints.txt setup.py
234 $(SHHH) PYTHONPATH= ./bin/buildout \235 rm -rf env
235 configuration:instance_name=${LPCONFIG} -c $(BUILDOUT_CFG)236 mkdir -p env
237 (echo '[easy_install]'; \
238 echo "allow_hosts = ''"; \
239 echo 'find_links = file://$(WD)/download-cache/dist/') \
240 >env/.pydistutils.cfg
241 $(VIRTUALENV) \
242 --python=$(PYTHON) --system-site-packages --never-download \
243 --extra-search-dir=$(WD)/download-cache/dist/ \
244 env
245 ln -sfn env/bin bin
246 $(SHHH) $(PIP) install $(PIP_INSTALL_ARGS) \
247 -r pip-requirements.txt
248 $(SHHH) LPCONFIG=$(LPCONFIG) $(PIP) \
249 --cache-dir=$(WD)/download-cache/ \
250 install $(PIP_INSTALL_ARGS) \
251 -c pip-requirements.txt -c constraints.txt -e . \
252 || { code=$$?; rm -f $@; exit $$code; }
236 touch $@253 touch $@
237254
238$(subst $(PY),,$(BUILDOUT_BIN)): $(PY)255$(subst $(PY),,$(PIP_BIN)): $(PY)
239256
240compile: $(PY) $(VERSION_INFO)257compile: $(PY) $(VERSION_INFO)
258 ${SHHH} utilities/relocate-virtualenv env
241 ${SHHH} $(MAKE) -C sourcecode build PYTHON=${PYTHON} \259 ${SHHH} $(MAKE) -C sourcecode build PYTHON=${PYTHON} \
242 LPCONFIG=${LPCONFIG}260 LPCONFIG=${LPCONFIG}
243 ${SHHH} bin/build-twisted-plugin-cache261 ${SHHH} bin/build-twisted-plugin-cache
@@ -345,14 +363,16 @@
345 $(RM) -r $(JS_BUILD_DIR)363 $(RM) -r $(JS_BUILD_DIR)
346 $(RM) -r yarn/node_modules364 $(RM) -r yarn/node_modules
347365
348clean_buildout:366clean_pip:
349 $(RM) -r build367 $(RM) -r build
350 if [ -d $(CONVOY_ROOT) ]; then $(RM) -r $(CONVOY_ROOT) ; fi368 if [ -d $(CONVOY_ROOT) ]; then $(RM) -r $(CONVOY_ROOT) ; fi
351 $(RM) -r bin369 $(RM) -r bin
352 $(RM) -r parts370 $(RM) -r parts
353 $(RM) -r develop-eggs
354 $(RM) .installed.cfg371 $(RM) .installed.cfg
355372
373# Compatibility.
374clean_buildout: clean_pip
375
356clean_logs:376clean_logs:
357 $(RM) logs/thread*.request377 $(RM) logs/thread*.request
358378
@@ -365,7 +385,7 @@
365 $(RM) -r lib/mailman385 $(RM) -r lib/mailman
366endif386endif
367387
368lxc-clean: clean_js clean_mailman clean_buildout clean_logs388lxc-clean: clean_js clean_mailman clean_pip clean_logs
369 # XXX: BradCrittenden 2012-05-25 bug=1004514:389 # XXX: BradCrittenden 2012-05-25 bug=1004514:
370 # It is important for parallel tests inside LXC that the390 # It is important for parallel tests inside LXC that the
371 # $(CODEHOSTING_ROOT) directory not be completely removed.391 # $(CODEHOSTING_ROOT) directory not be completely removed.
@@ -381,10 +401,7 @@
381 if test -f sourcecode/mailman/Makefile; then \401 if test -f sourcecode/mailman/Makefile; then \
382 $(MAKE) -C sourcecode/mailman clean; \402 $(MAKE) -C sourcecode/mailman clean; \
383 fi403 fi
384 find . -path ./eggs -prune -false -o \404 $(RM) -r env
385 -type f \( -name '*.o' -o -name '*.so' -o -name '*.la' -o \
386 -name '*.lo' -o -name '*.py[co]' -o -name '*.dll' \) \
387 -print0 | xargs -r0 $(RM)
388 $(RM) -r lib/subvertpy/*.so405 $(RM) -r lib/subvertpy/*.so
389 $(RM) -r $(LP_BUILT_JS_ROOT)/*406 $(RM) -r $(LP_BUILT_JS_ROOT)/*
390 $(RM) -r $(CODEHOSTING_ROOT)/*407 $(RM) -r $(CODEHOSTING_ROOT)/*
@@ -466,15 +483,15 @@
466483
467TAGS: compile484TAGS: compile
468 # emacs tags485 # emacs tags
469 bin/tags -e486 ctags -R -e --languages=-JavaScript --python-kinds=-i -f $@.new \
487 $(CURDIR)/lib $(CURDIR)/env/lib/$(PYTHON)/site-packages
488 mv $@.new $@
470489
471tags: compile490tags: compile
472 # vi tags491 # vi tags
473 bin/tags -v492 ctags -R --languages=-JavaScript --python-kinds=-i -f $@.new \
474493 $(CURDIR)/lib $(CURDIR)/env/lib/$(PYTHON)/site-packages
475ID: compile494 mv $@.new $@
476 # idutils ID file
477 bin/tags -i
478495
479PYDOCTOR = pydoctor496PYDOCTOR = pydoctor
480PYDOCTOR_OPTIONS =497PYDOCTOR_OPTIONS =
@@ -485,11 +502,10 @@
485 --docformat restructuredtext --verbose-about epytext-summary \502 --docformat restructuredtext --verbose-about epytext-summary \
486 $(PYDOCTOR_OPTIONS)503 $(PYDOCTOR_OPTIONS)
487504
488.PHONY: apidoc build_eggs buildonce_eggs buildout_bin check \505.PHONY: apidoc build_eggs build_wheels check check_config check_mailman \
489 check_config check_mailman clean clean_buildout clean_js \506 clean clean_buildout clean_js clean_logs clean_pip compile \
490 clean_logs compile css_combine debug default doc ftest_build \507 css_combine debug default doc ftest_build ftest_inplace \
491 ftest_inplace hosted_branches jsbuild jsbuild_widget_css \508 hosted_branches jsbuild jsbuild_widget_css launchpad.pot \
492 launchpad.pot pagetests pull_branches pydoctor realclean \509 pydoctor realclean reload-apache run run-testapp runner schema \
493 reload-apache run run-testapp runner scan_branches schema \510 sprite_css sprite_image start stop TAGS tags test_build \
494 sprite_css sprite_image start stop sync_branches TAGS tags \511 test_inplace $(LP_JS_BUILD)
495 test_build test_inplace $(LP_JS_BUILD)
496512
=== modified file '_pythonpath.py'
--- _pythonpath.py 2017-05-08 12:39:30 +0000
+++ _pythonpath.py 2017-12-19 09:48:36 +0000
@@ -19,11 +19,12 @@
19# project root.19# project root.
20top = os.path.dirname(os.path.abspath(os.path.realpath(filename)))20top = os.path.dirname(os.path.abspath(os.path.realpath(filename)))
2121
22site_dir = os.path.join(top, 'parts', 'scripts')22env = os.path.join(top, 'env')
23stdlib_dir = os.path.join(env, 'lib', 'python%s' % sys.version[:3])
2324
24if ('site' in sys.modules and25if ('site' in sys.modules and
25 not sys.modules['site'].__file__.startswith(26 not sys.modules['site'].__file__.startswith(
26 os.path.join(site_dir, 'site.py'))):27 os.path.join(stdlib_dir, 'site.py'))):
27 # We have the wrong site.py, so our paths are not set up correctly.28 # We have the wrong site.py, so our paths are not set up correctly.
28 # We blow up, with a hopefully helpful error message.29 # We blow up, with a hopefully helpful error message.
29 raise RuntimeError(30 raise RuntimeError(
@@ -31,13 +32,44 @@
31 'Scripts should usually be '32 'Scripts should usually be '
32 "started with Launchpad's bin/py, or with a Python invoked with "33 "started with Launchpad's bin/py, or with a Python invoked with "
33 'the -S flag.' % (34 'the -S flag.' % (
34 sys.modules['site'].__file__, os.path.join(site_dir, 'site.py')))35 sys.modules['site'].__file__, os.path.join(stdlib_dir, 'site.py')))
3536
36if site_dir not in sys.path:37# Ensure that the virtualenv's standard library directory is in sys.path;
37 sys.path.insert(0, site_dir)38# activate_this will not put it there.
38elif 'site' not in sys.modules:39if stdlib_dir not in sys.path and (stdlib_dir + os.sep) not in sys.path:
39 # XXX 2010-05-04 gary bug 57520640 sys.path.insert(0, stdlib_dir)
40 # This one line is to support Mailman 2, which does something unexpected41
41 # to set up its paths.42if not sys.executable.startswith(top + os.sep) or 'site' not in sys.modules:
42 sys.path[:] = [p for p in sys.path if 'site-packages' not in p]43 # Activate the virtualenv. Avoid importing lp_sitecustomize here, as
43import site # sets up paths44 # activate_this imports site before it's finished setting up sys.path.
45 orig_disable_sitecustomize = os.environ.get('LP_DISABLE_SITECUSTOMIZE')
46 os.environ['LP_DISABLE_SITECUSTOMIZE'] = '1'
47 # This is a bit like env/bin/activate_this.py, but to help namespace
48 # packages work properly we change sys.prefix before importing site
49 # rather than after.
50 sys.real_prefix = sys.prefix
51 sys.prefix = env
52 os.environ['PATH'] = (
53 os.path.join(env, 'bin') + os.pathsep + os.environ.get('PATH', ''))
54 site_packages = os.path.join(
55 env, 'lib', 'python%s' % sys.version[:3], 'site-packages')
56 import site
57 site.addsitedir(site_packages)
58 if orig_disable_sitecustomize is not None:
59 os.environ['LP_DISABLE_SITECUSTOMIZE'] = orig_disable_sitecustomize
60 else:
61 del os.environ['LP_DISABLE_SITECUSTOMIZE']
62
63# Move all our own directories to the front of the path.
64new_sys_path = []
65for item in list(sys.path):
66 if item == top or item.startswith(top + os.sep):
67 new_sys_path.append(item)
68 sys.path.remove(item)
69sys.path[:0] = new_sys_path
70
71# Initialise the Launchpad environment.
72if 'LP_DISABLE_SITECUSTOMIZE' not in os.environ:
73 if 'lp_sitecustomize' not in sys.modules:
74 import lp_sitecustomize
75 lp_sitecustomize.main()
4476
=== removed file 'bootstrap.py'
--- bootstrap.py 2010-08-23 14:40:19 +0000
+++ bootstrap.py 1970-01-01 00:00:00 +0000
@@ -1,258 +0,0 @@
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, textwrap, 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
61sys.path[:] = clean_path
62for k, v in sys.modules.items():
63 if (hasattr(v, '__path__') and
64 len(v.__path__)==1 and
65 not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))):
66 # This is a namespace package. Remove it.
67 sys.modules.pop(k)
68
69is_jython = sys.platform.startswith('java')
70
71setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py'
72distribute_source = 'http://python-distribute.org/distribute_setup.py'
73
74# parsing arguments
75def normalize_to_url(option, opt_str, value, parser):
76 if value:
77 if '://' not in value: # It doesn't smell like a URL.
78 value = 'file://%s' % (
79 urllib.pathname2url(
80 os.path.abspath(os.path.expanduser(value))),)
81 if opt_str == '--download-base' and not value.endswith('/'):
82 # Download base needs a trailing slash to make the world happy.
83 value += '/'
84 else:
85 value = None
86 name = opt_str[2:].replace('-', '_')
87 setattr(parser.values, name, value)
88
89usage = '''\
90[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options]
91
92Bootstraps a buildout-based project.
93
94Simply run this script in a directory containing a buildout.cfg, using the
95Python that you want bin/buildout to use.
96
97Note that by using --setup-source and --download-base to point to
98local resources, you can keep this script from going over the network.
99'''
100
101parser = OptionParser(usage=usage)
102parser.add_option("-v", "--version", dest="version",
103 help="use a specific zc.buildout version")
104parser.add_option("-d", "--distribute",
105 action="store_true", dest="use_distribute", default=False,
106 help="Use Distribute rather than Setuptools.")
107parser.add_option("--setup-source", action="callback", dest="setup_source",
108 callback=normalize_to_url, nargs=1, type="string",
109 help=("Specify a URL or file location for the setup file. "
110 "If you use Setuptools, this will default to " +
111 setuptools_source + "; if you use Distribute, this "
112 "will default to " + distribute_source +"."))
113parser.add_option("--download-base", action="callback", dest="download_base",
114 callback=normalize_to_url, nargs=1, type="string",
115 help=("Specify a URL or directory for downloading "
116 "zc.buildout and either Setuptools or Distribute. "
117 "Defaults to PyPI."))
118parser.add_option("--eggs",
119 help=("Specify a directory for storing eggs. Defaults to "
120 "a temporary directory that is deleted when the "
121 "bootstrap script completes."))
122parser.add_option("-t", "--accept-buildout-test-releases",
123 dest='accept_buildout_test_releases',
124 action="store_true", default=False,
125 help=("Normally, if you do not specify a --version, the "
126 "bootstrap script and buildout gets the newest "
127 "*final* versions of zc.buildout and its recipes and "
128 "extensions for you. If you use this flag, "
129 "bootstrap and buildout will get the newest releases "
130 "even if they are alphas or betas."))
131parser.add_option("-c", None, action="store", dest="config_file",
132 help=("Specify the path to the buildout configuration "
133 "file to be used."))
134
135options, args = parser.parse_args()
136
137# if -c was provided, we push it back into args for buildout's main function
138if options.config_file is not None:
139 args += ['-c', options.config_file]
140
141if options.eggs:
142 eggs_dir = os.path.abspath(os.path.expanduser(options.eggs))
143else:
144 eggs_dir = tempfile.mkdtemp()
145
146if options.setup_source is None:
147 if options.use_distribute:
148 options.setup_source = distribute_source
149 else:
150 options.setup_source = setuptools_source
151
152if options.accept_buildout_test_releases:
153 args.append('buildout:accept-buildout-test-releases=true')
154args.append('bootstrap')
155
156try:
157 import pkg_resources
158 import setuptools # A flag. Sometimes pkg_resources is installed alone.
159 if not hasattr(pkg_resources, '_distribute'):
160 raise ImportError
161except ImportError:
162 ez_code = urllib2.urlopen(
163 options.setup_source).read().replace('\r\n', '\n')
164 ez = {}
165 exec ez_code in ez
166 setup_args = dict(to_dir=eggs_dir, download_delay=0)
167 if options.download_base:
168 setup_args['download_base'] = options.download_base
169 if options.use_distribute:
170 setup_args['no_fake'] = True
171 ez['use_setuptools'](**setup_args)
172 reload(sys.modules['pkg_resources'])
173 import pkg_resources
174 # This does not (always?) update the default working set. We will
175 # do it.
176 for path in sys.path:
177 if path not in pkg_resources.working_set.entries:
178 pkg_resources.working_set.add_entry(path)
179
180cmd = [quote(sys.executable),
181 '-c',
182 quote('from setuptools.command.easy_install import main; main()'),
183 '-mqNxd',
184 quote(eggs_dir)]
185
186if not has_broken_dash_S:
187 cmd.insert(1, '-S')
188
189find_links = options.download_base
190if not find_links:
191 find_links = os.environ.get('bootstrap-testing-find-links')
192if find_links:
193 cmd.extend(['-f', quote(find_links)])
194
195if options.use_distribute:
196 setup_requirement = 'distribute'
197else:
198 setup_requirement = 'setuptools'
199ws = pkg_resources.working_set
200setup_requirement_path = ws.find(
201 pkg_resources.Requirement.parse(setup_requirement)).location
202env = dict(
203 os.environ,
204 PYTHONPATH=setup_requirement_path)
205
206requirement = 'zc.buildout'
207version = options.version
208if version is None and not options.accept_buildout_test_releases:
209 # Figure out the most recent final version of zc.buildout.
210 import setuptools.package_index
211 _final_parts = '*final-', '*final'
212 def _final_version(parsed_version):
213 for part in parsed_version:
214 if (part[:1] == '*') and (part not in _final_parts):
215 return False
216 return True
217 index = setuptools.package_index.PackageIndex(
218 search_path=[setup_requirement_path])
219 if find_links:
220 index.add_find_links((find_links,))
221 req = pkg_resources.Requirement.parse(requirement)
222 if index.obtain(req) is not None:
223 best = []
224 bestv = None
225 for dist in index[req.project_name]:
226 distv = dist.parsed_version
227 if _final_version(distv):
228 if bestv is None or distv > bestv:
229 best = [dist]
230 bestv = distv
231 elif distv == bestv:
232 best.append(dist)
233 if best:
234 best.sort()
235 version = best[-1].version
236if version:
237 requirement = '=='.join((requirement, version))
238cmd.append(requirement)
239
240if is_jython:
241 import subprocess
242 exitcode = subprocess.Popen(cmd, env=env).wait()
243else: # Windows prefers this, apparently; otherwise we would prefer subprocess
244 exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env]))
245if exitcode != 0:
246 sys.stdout.flush()
247 sys.stderr.flush()
248 print ("An error occurred when trying to install zc.buildout. "
249 "Look above this message for any errors that "
250 "were output by easy_install.")
251 sys.exit(exitcode)
252
253ws.add_entry(eggs_dir)
254ws.require(requirement)
255import zc.buildout.buildout
256zc.buildout.buildout.main(args)
257if not options.eggs: # clean up temporary egg directory
258 shutil.rmtree(eggs_dir)
2590
=== removed file 'buildout.cfg'
--- buildout.cfg 2017-09-23 03:13:41 +0000
+++ buildout.cfg 1970-01-01 00:00:00 +0000
@@ -1,53 +0,0 @@
1# Copyright 2009-2017 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
7 tags
8unzip = true
9eggs-directory = eggs
10download-cache = download-cache
11relative-paths = true
12
13# Disable this option temporarily if you want buildout to find software
14# dependencies *other* than those in our download-cache. Once you have the
15# desired software, reenable this option (and check in the new software to
16# lp:lp-source-dependencies if this is going to be reviewed/merged/deployed.)
17install-from-cache = true
18
19# This also will need to be temporarily disabled or changed for package
20# upgrades. Newly-added packages should also add their desired version number
21# to versions.cfg.
22extends = versions.cfg
23
24allow-picked-versions = false
25
26prefer-final = true
27
28develop = .
29
30[configuration]
31instance_name = development
32
33[scripts]
34recipe = z3c.recipe.scripts
35eggs = lp
36 celery
37 jsautobuild
38 lazr.jobrunner
39 lpjsmin
40 pyinotify
41 zc.zservertracelog
42include-site-packages = true
43allowed-eggs-from-site-packages =
44interpreter = py
45# Note that any indentation is lost in initialization blocks.
46initialization =
47 # See buildout.cfg, [scripts] section, "initialization" key.
48 from lp_sitecustomize import main
49 main('${configuration:instance_name}') # Initializes LP environment.
50
51[tags]
52recipe = z3c.recipe.tag:tags
53eggs = lp
540
=== removed file 'bzr-trunk-buildout.cfg'
--- bzr-trunk-buildout.cfg 2009-07-24 03:39:09 +0000
+++ bzr-trunk-buildout.cfg 1970-01-01 00:00:00 +0000
@@ -1,12 +0,0 @@
1# A custom buildout.cfg file for testing against a newer bzr.
2# Checkout or symlink the new bzr as 'bzr.dev' in the root of the
3# launchpad tree then run 'make BUILDOUT_CFG=bzr-trunk-buildout.cfg'.
4
5[buildout]
6extends = buildout.cfg
7
8develop = .
9 bzr.dev
10
11[versions]
12bzr =
130
=== modified file 'bzrplugins/lpserve/test_lpserve.py'
--- bzrplugins/lpserve/test_lpserve.py 2014-01-30 09:58:18 +0000
+++ bzrplugins/lpserve/test_lpserve.py 2017-12-19 09:48:36 +0000
@@ -1,4 +1,4 @@
1# Copyright 2010-2011 Canonical Ltd. This software is licensed under the1# Copyright 2010-2017 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4import errno4import errno
@@ -24,7 +24,6 @@
24 get_bzr_path,24 get_bzr_path,
25 get_BZR_PLUGIN_PATH_for_subprocess,25 get_BZR_PLUGIN_PATH_for_subprocess,
26 )26 )
27from lp.services.config import config
28from lp.testing.fakemethod import FakeMethod27from lp.testing.fakemethod import FakeMethod
2928
3029
@@ -319,10 +318,6 @@
319 same as the bzrlib.tests.TestCase version.318 same as the bzrlib.tests.TestCase version.
320 """319 """
321320
322 def get_python_path(self):
323 """Return the path to the Python interpreter."""
324 return '%s/bin/py' % config.root
325
326 def start_bzr_subprocess(self, process_args, env_changes=None,321 def start_bzr_subprocess(self, process_args, env_changes=None,
327 working_dir=None):322 working_dir=None):
328 """Start bzr in a subprocess for testing.323 """Start bzr in a subprocess for testing.
@@ -353,15 +348,12 @@
353 cwd = osutils.getcwd()348 cwd = osutils.getcwd()
354 os.chdir(working_dir)349 os.chdir(working_dir)
355350
356 # LAUNCHPAD: Because of buildout, we need to get a custom Python
357 # binary, not sys.executable.
358 python_path = self.get_python_path()
359 # LAUNCHPAD: We can't use self.get_bzr_path(), since it'll find351 # LAUNCHPAD: We can't use self.get_bzr_path(), since it'll find
360 # lib/bzrlib, rather than the path to sourcecode/bzr/bzr.352 # lib/bzrlib, rather than the path to bin/bzr.
361 bzr_path = get_bzr_path()353 bzr_path = get_bzr_path()
362 try:354 try:
363 cleanup_environment()355 cleanup_environment()
364 command = [python_path, bzr_path]356 command = [bzr_path]
365 command.extend(process_args)357 command.extend(process_args)
366 process = self._popen(358 process = self._popen(
367 command, stdin=subprocess.PIPE, stdout=subprocess.PIPE,359 command, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
368360
=== added file 'constraints.txt'
--- constraints.txt 1970-01-01 00:00:00 +0000
+++ constraints.txt 2017-12-19 09:48:36 +0000
@@ -0,0 +1,356 @@
1# ztk-versions.cfg from ZTK 1.1.6, with some upgrades
2# ---------------------------------------------------
3
4zope.annotation==3.6.0
5zope.applicationcontrol==3.5.5
6zope.authentication==3.7.1
7zope.broken==3.6.0
8zope.browser==1.3
9zope.browsermenu==3.9.1
10zope.browserpage==3.12.2
11zope.browserresource==3.12.0
12zope.cachedescriptors==3.5.1
13zope.catalog==3.8.2
14#zope.component==3.10.0
15# Tell pip about extras to work around https://github.com/pypa/pip/issues/3046
16# XXX cjwatson 2017-09-03: This should be fixed in pip 9.0.0, but apparently
17# isn't.
18# Upgrade from ZTK 1.1.6 for ZCML registration performance.
19zope.component[hook,zcml]==3.11.0
20zope.componentvocabulary==1.0.1
21zope.configuration==3.7.4
22zope.container==3.12.0
23zope.contentprovider==3.7.2
24zope.contenttype==3.5.5
25zope.copy==3.5.0
26zope.copypastemove==3.8.0
27zope.datetime==3.4.1
28zope.deferredimport==3.5.3
29zope.deprecation==3.4.1
30zope.dottedname==3.4.6
31zope.dublincore==3.8.2
32zope.error==3.7.4
33zope.event==3.5.2
34zope.exceptions==3.6.2
35zope.filerepresentation==3.6.1
36zope.formlib==4.0.6
37zope.hookable==3.4.1
38zope.i18n==3.7.4
39zope.i18nmessageid==3.5.3
40zope.index==3.6.4
41#zope.interface==3.7.0
42# Upgrade from ZTK 1.1.6 for ZCML registration performance.
43zope.interface==4.4.3
44zope.intid==3.7.2
45zope.keyreference==3.6.4
46zope.lifecycleevent==3.6.2
47zope.location==3.9.1
48zope.login==1.0.0
49zope.mimetype==1.3.1
50zope.minmax==1.1.2
51#zope.pagetemplate==3.5.2
52# Build of lp:~wallyworld/zope.pagetemplate/fix-isinstance
53# p1 This version adds a small change to the traversal logic so that the
54# optimisation which applies if the object is a dict also works for
55# subclasses of dict. This patch has been merged in 4.2.0, so we can
56# drop it when we upgrade.
57# post2 Cherry-pick zope.security [untrustedpython] dependency from 3.5.1.
58# Use PEP 440-compliant version.
59zope.pagetemplate==3.5.0.post2
60zope.password==3.6.1
61zope.pluggableauth==1.2
62zope.principalannotation==3.6.1
63zope.principalregistry==3.7.1
64zope.processlifetime==1.0
65zope.proxy==3.6.1
66zope.ptresource==3.9.0
67zope.publisher==3.12.6
68zope.ramcache==1.0
69zope.schema==3.7.1
70#zope.security==3.8.3
71# Tell pip about extras to work around https://github.com/pypa/pip/issues/3046
72# XXX cjwatson 2017-09-03: This should be fixed in pip 9.0.0, but apparently
73# isn't.
74zope.security[untrustedpython]==3.8.3
75zope.securitypolicy==3.7.0
76zope.sendmail==3.7.5
77zope.sequencesort==3.4.0
78zope.server==3.8.6
79#zope.session==3.9.5
80# XXX: downgraded to avoid 3.9.2 cookie calculation changes
81zope.session==3.9.1
82zope.site==3.9.2
83zope.size==3.4.1
84zope.structuredtext==3.5.1
85zope.tal==3.5.2
86zope.tales==3.5.3
87#zope.testing==3.10.3
88# p1 Build of lp:~mars/zope.testing/3.9.4-p1. Fixes bugs 570380 and 587886.
89# p2 With patch for thread leaks to make them skips, fixes windmill errors
90# with 'new threads' in hudson/ec2 builds.
91# p3 And always tear down layers, because thats the Right Thing To Do.
92# p4 fixes --subunit --list to really just list the tests.
93# p5 Build of lp:~launchpad/zope.testing/3.9.4-p5. Fixes bug #609986.
94# p6 reinstates fix from p4. Build of lp:~launchpad/zope.testing/3.9.4-fork
95# revision 26.
96# p7 was unused
97# p8 redirects stdout and stderr to a black hole device when --subunit is used
98# p9 adds the redirection of __stderr__ to a black hole device
99# p10 changed the test reporting to use test.id() rather than
100# str(test) since only the id is unique.
101# p11 reverts p9.
102# p12 reverts p11, restoring p9.
103# p13 Add a new --require-unique flag to the testrunner. When set,
104# this will cause the testrunner to check all tests IDs to ensure they
105# haven't been loaded before. If it encounters a duplicate, it will
106# raise an error and quit.
107# p14 Adds test data written to stderr and stdout into the subunit output.
108# p15 Fixed internal tests.
109# p16 Adds support for skips in Python 2.7.
110# p17 Fixes skip support for Python 2.6.
111# To build (use Python 2.6) run "python bootstrap.py; ./bin/buildout". Then to
112# build the distribution run "bin/buildout setup . sdist"
113# Make sure you have subunit installed.
114zope.testing==3.9.4-p17
115zope.testrunner==4.0.4
116zope.traversing==3.14.0
117zope.viewlet==3.7.2
118
119# Deprecating
120
121# Dependencies
122#distribute==0.6.36
123distribute==0.7.3
124docutils==0.7
125Jinja2==2.5.5
126mechanize==0.2.5
127Paste==1.7.5.1
128PasteDeploy==1.3.4
129PasteScript==1.7.5
130py==1.4.8
131#Pygments==1.4
132Pygments==1.6
133python-gettext==1.0
134#python-subunit==0.0.7
135python-subunit==0.0.8beta
136#pytz==2014.10
137pytz==2017.2
138RestrictedPython==3.6.0
139#setuptools==0.6c11
140setuptools==36.4.0
141Sphinx==1.0.8
142#testtools==0.9.12
143testtools==0.9.30
144transaction==1.1.1
145z3c.recipe.sphinxdoc==0.0.8
146zc.buildout==1.7.1
147zc.lockfile==1.0.2
148#ZConfig==2.8.0
149ZConfig==2.9.1dev-20110728
150zc.recipe.egg==1.3.2
151zc.recipe.testrunner==1.4.0
152zc.resourcelibrary==1.3.4
153zdaemon==2.0.7
154ZODB3==3.10.5
155zope.mkzeoinstance==3.9.5
156
157# toolchain
158#argparse==1.1
159argparse==1.2.1
160coverage==3.5.2
161lxml==2.2.8
162mr.developer==1.25
163nose==1.1.2
164tl.eggdeps==0.4
165z3c.checkversions==0.4.1
166z3c.recipe.compattest==0.13.1
167z3c.recipe.depgraph==0.5
168z3c.recipe.scripts==1.0.1
169zope.kgs==1.2.0
170
171# zopeapp-versions.cfg from ZTK 1.1.6, with some upgrades
172# -------------------------------------------------------
173
174# ZopeApp
175zc.sourcefactory==0.7.0
176zope.app.applicationcontrol==3.5.10
177zope.app.appsetup==3.15.0
178zope.app.debug==3.4.1
179zope.app.http==3.9.0
180zope.app.publication==3.12.0
181zope.app.wsgi==3.10.0
182zope.testbrowser==3.10.4
183
184# Deprecated
185roman==1.4.0
186#wsgi-intercept==0.4
187# Upgrade from ZTK 1.1.5 to intercept lazr.restfulclient.
188wsgi-intercept==0.5.1
189zope.app.authentication==3.9.0
190zope.app.basicskin==3.5.1
191zope.app.broken==3.6.0
192zope.app.component==3.9.3
193zope.app.container==3.9.2
194zope.app.content==3.5.1
195zope.app.dependable==3.5.1
196zope.app.error==3.5.3
197zope.app.exception==3.6.3
198zope.app.folder==3.5.2
199zope.app.form==4.0.2
200zope.app.generations==3.7.1
201zope.app.i18n==3.6.4
202zope.app.locales==3.6.2
203zope.app.localpermission==3.7.2
204zope.app.pagetemplate==3.11.2
205zope.app.principalannotation==3.7.0
206zope.app.publisher==3.10.2
207zope.app.renderer==3.5.1
208zope.app.rotterdam==3.5.3
209zope.app.schema==3.5.0
210zope.app.security==3.7.5
211zope.app.testing==3.8.1
212zope.app.zcmlfiles==3.7.1
213zope.app.zopeappgenerations==3.6.1
214zope.generations==3.7.1
215
216# Launchpad
217# ---------
218
219# Alphabetical, case-insensitive, please! :-)
220
221# lp:~launchpad/ampoule/lp
222# post1 Don't add a process back to the ready set if it received an error
223# such as a timeout.
224ampoule==0.2.0.post1
225amqp==1.4.9
226amqplib==1.0.2
227anyjson==0.3.3
228auditor==0.0.3
229auditorclient==0.0.4
230auditorfixture==0.0.7
231backports.lzma==0.0.3
232BeautifulSoup==3.2.1
233billiard==3.3.0.20
234bson==0.3.3
235bzr==2.6.0.lp.2
236celery==3.1.18
237Chameleon==2.11
238cssselect==0.9.1
239cssutils==0.9.10
240d2to1==0.2.12
241Django==1.4
242dkimpy==0.5.4
243# Required by dkimpy
244dnspython==1.10.0
245elementtree==1.2.6-20050316
246epydoc==3.0.1
247extras==0.0.3
248feedparser==4.1
249feedvalidator==0.0.0DEV-r1049
250fixtures==0.3.9
251FormEncode==1.2.4
252grokcore.component==1.6
253html5browser==0.0.9
254httmock==1.2.3
255httplib2==0.8
256importlib==1.0.2
257ipython==0.13.2
258iso8601==0.1.4
259jsautobuild==0.2
260keyring==0.6.2
261kombu==3.0.30
262launchpad-buildd==157
263launchpadlib==1.10.5
264lazr.authentication==0.1.1
265lazr.batchnavigator==1.2.11
266lazr.config==2.2.1
267lazr.delegates==2.0.4
268lazr.enum==1.1.3
269lazr.jobrunner==0.13
270lazr.lifecycle==1.1
271lazr.restful==0.20.0
272lazr.restfulclient==0.13.2
273lazr.smtptest==1.3
274lazr.sshserver==0.1.3
275lazr.testing==0.1.1
276lazr.uri==1.0.3
277libnacl==1.3.6
278lpjsmin==0.5
279manuel==1.7.2
280Markdown==2.3.1
281martian==0.11
282meliae==0.2.0.final.0
283mock==1.0.1
284mocker==1.1.1
285oauth==1.0
286oops==0.0.13
287oops-amqp==0.0.8b1
288oops-datedir-repo==0.0.23
289oops-timeline==0.0.1
290oops-twisted==0.0.7
291oops-wsgi==0.0.8
292ordereddict==1.1
293oslo.config==1.1.1
294paramiko==1.7.7.2
295pbr==0.5.20
296pgbouncer==0.0.8
297prettytable==0.7.2
298psycopg2==2.6.1
299pyasn1==0.1.6
300pycrypto==2.6
301pygpgme==0.2
302pyinotify==0.9.4
303pymacaroons==0.9.2
304pyOpenSSL==0.13
305pystache==0.5.3
306python-dateutil==1.5
307python-debian==0.1.23
308python-keystoneclient==0.3.1
309python-memcached==1.58
310python-mimeparse==0.1.4
311# XXX: deryck 2012-08-10
312# See lp:~deryck/python-openid/python-openid-fix1034376 which
313# reapplied a patch from wgrant to get codehosting going again.
314python-openid==2.2.5-fix1034376
315python-swiftclient==1.5.0
316PyYAML==3.10
317rabbitfixture==0.3.6
318requests==2.7.0
319requests-toolbelt==0.6.2
320setproctitle==1.1.7
321setuptools-git==1.2
322simplejson==3.8.2
323SimpleTAL==4.3
324six==1.9.0
325soupmatchers==0.2
326# lp:~launchpad-committers/storm/with-without-datetime
327storm==0.19.0.99-lpwithnodatetime-r408
328subprocess32==3.2.6
329subvertpy==0.9.1
330testresources==0.2.7
331testscenarios==0.4
332timeline==0.0.3
333# Build of lp:~canonical-launchpad-branches/twisted:lp-backport.
334# p1 Support diffie-hellman-group14-sha1 key exchange in conch.ssh.
335# p2 Add diffie-hellman-group-exchange-sha256 to twisted.conch.ssh.
336# Add support in twisted.conch.ssh for hmac-sha2-256 and hmac-sha2-512.
337# post3 Use PEP 440-compliant version.
338Twisted==13.0.0post3
339txAMQP==0.6.2
340txfixtures==0.1.4
341txlongpoll==0.2.12
342txlongpollfixture==0.1.3
343txpkgupload==0.2
344unittest2==0.5.1
345van.testing==3.0.0
346virtualenv-tools3==2.0.0
347wadllib==1.3.2
348wheel==0.29.0
349wsgiref==0.1.2
350z3c.pt==2.2.3
351z3c.ptcompat==0.5.7
352zc.zservertracelog==1.3.2
353# Not in ZTK 1.1.5
354zope.app.server==3.6.0
355# Not in ZTK 1.1.5 (extracted from zope.app.schema)
356zope.vocabularyregistry==1.0.0
0357
=== modified file 'doc/index.txt'
--- doc/index.txt 2011-03-31 16:41:05 +0000
+++ doc/index.txt 2017-12-19 09:48:36 +0000
@@ -27,7 +27,7 @@
27.. toctree::27.. toctree::
28 :maxdepth: 128 :maxdepth: 1
2929
30 buildout30 pip
3131
32Possibly out-of-date32Possibly out-of-date
33--------------------33--------------------
3434
=== renamed file 'doc/buildout.txt' => 'doc/pip.txt'
--- doc/buildout.txt 2017-11-18 09:49:07 +0000
+++ doc/pip.txt 2017-12-19 09:48:36 +0000
@@ -1,9 +1,8 @@
1Launchpad Buildout1Launchpad pip integration
2******************2*************************
33
4Launchpad uses the buildout_ (or "zc.buildout") build system.4Launchpad uses the pip_ build system for managing Python packages (replacing
5Buildout's biggest strength is managing Python packages. That is also5`zc.buildout`, which we used for many years).
6our focus for it.
76
8We have at least two other ways of managing dependencies. Apt7We have at least two other ways of managing dependencies. Apt
9manages our Python language installation, as well as many of our8manages our Python language installation, as well as many of our
@@ -12,151 +11,15 @@
12supposed to only contain dependencies that are not standard Python11supposed to only contain dependencies that are not standard Python
13packages. bzr plugins and Javascript libraries are existing examples.12packages. bzr plugins and Javascript libraries are existing examples.
1413
15If you are not interested in our `Motivations`_ or in an `Introduction to14All developers will at least want to read the very brief sections about the
16zc.buildout`_, all developers will at least want to read the very brief15`Set Up`_ and the `Everyday Usage`_.
17sections about the `Set Up`_ and the `Everyday Usage`_.
1816
19Developers who manage source dependencies probably should read the general17Developers who manage source dependencies probably should read the general
20information about `Managing Dependencies and Scripts`_, but will also find18information about `Managing Dependencies and Scripts`_, but will also find
21detailed instructions to `Add a Package`_, to `Upgrade a Package`_, to `Add a19detailed instructions to `Add a Package`_, to `Upgrade a Package`_, to `Add a
22Script`_, and to `Work with Unreleased or Forked Packages`_.20Script`_, and to `Work with Unreleased or Forked Packages`_.
2321
24.. _buildout: http://www.buildout.org/22.. _pip: https://pip.pypa.io/
25
26===========
27Motivations
28===========
29
30These motivations are labeled as "[INTERNAL]" or "[EXTERNAL]" to indicate
31whether it is pertinent for internal dependencies, which we on the Launchpad
32team create and release ourselves; or external dependencies, which other
33parties, in and out of Canonical, create and release.
34
35* We want more careful specification of our dependencies across branches.
36 [INTERNAL] [EXTERNAL]
37
38 This is a real concern pertinent both for our "trunks" (devel,
39 stable, db-devel, db-stable) and for our development boxes. For
40 instance, before incorporating buildout, in our trunks, when we want
41 to update a dependency, we needed to make sure that *all* the
42 current Launchpad trunks work with the dependency initially; then
43 submit a new Launchpad branch that uses the change dependency. A
44 mistake can even potentially break one or both of the db-* trunks,
45 since PQM only tests against one branch (usually devel), and
46 sourcecode changes affect all branches at once. For simplicity,
47 speed, and safety, we want to be able to submit a single branch that
48 incorporates the source dependencies and the associated changes at
49 once.
50
51 This is also true, if less critical and easier to work around, on developer
52 boxes. Without care, changes to sourcecode when working on dependencies will
53 affect all a developer's branches, polluting test results with false
54 negatives or false positives.
55
56* We want to default to using released versions of our software dependencies.
57 [EXTERNAL]
58
59 A significant number of projects do not always have a pristine trunk, and
60 many also spend extra effort on polish, bug fixes, and compatibility before a
61 release. If we do not desperately need a new feature on trunk, using a
62 release is generally regarded as a safer, better practice. Our earlier usage
63 of bzr branches of the development trunks does not encourage this practice.
64
65* We want to be encouraged to make the effort to interact with upstream
66 projects to have our patches integrated. [EXTERNAL]
67
68 Interacting and negotiating with upstream is undeniably more
69 time-consuming than our previous practice of maintaining local bzr
70 branches with our patches, especially short-term. But our previous
71 use of bzr branches is not good open-source community behaviour--an
72 ironic characteristic for a project like Launchpad. It also can
73 cause problems down the road, for instance, if the patch becomes
74 stale and we want to migrate to new releases.
75
76* We want to be protected from changes and differences in our operating system.
77 [INTERNAL] [EXTERNAL]
78
79 This is a concern both over time and across different Launchpad environments.
80
81 First, our operating system, Ubuntu, is driven by many needs and
82 goals. Launchpad is among them, but generally Launchpad serves
83 Ubuntu, not the reverse. For instance, Jaunty dropped Launchpad's
84 Python version. The Ubuntu developers had good reason--Python 2.4
85 has not been supported by the Python developers for some time--but
86 it caused a significant inconvenience to the Launchpad
87 team. Managing our dependencies, particularly the Python library
88 dependencies, can help alleviate these problems.
89
90 Second, Launchpad developers run a significantly different version of the
91 operating system than that run in production. Maintaining our Python library
92 dependencies ourselves can also help alleviate these concerns.
93
94* We want to be able to easily use standard packages of our primary
95 programming language, Python. [EXTERNAL]
96
97 Our Python library dependencies are distributed for many operating systems--
98 Windows, Mac, and other flavors of Linux--in a unified location and format:
99 PyPI, using distutils. Using Python library dependencies in their standard
100 distributions makes it easier for us to reuse code.
101
102* We want to be encouraged to release Python packages of our open-source
103 code. [INTERNAL]
104
105 We are beginning to realize our aspirations of abstracting and releasing some
106 of our code. Much of that code is in Python. Consuming standard Python
107 packages encourages us to follow good practice in releasing our own Python
108 packages. Dogfooding can help keep us honest, and good official releases can
109 help us support and encourage a community of users.
110
111Meanwhile, we want to be able to keep certain aspects of the legacy story.
112
113* We need deployment to not need network access.
114
115* We need to be able to use custom releases of our Python dependencies, if
116 absolutely necessary.
117
118* We would like to be able to follow security releases in our operating system.
119
120We will be able to support the first two of these aspects entirely.
121
122As to the third, we will continue to follow operating system security releases
123for most or all of the dependencies that are not Python packages--a very
124similar situation to the one before Buildout integration.
125
126===========================
127Introduction to zc.buildout
128===========================
129
130Buildout is a relatively simple system that increases in complexity as it is
131extended via "recipes". It works on top of distutils_ and setuptools_. It
132uses declarative ini-style files to direct its work. The `Buildout site`_
133points to a variety of documents describing and documenting its use.
134
135For Launchpad, Buildout is hidden behind a Makefile as of this writing. If
136the Makefile is removed, developers will typically run ``bootstrap.py`` in the
137branch, and then run ``bin/buildout``. After that, the ``bin`` directory will
138have the commands to start, stop, test, and debug the software. If you are
139interested in example direct usage of Buildout, you may want to read `the
140"Hacking" document in the Launchpad wiki`_ that describes the usage patterns in
141``lazr.*`` packages.
142
143.. _`the "Hacking" document in the Launchpad wiki`: https://dev.launchpad.net/Hacking
144
145Launchpad's Buildout usage is roughly of medium complexity. It is more
146complex than that needed by a package with few dependencies and simple usage
147(see lazr.uri, for instance), but less complex than that of other large
148applications that use the buildout system. More complexity can come by
149building more non-Python tools and by having multiple configuration variations,
150for instance.
151
152The documentation below will focus on using Launchpad's buildout. See the
153links given above for a more thorough general review.
154
155.. _distutils: http://docs.python.org/distutils/index.html
156
157.. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools
158
159.. _`Buildout site`: http://www.buildout.org/
16023
161======24======
162Set Up25Set Up
@@ -192,21 +55,20 @@
192======================55======================
19356
194If you typically use ``rocketfuel-get``, and you don't change source57If you typically use ``rocketfuel-get``, and you don't change source
195dependencies, you should not have any further changes, except that ``bin/test``58dependencies, then you don't need to know any more. ``rocketfuel-branch``
196has replaced ``test.py``. ``rocketfuel-branch`` and59and ``link-external-dependencies`` will Do the Right Thing.
197``link-external-dependencies`` will Do the Right Thing.
19860
199Manual61Manual
200======62======
20163
202If you don't use the rocketfuel scripts, you will still use64If you don't use the rocketfuel scripts, you will still use
203``link-external-dependencies`` as before. When a buildout complains that it65``link-external-dependencies`` as before. When ``pip`` complains that it
204cannot find a version of a dependency, do the following, from within the66cannot find a version of a dependency, do the following, from within the
205branch::67branch::
20668
207 git -C download-cache pull69 git -C download-cache pull
20870
209After this, retry your make (or run ``bin/buildout`` from the branch).71After this, retry your ``make``.
21072
211That's it for everyday usage.73That's it for everyday usage.
21274
@@ -220,120 +82,42 @@
22082
221First let's talk a little about the anatomy of what we have set up. To be83First let's talk a little about the anatomy of what we have set up. To be
222clear, much of this is based on our own decisions of what to do. If you see84clear, much of this is based on our own decisions of what to do. If you see
223something problematic, bring it up with the Foundations team. Maybe together85something problematic, bring it up with other Launchpad developers. Maybe
224we can come up with another approach that meets our needs better.86together we can come up with another approach that meets our needs better.
22587
226If you saw the top-level Launchpad directory before we started using Buildout,88These are the items in the top-level Launchpad directory associated with
227you might notice seven new items in the checkout.89pip:
228
229``bootstrap.py``
230 This is the standard bootstrapping file provided by the Buildout
231 distribution. As of this writing, the Makefile uses this file, and you do
232 not have to modify it or call it directly.
233
234 Without a Makefile, the first step of developing a source tree that uses
235 Buildout is to run this file in the top level directory with the Python
236 executable that you wish to use for the source tree. It creates a ``bin``
237 directory, if it does not already exist, and puts a ``buildout`` executable
238 there. The next step is to run ``bin/buildout``, which, unless you supply
239 a ``-c`` option to specify a configuration file, will look for a
240 buildout.cfg file by default to discover what to do.
241
242 Again, as of this writing, the Makefile uses this file, and it does not
243 need to be modified, so you need not concern yourself with it further at
244 this time.
245
246``ez_setup.py``
247 This is another standard file from another project. In this case, it is
248 the file provided by the setuptools project to install setuptools. It is
249 used by the ``setup.py`` file, described below. It does not need to be
250 modified or called directly.
25190
252``setup.py``91``setup.py``
253 This is the file that uses ``distutils``, extended by ``setuptools``, to92 This is the file that uses ``distutils``, extended by ``setuptools``, to
254 specify direct dependencies, scripts, and other elements of the local93 specify direct dependencies, scripts, and other elements of the local
255 source tree.94 source tree.
25695
257 Buildout uses it, but the reverse is not true: ``setup.py`` does not know96 pip uses it, but the reverse is not true: ``setup.py`` does not know
258 about Buildout. This means that packages that use Buildout for development97 about pip.
259 do not have to require it when they are being installed in other software
260 as a dependency.
26198
262 Describing this file in full is well beyond the scope of this document. We99 Describing this file in full is well beyond the scope of this document. We
263 will give recipes for modifying it for certain tasks below. For more100 will give recipes for modifying it for certain tasks below. For more
264 information beyond these recipes, see the setuptools and distutils101 information beyond these recipes, see the setuptools and distutils
265 documentation.102 documentation.
266103
267``buildout.cfg``104``pip-requirements.txt``
268 This is the default configuration file that ``bin/buildout`` will look to105 This is a `requirements file`_ used to upgrade pip itself to a
269 for instructions.106 reasonably recent version. We use this so that we aren't confined to
270107 features of pip supported by the version supplied by the operating
271 Describing it in full is well beyond the scope of this document. However,108 system.
272 we will give an overview here.109
273110``constraints.txt``
274 Configuration files for Buildout are comprised of sections with key-value111 This is a `constraints file`_ that specifies the precise versions of the
275 pairs.112 dependencies we use. This means that we can have several versions of a
276113 dependency available locally, but we only build the precise one we
277 The key-value pairs are separated with new lines, when the subsequent line114 specify. We give an example of its use below.
278 is not indented. The key and value are each separated with an equals sign.115
279116``env``
280 ::117 The ``env`` directory holds a virtualenv built from the downloaded
281118 distributions. You have one of these per branch (virtualenvs do not
282 foo = bar119 relocate especially well). This directory is local to your system--we
283 baz = bing120 do not manage it in a branch.
284 bah
285 boo
286 sha = zam
287
288 That example shows three keys, 'foo', 'baz', and 'sha'. The 'baz' key has
289 a string with two new lines (which might be interpreted one several ways,
290 as defined for that key).
291
292 The ``[buildout]`` section is the starting point for Buildout to determine
293 what to do. It looks for an ``extends`` key to find any additional files
294 to merge in; we use this for ``versions.cfg``, discussed below.
295
296 In addition to general configuration and initialization such as this, it
297 looks in the ``develop`` key to find source trees to develop as part of the
298 buildout. In the standard Launchpad configuration, we develop only
299 Launchpad itself (the current directory, or '.'). This means that the
300 local ``setup.py`` will be run. If you want to develop Launchpad while you
301 develop another dependency, you can link another source tree in, and
302 specify an additional ``develop`` directory in another line::
303
304 [buildout]
305 develop = .
306 lazr_uri_branch
307
308 See `Developing a Dependent Library In Parallel`_ for more on this.
309
310 The other basic key in the ``[buildout]`` section that we'll highlight here
311 is ``parts``. This key identifies the other sections in buildout.cfg that
312 will be processed. A section that is not identified in the ``[buildout]``
313 sections ``parts`` key will usually be ignored (unless chosen for another
314 role by another key elsewhere).
315
316 Sections other than ``[buildout]`` that are specified as parts always must
317 specify a ``recipe``: an identifier that determines what code should
318 process that section. You'll see a variety of recipes in Launchpad's
319 buildout.cfg, including ``zc.recipe.egg`` and others.
320
321``versions.cfg``
322 As mentioned above, ``buildout.cfg`` extends ``versions.cfg`` by
323 specifying it in the ``extends`` key of the ``[buildout]`` section.
324 Versions.cfg specifies the precise versions of the dependencies we use.
325 This means that we can have several versions of a dependency available
326 locally, but we only build the precise one we specify. We give an
327 example of its use below. To read about the mechanism used, see the
328 zc.buildout documentation of the ``versions`` option in the ``[buildout]``
329 section.
330
331``eggs``
332 The ``eggs`` directory holds the eggs built from the downloaded
333 distributions. Unless you set it up differently yourself, this directory is
334 shared by all your branches. This directory is local to your system--we do
335 not manage it in a branch. One reason for this is that eggs are often
336 platform-specific.
337121
338``download-cache``122``download-cache``
339 The ``download-cache`` directory is a set of downloaded distributions--that123 The ``download-cache`` directory is a set of downloaded distributions--that
@@ -342,20 +126,19 @@
342 download cache as a shared resource across all of our developers with a git126 download cache as a shared resource across all of our developers with a git
343 branch in a Launchpad project called ``lp-source-dependencies``.127 branch in a Launchpad project called ``lp-source-dependencies``.
344128
345 When we run buildout, Buildout reads a special key and value in the129 We run pip with the ``--no-index`` and ``--find-links`` options, which
346 ``[buildout]`` section: ``install-from-cache = true``. This means that, by130 cause it to *not* use network access to find packages, but *only* look
347 default, Buildout will *not* use network access to find packages, but131 in the download cache. This has many advantages.
348 *only* look in the download cache. This has many advantages.
349132
350 - First, it helps us keep our deployment boxes from needing network access133 - First, it helps us keep our deployment boxes from needing network access
351 out to PyPI and other download sites.134 out to PyPI and other download sites.
352135
353 - Second, it makes the buildout much faster, because it does not have to136 - Second, it makes the build much faster, because it does not have to
354 look out on the net for every dependency.137 look out on the net for every dependency.
355138
356 - Third, it makes the buildout more repeatable, because we are more139 - Third, it makes the build more repeatable, because we are more
357 insulated from outages at download sites such as PyPI, and poor release140 insulated from outages at download sites such as PyPI, and poor
358 management.141 release management.
359142
360 - Fourth, it makes our deployments more auditable, because we can tell143 - Fourth, it makes our deployments more auditable, because we can tell
361 exactly what we are deploying.144 exactly what we are deploying.
@@ -366,24 +149,25 @@
366 The downside is that adding and upgrading packages takes a small additional149 The downside is that adding and upgrading packages takes a small additional
367 step, as we'll see below.150 step, as we'll see below.
368151
369In addition to these seven listings, after you have run the Makefile (or152In addition to these directory entries, after you have run the Makefile, you
370``bin/buildout``), you will see an additional listing:153will see an additional entry:
371154
372``bin``155``bin``
373 The ``bin`` directory has already been discussed many times. After running156 The ``bin`` directory has already been discussed many times. After
374 the bootstrap.py, it holds the ``buildout`` script which can be used to157 running the build, it also holds many executables, including scripts to
375 process Buildout configuration files. In Launchpad's case, after running158 test Launchpad; to run it; to run Python or IPython with Launchpad's
376 the buildout, it also holds many executables, including scripts to test159 sourcetree and dependencies available; to run harness or iharness (with
377 Launchpad; to run it; to run Python or IPython with Launchpad's sourcetree160 IPython) with the sourcetree, dependencies, and database connections; or
378 and dependencies available; to run harness or iharness (with IPython) with161 to perform several other tasks. For now, the Makefile provides aliases
379 the sourcetree, dependencies, and database connections; or to perform162 for many of these.
380 several other tasks. For now, the Makefile provides aliases for many of163
381 these.164Now that you have an introduction to the pertinent files and directories,
382165we'll move on to trying to perform maintenance tasks. We'll discuss adding
383Now that you have an introduction to the pertinent files and directories, we'll166a dependency, upgrading a dependency, adding a script, adding an arbitrary
384move on to trying to perform tasks in the buildout. We'll discuss adding a167file, and working with unreleased packages.
385dependency, upgrading a dependency, adding a script, adding an arbitrary file,168
386and working with unreleased packages.169.. _`requirements file`: https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format
170.. _`constraints file`: https://pip.pypa.io/en/stable/user_guide/#constraints-files
387171
388Add a Package172Add a Package
389=============173=============
@@ -393,63 +177,81 @@
3931. Add the new package to the ``setup.py`` file in the ``install_requires``1771. Add the new package to the ``setup.py`` file in the ``install_requires``
394 list.178 list.
395179
396 Generally, our policy is to only set minimum version numbers in this file,180 Generally, our policy is to only set minimum version numbers in this
397 or none at all. It doesn't really matter for an application like181 file, or none at all. It doesn't really matter for an application like
398 Launchpad, but it a good rule for library packages, so we follow it for182 Launchpad, but it's a good rule for library packages, so we follow it
399 consistency. Therefore, we might simply add ``'lazr.foo'`` to183 for consistency. Therefore, we might simply add ``'lazr.foo'`` to
400 install_requires, or ``'lazr.foo >= 1.1'`` if we know that we are depending184 install_requires, or ``'lazr.foo>=1.1'`` if we know that we are
401 on features introduced in version 1.1 of lazr.foo.185 depending on features introduced in version 1.1 of lazr.foo.
402186
4032. [OPTIONAL] If you know it, add the desired version number to versions.cfg1872. [OPTIONAL] Add the desired package to the ``download-cache/dist``
404 now.188 directory.
405189
406 For instance, if you know you want lazr.foo 1.1.2, add this line to the190 You should only need to do this if the package is one that doesn't exist
407 ``[versions]`` section of ``versions.cfg``::191 on PyPI at all (which should be unusual). Otherwise, it's less
408192 error-prone to fetch the desired package from PyPI along with any new
409 lazr.foo = 1.1.2193 dependencies it may have.
410194
4113. [OPTIONAL] Add the desired distribution of lazr.foo 1.1.2 to the1953. Run the following command (or your variation)::
412 ``download-cache/dist`` directory.196
413197 bin/pip install --no-binary :all: lazr.foo
4144. Run the following command (or your variation)::198
415199 This will either produce some errors which you'll need to fix, or it
416 ./bin/buildout -v buildout:install-from-cache=false | tee out.txt | grep 'Picked'200 will succeed and finish with a line such as this::
417201
418 The first part (``./bin/buildout -v202 Successfully installed lazr-foo-1.1.2 z3c.shazam-2.0.1 zope.bar-3.6.1
419 buildout:install-from-cache=false``) will run buildout, allowing203
420 it to download source packages from the Internet to204 You can use `requirements specifiers`_ on this command line, so, for
421 ``download-cache/dist``. The second part (``tee out.txt``) will205 instance, if you already know you want lazr.foo 1.1.2, you might run
422 dump the full output to the ``out.txt`` file in case you need to206 this command instead::
423 debug a problem. The last part (``grep 'Picked'``) will filter the207
424 output so that only additional packages--dependencies of your208 bin/pip install --no-binary :all: lazr.foo==1.1.2
425 dependency--will be listed. You need to see if it means that you209
426 have dependencies, some of which may be indirect210 You may need to use the ``--ignore-installed`` option if some of the
427 dependencies. We'll see how to do this with an example. Here's an211 packages involved happen to be installed system-wide on your build
428 imaginary output::212 system, but we want to consume them as Python packages. You can spot
429213 this situation by looking for output like this from ``pip install``:
430 Picked: ipython = 0.9.1214
431 Picked: lazr.foom = 1.4215 Requirement already satisfied: netaddr>=0.7.6 in /usr/lib/python2.7/dist-packages (from python-keystoneclient==0.7.1)
432 Picked: zope.bar = 3.6.1216
433 Picked: z3c.shazam = 2.0.1217 If you do this, check the output very carefully, as it can easily be
434218 wrong. (This will stop being a problem once we stop using system
435 In our example, this means that these packages have been added to219 site-packages.)
436 your ``download-cache/dist`` directory. You now need to add those220
437 versions to the ``versions.cfg`` file::2214. Add the successfully-installed packages to the shared download cache for
438222 future use.
439 ipython = 0.9.1223
440 lazr.foom = 1.4224 bin/pip download -d download-cache/dist/ --no-deps \
441 zope.bar = 3.6.1225 --no-binary :all: ...
442 z3c.shazam = 2.0.1226
443227 You'll need to copy the list of packages from the "Successfully
444 Note that the output might include at least one, and possibly228 installed" line above, replacing the ``-`` immediately before each
445 more, spurious "Picked:" listings. ipython, in particular, has229 version number with ``==`` to turn each package/version pair into a
446 shown up in the past incorrectly--that is, when you try to add the230 requirements specifier. So, in the case above, you would run:
447 file to the download-cache/dist directory, you'll discover that it231
448 is already there; and you'll see that versions.cfg already232 bin/pip download -d download-cache/dist/ --no-deps \
449 specifies the version. As long as the test passes (see step 5,233 --no-binary :all: \
450 below), you can ignore this.234 lazr-foo==1.1.2 z3c.shazam==2.0.1 zope.bar==3.6.1
451235
4525. Test.236 This will normally be able to fetch package files that were saved to
237 your ``pip`` cache directory (``~/.cache/pip/`` by default) by ``pip
238 install``, so it shouldn't need to download them from PyPI again.
239
240 We use ``--no-deps`` here because ``pip install`` has already done the
241 hard work of resolving dependencies and told us the result, and because
242 ``pip download`` doesn't consider what's currently installed and so is
243 liable to download too much otherwise.
244
2455. Add the new versions to the ``constraints.txt`` file, still using the
246 requirements specifier syntax::
247
248 lazr.foo==1.1.2
249 z3c.shazam==2.0.1
250 zope.bar==3.6.1
251
2526. Run ``make``. If it breaks, go back to step 3.
253
2547. Test.
453255
454 Note that you can tell ``ec2 test`` to include all uncommitted256 Note that you can tell ``ec2 test`` to include all uncommitted
455 distributions from the local download-cache in its tests with the257 distributions from the local download-cache in its tests with the
@@ -459,7 +261,7 @@
459 *not* explicitly tell ec2 test to include or ignore the261 *not* explicitly tell ec2 test to include or ignore the
460 uncommitted distributions, it will refuse to start an instance.262 uncommitted distributions, it will refuse to start an instance.
461263
4626. Check old versions in the download-cache. If you are sure that2648. Check old versions in the download-cache. If you are sure that
463 they are not in use any more, *anywhere*, then remove them to save265 they are not in use any more, *anywhere*, then remove them to save
464 checkout space. More explicitly, check with the LOSAs to see if266 checkout space. More explicitly, check with the LOSAs to see if
465 they are in use in production and send an email to267 they are in use in production and send an email to
@@ -470,7 +272,7 @@
470 information by using ``git log`` on the newer (replacement)272 information by using ``git log`` on the newer (replacement)
471 download-cache/dist file for the particular package.273 download-cache/dist file for the particular package.
472274
4737. Now you need to share your package changes with the rest of the2759. Now you need to share your package changes with the rest of the
474 team. You must do this before submitting your Launchpad branch to276 team. You must do this before submitting your Launchpad branch to
475 PQM or else your branch will not build properly anywhere else,277 PQM or else your branch will not build properly anywhere else,
476 including buildbot. Commit the changes (``cd download-cache``,278 including buildbot. Commit the changes (``cd download-cache``,
@@ -482,32 +284,32 @@
482change in version number, or else very bad inconsistencies and284change in version number, or else very bad inconsistencies and
483confusion across build environments will happen.285confusion across build environments will happen.
484286
287.. _`requirements specifiers`: https://pip.pypa.io/en/stable/reference/pip_install/#requirement-specifiers
288
485289
486Upgrade a Package290Upgrade a Package
487=================291=================
488292
489Sometimes you need to upgrade a dependency. This may require additional293Sometimes you need to upgrade a dependency. This may require additional
490dependency additions or upgrades.294dependency additions or upgrades. In general, this works just like adding a
491295new package, so follow the `Add a Package`_ instructions above.
492If you already know what version you want, the simplest thing to try is to296
493modify versions.cfg to specify the new version and run steps 4, 5, and 6 of the297If you know what version you want, specify it explicitly on the ``pip
494`Add a Package`_ instructions.298install`` line.
495299
496If you don't know what version you want, but just want to see what happens when300If you don't know what version you want, but just want to see what happens
497you upgrade to the most recent revision, you can clear out the versions of the301when you upgrade to the most recent version, then omit the version and
498packages for upgrade and give it a try (that is, run steps 4, 5, and 6 of the302specify the ``--upgrade`` option to ``pip install``. Note that, when not
499`Add a Package`_ instructions). Note that, when not given an explicit version303given an explicit version number, pip prefers final releases over alpha and
500number, our buildout is set to prefer final releases over alpha and beta304beta releases. If you want to temporarily override this behaviour, use the
501releases. If you want to temporarily override this behaviour, include305``--pre`` option to ``pip``.
502``buildout:prefer-final=false`` as another argument to ``bin/buildout``.
503306
504Add a Script307Add a Script
505============308============
506309
507We often need scripts that are run in a certain environment defined by Python310We often need scripts that are run in a certain environment defined by Python
508dependencies, and sometimes even different Python executables. Several of the311dependencies, and sometimes even different Python executables. Several of the
509scripts we have are specified using the setuptools-based spelling that the312scripts we have are specified using setuptools.
510``zc.recipe.egg`` recipe supports.
511313
512For the common case, in ``setup.py``, add a string in the ``console_scripts``314For the common case, in ``setup.py``, add a string in the ``console_scripts``
513list of the ``entry_points`` argument. Here's an example string::315list of the ``entry_points`` argument. Here's an example string::
@@ -518,11 +320,6 @@
518``start_launchpad`` function in the320``start_launchpad`` function in the
519``lp.scripts.runlaunchpad`` module.321``lp.scripts.runlaunchpad`` module.
520322
521See the `zc.recipe.egg documentation`_ for more information on how to add
522scripts using this method.
523
524.. _`zc.recipe.egg documentation`: http://pypi.python.org/pypi/zc.recipe.egg
525
526Work with Unreleased or Forked Packages323Work with Unreleased or Forked Packages
527=======================================324=======================================
528325
@@ -531,110 +328,48 @@
531access. Similarly, we may require a patched or unreleased version of a package328access. Similarly, we may require a patched or unreleased version of a package
532for some purpose. Hopefully, these situations will be rare, but they do occur.329for some purpose. Hopefully, these situations will be rare, but they do occur.
533330
534While `other answers`_ are available for Buildout, our solution is to use the331At the moment, our solution is to use the download-cache. Basically, make a
535download-cache. Basically, make a custom source distribution with a unique332custom source distribution with a unique suffix in the name, and use it (and
536suffix in the name, and use it (and its version name) for the normal process of333its version name) for the normal process of adding or updating a package, as
537adding or updating a package, as described above. Because the custom package334described above. Because the custom package is in the download-cache, it
538is in the download-cache, it will be found and used.335will be found and used.
539336
540Here's an example of making a custom distribution of FeedValidator.337In general, the suffix should comply with `PEP 440`_; in the case of a
541338forked package, you should use ``lp`` as a local version identifier. For
542FeedValidator is a Subversion project. We check it out::339example, you might start by appending ``+lp1``, followed by ``+lp2`` and so
543340on for further revisions.
544 svn co http://feedvalidator.googlecode.com/svn/trunk/feedvalidator/src feedvalidator
545
546Next, we ``cd feedvalidator``, and, using a Python that has setuptools
547installed, we run the following command::
548
549 python setup.py egg_info -r -bDEV sdist
550
551For this example, imagine that the current revision of the repository is 1049.
552Because setuptools has built-in Subversion support, the command above will
553create a tar.gz in the ``dist`` directory named
554``feedvalidator-0.0.0DEV-r1049.tar.gz``. The -r option specifies that the
555subversion revision should be part of the package name. The -bDEV option
556specifies that the 'DEV' suffix should be added to the version number.
557
558We could then put the tar.gz file in Launchpad's ``download-cache/dist``
559directory, specify ``feedvalidator = 0.0.0DEV-r1049`` in the ``versions.cfg``
560file, and proceed with the usual steps to update or add a new package.
561
562If you use a bzr branch, you might use the ``-d`` option instead of the ``-r``
563option when you create the distribution. This will add the date instead of the
564revision::
565
566 python setup.py egg_info -d -bDEV sdist
567
568For instance, this might produce a distribution for the ``lazr.restful``
569project with a name like this: ``lazr.restful-0.9.1DEV-20090512.tar.gz``.
570
571See the setuptools documentation for more information about `the egg_info
572command`_.
573
574It is also possible that setup.py does not support the egg_info command and
575it is sufficient to just run the sdist command. It adds the current revision
576of the bzr branch to the version number::
577
578 python setup.py sdist
579
580For instance, this might produce a distribution for the ``testtools``
581project with a name like this: ``testtools-0.9.12-r228.tar.gz``.
582341
583.. _FeedValidator: http://feedvalidator.org/342.. _FeedValidator: http://feedvalidator.org/
584343
585.. _`other answers`: http://pypi.python.org/pypi/zc.buildoutsftp344.. _`PEP 440`: https://www.python.org/dev/peps/pep-0440/
586
587.. _`the egg_info command`: http://peak.telecommunity.com/DevCenter/setuptools#tagging-and-daily-build-or-snapshot-releases
588345
589Developing a Dependent Library In Parallel346Developing a Dependent Library In Parallel
590==========================================347==========================================
591348
592Sometimes you need to iterate on change to a library used by Launchpad349Sometimes you need to iterate on change to a library used by Launchpad that
593that is managed by buildout as an egg. You could just edit what it is in350is managed by pip. You could just edit what is in the ``env`` directory,
594the ``eggs`` directory, but it is harder to produce a patch while doing351but it is harder to produce a patch while doing this. You could instead
595this. You could instead grab a branch of the libarary and produce an egg352grab a branch of the library and produce an sdist every time you make a
596everytime you make a change and make buildout use the new egg, but this is353change and make pip use the new sdist, but this is slow.
597slow.354
598355Instead, we can use "editable mode" so that changes are picked up instantly
599buildout defaults to only using the current directory as code that will356without us having to create a distribution. For example:
600be used without creating a distribution. We can arrange for it to use other357
601paths as well, so we can use a checkout of any code we like, with changes358 bin/pip install -e /path/to/branch
602being picked up instantly without us having to create a distribution.
603
604To do this add the extra paths to the ``develop`` key in the ``[buildout]``
605section of ``buildout.cfg``::
606
607 [buildout]
608 develop = .
609 path/to/branch
610
611and re-run ``make``.
612359
613Now any changes you make in that path will be picked up, and you are free360Now any changes you make in that path will be picked up, and you are free
614to make the changes you need and test them in the Launchpad environment.361to make the changes you need and test them in the Launchpad environment.
615362
616Once you are finished you can produce a distribution as above for inclusion363Once you are finished you can produce a distribution as above for inclusion
617in to Launchpad, as well as sending your patch upstream. At that point you364in to Launchpad, as well as sending your patch upstream. At that point you
618are free to revert the configuration to only develop Launchpad. You should365are free to revert the configuration to only develop Launchpad. Make sure
619not submit your branch with this change in the configuration as it will366to test with the final distribution before submitting your branch.
620not work for others.
621
622Be aware that you may have to change the version for the package in
623``versions.cfg`` if there is a difference between the version in the
624``eggs`` directory and the one in the ``setup.py`` that you pointed to
625in the ``develop`` key.
626
627One thing to be wary of is that setuptools treats "develop eggs" created
628by this process with the same precedence as system packages. That means
629that if the version in the ``setup.py`` at the path that you put in the
630``develop`` key is the same as the version installed system wide, setuptools
631may pick the wrong one. If that happens then increase the version in
632setup.py and setuptools will take it.
633367
634=====================368=====================
635Possible Future Goals369Possible Future Goals
636=====================370=====================
637371
372- Use wheels.
638- No longer use system site-packages.373- No longer use system site-packages.
639- No longer use make.374- No longer use make.
640- Get rid of the sourcecode directory.375- Get rid of the sourcecode directory.
641376
=== removed file 'ez_setup.py'
--- ez_setup.py 2012-06-29 08:40:05 +0000
+++ ez_setup.py 1970-01-01 00:00:00 +0000
@@ -1,288 +0,0 @@
1#!python
2
3# NOTE TO LAUNCHPAD DEVELOPERS: This is a bootstrapping file from the
4# setuptools project. It is imported by our setup.py.
5
6"""Bootstrap setuptools installation
7
8If you want to use setuptools in your package's setup.py, just include this
9file in the same directory with it, and add this to the top of your setup.py::
10
11 from ez_setup import use_setuptools
12 use_setuptools()
13
14If you want to require a specific version of setuptools, set a download
15mirror, or use an alternate download directory, you can do so by supplying
16the appropriate options to ``use_setuptools()``.
17
18This file can also be run as a script to install or upgrade setuptools.
19"""
20import sys
21DEFAULT_VERSION = "0.6c11"
22DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3]
23
24md5_data = {
25 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca',
26 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb',
27 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b',
28 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a',
29 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618',
30 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac',
31 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5',
32 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4',
33 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c',
34 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b',
35 'setuptools-0.6c10-py2.3.egg': 'ce1e2ab5d3a0256456d9fc13800a7090',
36 'setuptools-0.6c10-py2.4.egg': '57d6d9d6e9b80772c59a53a8433a5dd4',
37 'setuptools-0.6c10-py2.5.egg': 'de46ac8b1c97c895572e5e8596aeb8c7',
38 'setuptools-0.6c10-py2.6.egg': '58ea40aef06da02ce641495523a0b7f5',
39 'setuptools-0.6c11-py2.3.egg': '2baeac6e13d414a9d28e7ba5b5a596de',
40 'setuptools-0.6c11-py2.4.egg': 'bd639f9b0eac4c42497034dec2ec0c2b',
41 'setuptools-0.6c11-py2.5.egg': '64c94f3bf7a72a13ec83e0b24f2749b2',
42 'setuptools-0.6c11-py2.6.egg': 'bfa92100bd772d5a213eedd356d64086',
43 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27',
44 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277',
45 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa',
46 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e',
47 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e',
48 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f',
49 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2',
50 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc',
51 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167',
52 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64',
53 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d',
54 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20',
55 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab',
56 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53',
57 'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2',
58 'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e',
59 'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372',
60 'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902',
61 'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de',
62 'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b',
63 'setuptools-0.6c9-py2.3.egg': 'a83c4020414807b496e4cfbe08507c03',
64 'setuptools-0.6c9-py2.4.egg': '260a2be2e5388d66bdaee06abec6342a',
65 'setuptools-0.6c9-py2.5.egg': 'fe67c3e5a17b12c0e7c541b7ea43a8e6',
66 'setuptools-0.6c9-py2.6.egg': 'ca37b1ff16fa2ede6e19383e7b59245a',
67}
68
69import sys, os
70try: from hashlib import md5
71except ImportError: from md5 import md5
72
73def _validate_md5(egg_name, data):
74 if egg_name in md5_data:
75 digest = md5(data).hexdigest()
76 if digest != md5_data[egg_name]:
77 print >>sys.stderr, (
78 "md5 validation of %s failed! (Possible download problem?)"
79 % egg_name
80 )
81 sys.exit(2)
82 return data
83
84def use_setuptools(
85 version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
86 download_delay=15
87):
88 """Automatically find/download setuptools and make it available on sys.path
89
90 `version` should be a valid setuptools version number that is available
91 as an egg for download under the `download_base` URL (which should end with
92 a '/'). `to_dir` is the directory where setuptools will be downloaded, if
93 it is not already available. If `download_delay` is specified, it should
94 be the number of seconds that will be paused before initiating a download,
95 should one be required. If an older version of setuptools is installed,
96 this routine will print a message to ``sys.stderr`` and raise SystemExit in
97 an attempt to abort the calling script.
98 """
99 was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules
100 def do_download():
101 egg = download_setuptools(version, download_base, to_dir, download_delay)
102 sys.path.insert(0, egg)
103 import setuptools; setuptools.bootstrap_install_from = egg
104 try:
105 import pkg_resources
106 except ImportError:
107 return do_download()
108 try:
109 pkg_resources.require("setuptools>="+version); return
110 except pkg_resources.VersionConflict as e:
111 if was_imported:
112 print >>sys.stderr, (
113 "The required version of setuptools (>=%s) is not available, and\n"
114 "can't be installed while this script is running. Please install\n"
115 " a more recent version first, using 'easy_install -U setuptools'."
116 "\n\n(Currently using %r)"
117 ) % (version, e.args[0])
118 sys.exit(2)
119 else:
120 del pkg_resources, sys.modules['pkg_resources'] # reload ok
121 return do_download()
122 except pkg_resources.DistributionNotFound:
123 return do_download()
124
125def download_setuptools(
126 version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
127 delay = 15
128):
129 """Download setuptools from a specified location and return its filename
130
131 `version` should be a valid setuptools version number that is available
132 as an egg for download under the `download_base` URL (which should end
133 with a '/'). `to_dir` is the directory where the egg will be downloaded.
134 `delay` is the number of seconds to pause before an actual download attempt.
135 """
136 import urllib2, shutil
137 egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3])
138 url = download_base + egg_name
139 saveto = os.path.join(to_dir, egg_name)
140 src = dst = None
141 if not os.path.exists(saveto): # Avoid repeated downloads
142 try:
143 from distutils import log
144 if delay:
145 log.warn("""
146---------------------------------------------------------------------------
147This script requires setuptools version %s to run (even to display
148help). I will attempt to download it for you (from
149%s), but
150you may need to enable firewall access for this script first.
151I will start the download in %d seconds.
152
153(Note: if this machine does not have network access, please obtain the file
154
155 %s
156
157and place it in this directory before rerunning this script.)
158---------------------------------------------------------------------------""",
159 version, download_base, delay, url
160 ); from time import sleep; sleep(delay)
161 log.warn("Downloading %s", url)
162 src = urllib2.urlopen(url)
163 # Read/write all in one block, so we don't create a corrupt file
164 # if the download is interrupted.
165 data = _validate_md5(egg_name, src.read())
166 dst = open(saveto,"wb"); dst.write(data)
167 finally:
168 if src: src.close()
169 if dst: dst.close()
170 return os.path.realpath(saveto)
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207def main(argv, version=DEFAULT_VERSION):
208 """Install or upgrade setuptools and EasyInstall"""
209 try:
210 import setuptools
211 except ImportError:
212 egg = None
213 try:
214 egg = download_setuptools(version, delay=0)
215 sys.path.insert(0,egg)
216 from setuptools.command.easy_install import main
217 return main(list(argv)+[egg]) # we're done here
218 finally:
219 if egg and os.path.exists(egg):
220 os.unlink(egg)
221 else:
222 if setuptools.__version__ == '0.0.1':
223 print >>sys.stderr, (
224 "You have an obsolete version of setuptools installed. Please\n"
225 "remove it from your system entirely before rerunning this script."
226 )
227 sys.exit(2)
228
229 req = "setuptools>="+version
230 import pkg_resources
231 try:
232 pkg_resources.require(req)
233 except pkg_resources.VersionConflict:
234 try:
235 from setuptools.command.easy_install import main
236 except ImportError:
237 from easy_install import main
238 main(list(argv)+[download_setuptools(delay=0)])
239 sys.exit(0) # try to force an exit
240 else:
241 if argv:
242 from setuptools.command.easy_install import main
243 main(argv)
244 else:
245 print "Setuptools version",version,"or greater has been installed."
246 print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
247
248def update_md5(filenames):
249 """Update our built-in md5 registry"""
250
251 import re
252
253 for name in filenames:
254 base = os.path.basename(name)
255 f = open(name,'rb')
256 md5_data[base] = md5(f.read()).hexdigest()
257 f.close()
258
259 data = [" %r: %r,\n" % it for it in md5_data.items()]
260 data.sort()
261 repl = "".join(data)
262
263 import inspect
264 srcfile = inspect.getsourcefile(sys.modules[__name__])
265 f = open(srcfile, 'rb'); src = f.read(); f.close()
266
267 match = re.search("\nmd5_data = {\n([^}]+)}", src)
268 if not match:
269 print >>sys.stderr, "Internal error!"
270 sys.exit(2)
271
272 src = src[:match.start(1)] + repl + src[match.end(1):]
273 f = open(srcfile,'w')
274 f.write(src)
275 f.close()
276
277
278if __name__=='__main__':
279 if len(sys.argv)>2 and sys.argv[1]=='--md5update':
280 update_md5(sys.argv[2:])
281 else:
282 main(sys.argv[1:])
283
284
285
286
287
288
2890
=== modified file 'lib/lp/codehosting/__init__.py'
--- lib/lp/codehosting/__init__.py 2012-09-06 00:01:38 +0000
+++ lib/lp/codehosting/__init__.py 2017-12-19 09:48:36 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009 Canonical Ltd. This software is licensed under the1# Copyright 2009-2017 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Launchpad code-hosting system.4"""Launchpad code-hosting system.
@@ -26,15 +26,7 @@
2626
27def get_bzr_path():27def get_bzr_path():
28 """Find the path to the copy of Bazaar for this rocketfuel instance"""28 """Find the path to the copy of Bazaar for this rocketfuel instance"""
29 bzr_in_egg_path = os.path.join(29 return os.path.join(config.root, 'bin', 'bzr')
30 os.path.dirname(os.path.dirname(bzrlib.__file__)),
31 'EGG-INFO/scripts/bzr')
32 if os.path.exists(bzr_in_egg_path):
33 return bzr_in_egg_path
34 else:
35 return os.path.join(
36 os.path.dirname(os.path.dirname(bzrlib.__file__)),
37 'bzr')
3830
3931
40def _get_bzr_plugins_path():32def _get_bzr_plugins_path():
4133
=== modified file 'lib/lp/scripts/harness.py'
--- lib/lp/scripts/harness.py 2013-06-20 05:50:00 +0000
+++ lib/lp/scripts/harness.py 2017-12-19 09:48:36 +0000
@@ -1,4 +1,4 @@
1# Copyright 2004-2012 Canonical Ltd. This software is licensed under the1# Copyright 2004-2017 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Scripts for starting a Python prompt with Launchpad initialized.4"""Scripts for starting a Python prompt with Launchpad initialized.
@@ -12,10 +12,8 @@
12__metaclass__ = type12__metaclass__ = type
13__all__ = ['python', 'ipython']13__all__ = ['python', 'ipython']
1414
15# This has setup.py scripts. It is usually installed via buildout.15# This has entry points with corresponding scripts installed by setup.py.
16#
1716
18#
19import os17import os
20import readline18import readline
21import rlcompleter19import rlcompleter
2220
=== removed file 'lib/lp/scripts/utilities/bzr.py'
--- lib/lp/scripts/utilities/bzr.py 2017-01-18 00:55:27 +0000
+++ lib/lp/scripts/utilities/bzr.py 1970-01-01 00:00:00 +0000
@@ -1,13 +0,0 @@
1# Copyright 2010-2017 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4import pkg_resources
5
6
7def main():
8 # Run the script.
9 bzr_distribution = pkg_resources.get_distribution(
10 pkg_resources.Requirement.parse('bzr'))
11 namespace = globals().copy()
12 namespace['__name__'] = '__main__'
13 bzr_distribution.run_script('bzr', namespace)
140
=== modified file 'lib/lp/scripts/utilities/importfascist.py'
--- lib/lp/scripts/utilities/importfascist.py 2016-07-16 07:53:54 +0000
+++ lib/lp/scripts/utilities/importfascist.py 2017-12-19 09:48:36 +0000
@@ -31,6 +31,10 @@
31 'json.decoder': set(['JSONDecodeError']),31 'json.decoder': set(['JSONDecodeError']),
32 'openid.fetchers': set(['Urllib2Fetcher']),32 'openid.fetchers': set(['Urllib2Fetcher']),
33 'openid.message': set(['NamespaceAliasRegistrationError']),33 'openid.message': set(['NamespaceAliasRegistrationError']),
34 # Exported as shlex.quote in Python 3.
35 'pipes': set(['quote']),
36 # Exported in Python 3, but missing and so not exported in Python 2.
37 'shlex': set(['quote']),
34 'storm.database': set(['STATE_DISCONNECTED']),38 'storm.database': set(['STATE_DISCONNECTED']),
35 'textwrap': set(['dedent']),39 'textwrap': set(['dedent']),
36 'testtools.testresult.real': set(['_details_to_str']),40 'testtools.testresult.real': set(['_details_to_str']),
3741
=== modified file 'lib/lp/services/job/runner.py'
--- lib/lp/services/job/runner.py 2017-06-14 11:40:16 +0000
+++ lib/lp/services/job/runner.py 2017-12-19 09:48:36 +0000
@@ -462,7 +462,8 @@
462 if 'LPCONFIG' in os.environ:462 if 'LPCONFIG' in os.environ:
463 env['LPCONFIG'] = os.environ['LPCONFIG']463 env['LPCONFIG'] = os.environ['LPCONFIG']
464 env['PYTHONPATH'] = os.pathsep.join(sys.path)464 env['PYTHONPATH'] = os.pathsep.join(sys.path)
465 starter = main.ProcessStarter(env=env)465 starter = main.ProcessStarter(
466 bootstrap="import _pythonpath\n" + main.BOOTSTRAP, env=env)
466 super(TwistedJobRunner, self).__init__(logger, error_utility)467 super(TwistedJobRunner, self).__init__(logger, error_utility)
467 self.job_source = job_source468 self.job_source = job_source
468 self.import_name = '%s.%s' % (469 self.import_name = '%s.%s' % (
469470
=== modified file 'lib/lp/services/mailman/monkeypatches/mm_cfg.py.in'
--- lib/lp/services/mailman/monkeypatches/mm_cfg.py.in 2011-11-11 21:59:00 +0000
+++ lib/lp/services/mailman/monkeypatches/mm_cfg.py.in 2017-12-19 09:48:36 +0000
@@ -1,9 +1,8 @@
1# Automatically generated by runlaunchpad.py1# Automatically generated by runlaunchpad.py
22
3# Initialize sys.path so that the Mailman processes, which use the standard3# Initialize sys.path so that the Mailman processes, which use the standard
4# system Python instead of buildout's bin/py, can find all the necessary4# system Python instead of bin/py, can find all the necessary packages and
5# packages and modules. Some of these are in sourcecode and some are in5# modules. Some of these are in sourcecode and some are in the virtualenv.
6# buildout eggs.
7#6#
8# This is a two-step process. First, we hack sys.path in order to find a7# This is a two-step process. First, we hack sys.path in order to find a
9# directory containing _pythonpath. Then the _pythonpath module does all the8# directory containing _pythonpath. Then the _pythonpath module does all the
109
=== modified file 'lib/lp/services/scripts/tests/test_logger.txt'
--- lib/lp/services/scripts/tests/test_logger.txt 2011-12-29 05:29:36 +0000
+++ lib/lp/services/scripts/tests/test_logger.txt 2017-12-19 09:48:36 +0000
@@ -7,12 +7,6 @@
7 ... import sys7 ... import sys
8 ... import subprocess8 ... import subprocess
9 ... from lp.services.config import config9 ... from lp.services.config import config
10 ... if 'env' in kw:
11 ... # We want to make sure that the subprocess will have the
12 ... # benefit of all of the dependency paths inserted by the
13 ... # buildout. This is already set up in our environment's
14 ... # PYTHONPATH, so use it.
15 ... kw['env']['PYTHONPATH'] = os.environ['PYTHONPATH']
16 ... test_script_path = os.path.join(10 ... test_script_path = os.path.join(
17 ... config.root, 'lib', 'lp', 'services',11 ... config.root, 'lib', 'lp', 'services',
18 ... 'scripts', 'tests', 'loglevels.py')12 ... 'scripts', 'tests', 'loglevels.py')
1913
=== modified file 'lib/lp_sitecustomize.py'
--- lib/lp_sitecustomize.py 2017-10-05 12:45:46 +0000
+++ lib/lp_sitecustomize.py 2017-12-19 09:48:36 +0000
@@ -1,14 +1,15 @@
1# Copyright 2009-2017 Canonical Ltd. This software is licensed under the1# Copyright 2009-2017 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4# This file is imported by parts/scripts/sitecustomize.py, as set up in our4# This file is imported by _pythonpath.py and by the standard Launchpad
5# buildout.cfg (see the "initialization" key in the "[scripts]" section).5# script preamble (see LPScriptWriter in setup.py).
66
7from collections import defaultdict7from collections import defaultdict
8import itertools8import itertools
9import logging9import logging
10import os10import os
11import warnings11import warnings
12import sys
1213
13from twisted.internet.defer import (14from twisted.internet.defer import (
14 Deferred,15 Deferred,
@@ -172,14 +173,15 @@
172 silence_swiftclient_logger()173 silence_swiftclient_logger()
173174
174175
175def main(instance_name):176def main(instance_name=None):
176 # This is called by our custom buildout-generated sitecustomize.py177 # This is called by _pythonpath.py and by the standard Launchpad script
177 # in parts/scripts/sitecustomize.py. The instance name is sent to178 # preamble (see LPScriptWriter in setup.py). The instance name is sent
178 # buildout from the Makefile, and then inserted into179 # to setup.py from the Makefile, and then written to env/instance_name.
179 # sitecustomize.py. See buildout.cfg in the "initialization" value180 # We do all actual initialization here, in a more visible place.
180 # of the [scripts] section for the code that goes into this custom181 if instance_name is None:
181 # sitecustomize.py. We do all actual initialization here, in a more182 instance_name_path = os.path.join(sys.prefix, 'instance_name')
182 # visible place.183 with open(instance_name_path) as instance_name_file:
184 instance_name = instance_name_file.read().rstrip('\n')
183 if instance_name and instance_name != 'development':185 if instance_name and instance_name != 'development':
184 # See bug 656213 for why we do this carefully.186 # See bug 656213 for why we do this carefully.
185 os.environ.setdefault('LPCONFIG', instance_name)187 os.environ.setdefault('LPCONFIG', instance_name)
186188
=== added file 'pip-requirements.txt'
--- pip-requirements.txt 1970-01-01 00:00:00 +0000
+++ pip-requirements.txt 2017-12-19 09:48:36 +0000
@@ -0,0 +1,1 @@
1pip==9.0.1
02
=== removed file 'setup.cfg'
--- setup.cfg 2014-01-30 15:04:06 +0000
+++ setup.cfg 1970-01-01 00:00:00 +0000
@@ -1,12 +0,0 @@
1[easy_install]
2# These settings control the behaviour of the bootstrap.py script. They keep
3# the version of setuptools and zc.buildout found in the download-cache as the
4# ones used to make the bin/buildout script. Therefore, if your system Python
5# already has setuptools installed, this file will keep the system from going
6# out on the network for any distributions during the zc.buildout
7# bootstrapping. Also, therefore, if you want to use a newer version of
8# setuptools or zc.buildout, you need to put it in ./download-cache/dist and
9# commit there, and change the specification in versions.cfg, as described
10# generally for dependencies in ./doc/buildout.txt.
11allow_hosts =
12
130
=== modified file 'setup.py'
--- setup.py 2017-12-07 12:05:13 +0000
+++ setup.py 2017-12-19 09:48:36 +0000
@@ -3,12 +3,129 @@
3# Copyright 2009, 2010 Canonical Ltd. This software is licensed under the3# Copyright 2009, 2010 Canonical Ltd. This software is licensed under the
4# GNU Affero General Public License version 3 (see the file LICENSE).4# GNU Affero General Public License version 3 (see the file LICENSE).
55
6import ez_setup6from __future__ import print_function
77
88from distutils.sysconfig import get_python_lib
9ez_setup.use_setuptools()9import imp
1010import os.path
11from setuptools import setup, find_packages11from string import Template
12import sys
13from textwrap import dedent
14
15from setuptools import (
16 find_packages,
17 setup,
18 )
19from setuptools.command.develop import develop
20from setuptools.command.easy_install import ScriptWriter
21
22
23class LPScriptWriter(ScriptWriter):
24 """A modified ScriptWriter that uses Launchpad's boilerplate.
25
26 Any script written using this class will set up its environment using
27 `lp_sitecustomize` before calling its entry point.
28
29 The standard setuptools handling of entry_points uses
30 `pkg_resources.load_entry_point` to resolve requirements at run-time.
31 This involves walking Launchpad's entire dependency graph, which is
32 rather slow, and we always build all of our "optional" features anyway,
33 so we might as well just take the simplified approach of importing the
34 modules we need directly. If we ever want to start using the "extras"
35 feature of setuptools then we may want to revisit this.
36 """
37
38 template = Template(dedent("""
39 import sys
40
41 import ${module_name}
42
43 if __name__ == '__main__':
44 sys.exit(${module_name}.${attrs}())
45 """))
46
47 @classmethod
48 def get_args(cls, dist, header=None):
49 """See `ScriptWriter`."""
50 if header is None:
51 header = cls.get_header()
52 for name, ep in dist.get_entry_map("console_scripts").items():
53 cls._ensure_safe_name(name)
54 script_text = cls.template.substitute({
55 "attrs": ".".join(ep.attrs),
56 "module_name": ep.module_name,
57 })
58 args = cls._get_script_args("console", name, header, script_text)
59 for res in args:
60 yield res
61
62
63class lp_develop(develop):
64 """A modified develop command to handle LP script generation."""
65
66 def _get_orig_sitecustomize(self):
67 env_top = os.path.join(os.path.dirname(__file__), "env")
68 system_paths = [
69 path for path in sys.path if not path.startswith(env_top)]
70 try:
71 fp, orig_sitecustomize_path, _ = (
72 imp.find_module("sitecustomize", system_paths))
73 if fp:
74 fp.close()
75 except ImportError:
76 return ""
77 if orig_sitecustomize_path.endswith(".py"):
78 with open(orig_sitecustomize_path) as orig_sitecustomize_file:
79 orig_sitecustomize = orig_sitecustomize_file.read()
80 return dedent("""
81 # The following is from
82 # %s
83 """ % orig_sitecustomize_path) + orig_sitecustomize
84 else:
85 return ""
86
87 def install_wrapper_scripts(self, dist):
88 if not self.exclude_scripts:
89 for args in LPScriptWriter.get_args(dist):
90 self.write_script(*args)
91
92 # Write bin/py for compatibility. This is much like
93 # env/bin/python, but if we just symlink to it and try to
94 # execute it as bin/py then the virtualenv doesn't get
95 # activated. We use -S to avoid importing sitecustomize both
96 # before and after the execve.
97 py_header = LPScriptWriter.get_header("#!python -S")
98 py_script_text = dedent("""\
99 import os
100 import sys
101
102 os.execv(sys.executable, [sys.executable] + sys.argv[1:])
103 """)
104 self.write_script("py", py_header + py_script_text)
105
106 env_top = os.path.join(os.path.dirname(__file__), "env")
107 stdlib_dir = get_python_lib(standard_lib=True, prefix=env_top)
108 orig_sitecustomize = self._get_orig_sitecustomize()
109 sitecustomize_path = os.path.join(stdlib_dir, "sitecustomize.py")
110 with open(sitecustomize_path, "w") as sitecustomize_file:
111 sitecustomize_file.write(dedent("""\
112 import os
113 import sys
114
115 if "LP_DISABLE_SITECUSTOMIZE" not in os.environ:
116 if "lp_sitecustomize" not in sys.modules:
117 import lp_sitecustomize
118 lp_sitecustomize.main()
119 """))
120 if orig_sitecustomize:
121 sitecustomize_file.write(orig_sitecustomize)
122
123 # Write out the build-time value of LPCONFIG so that it can be
124 # used by scripts as the default instance name.
125 instance_name_path = os.path.join(env_top, "instance_name")
126 with open(instance_name_path, "w") as instance_name_file:
127 print(os.environ["LPCONFIG"], file=instance_name_file)
128
12129
13__version__ = '2.2.3'130__version__ = '2.2.3'
14131
@@ -62,7 +179,8 @@
62 'Markdown',179 'Markdown',
63 'mechanize',180 'mechanize',
64 'meliae',181 'meliae',
65 'mock',182 # Pin version for now to avoid confusion with system site-packages.
183 'mock==1.0.1',
66 'oauth',184 'oauth',
67 'oops',185 'oops',
68 'oops_amqp',186 'oops_amqp',
@@ -105,6 +223,7 @@
105 'txlongpoll',223 'txlongpoll',
106 'txlongpollfixture',224 'txlongpollfixture',
107 'txpkgupload',225 'txpkgupload',
226 'virtualenv-tools3',
108 'wadllib',227 'wadllib',
109 'z3c.pt',228 'z3c.pt',
110 'z3c.ptcompat',229 'z3c.ptcompat',
@@ -125,6 +244,7 @@
125 'zope.exceptions',244 'zope.exceptions',
126 'zope.formlib',245 'zope.formlib',
127 'zope.i18n',246 'zope.i18n',
247 'zope.i18nmessageid',
128 'zope.interface',248 'zope.interface',
129 'zope.lifecycleevent',249 'zope.lifecycleevent',
130 'zope.location',250 'zope.location',
@@ -158,17 +278,13 @@
158 "Intended Audience :: Developers",278 "Intended Audience :: Developers",
159 "Programming Language :: Python",279 "Programming Language :: Python",
160 ],280 ],
161 extras_require=dict(281 cmdclass={
162 docs=[282 'develop': lp_develop,
163 'Sphinx',283 },
164 'z3c.recipe.sphinxdoc',
165 ]
166 ),
167 entry_points=dict(284 entry_points=dict(
168 console_scripts=[ # `console_scripts` is a magic name to setuptools285 console_scripts=[ # `console_scripts` is a magic name to setuptools
169 'build-twisted-plugin-cache = '286 'build-twisted-plugin-cache = '
170 'lp.services.twistedsupport.plugincache:main',287 'lp.services.twistedsupport.plugincache:main',
171 'bzr = lp.scripts.utilities.bzr:main',
172 'combine-css = lp.scripts.utilities.js.combinecss:main',288 'combine-css = lp.scripts.utilities.js.combinecss:main',
173 'googletestservice = '289 'googletestservice = '
174 'lp.services.googlesearch.googletestservice:main',290 'lp.services.googlesearch.googletestservice:main',
175291
=== modified file 'utilities/link-external-sourcecode'
--- utilities/link-external-sourcecode 2013-04-15 02:36:07 +0000
+++ utilities/link-external-sourcecode 2017-12-19 09:48:36 +0000
@@ -1,6 +1,6 @@
1#!/usr/bin/python1#!/usr/bin/python
2#2#
3# Copyright 2009-2011 Canonical Ltd. This software is licensed under the GNU3# Copyright 2009-2017 Canonical Ltd. This software is licensed under the GNU
4# Affero General Public License version 3 (see the file LICENSE).4# Affero General Public License version 3 (see the file LICENSE).
55
6import optparse6import optparse
@@ -138,7 +138,7 @@
138 for source, destination in missing_files:138 for source, destination in missing_files:
139 link(source, destination)139 link(source, destination)
140140
141 for folder_name in ('download-cache', 'eggs'):141 for folder_name in ('download-cache',):
142 source = abspath(join(options.parent, folder_name))142 source = abspath(join(options.parent, folder_name))
143 destination = abspath(join(options.target, folder_name))143 destination = abspath(join(options.target, folder_name))
144 if not exists(destination):144 if not exists(destination):
145145
=== added file 'utilities/relocate-virtualenv'
--- utilities/relocate-virtualenv 1970-01-01 00:00:00 +0000
+++ utilities/relocate-virtualenv 2017-12-19 09:48:36 +0000
@@ -0,0 +1,25 @@
1#! /bin/sh
2set -e
3
4# Ensure that a virtualenv is relocated to its current path. This does not
5# cope with moving a virtualenv to a different version of the base operating
6# system or a different architecture; it only copes with moving it to a
7# different filesystem path (perhaps on a different machine as long as it is
8# similar enough).
9
10if [ -z "$1" ]; then
11 echo "Usage: $0 ENV_PATH" 2>&1
12 exit 1
13fi
14
15# virtualenv-tools does most of the hard work. We must explicitly invoke it
16# with the virtualenv's Python, as its #! line is probably wrong.
17"$1/bin/python" "$1/bin/virtualenv-tools" --update-path=auto "$1"
18
19# Fix up a few things that virtualenv-tools doesn't handle.
20top="$(readlink -f "$(dirname "$0")/..")"
21for path in "$1"/lib/*/site-packages/lp.egg-link; do
22 printf '%s/lib\n../' "$top" >"$path"
23done
24sed -i "s#^find_links = .*#find_links = file://$top/download-cache/dist/#" \
25 "$1"/.pydistutils.cfg
026
=== modified file 'utilities/rocketfuel-branch'
--- utilities/rocketfuel-branch 2009-06-24 20:15:50 +0000
+++ utilities/rocketfuel-branch 2017-12-19 09:48:36 +0000
@@ -1,6 +1,6 @@
1#! /bin/bash1#! /bin/bash
2#2#
3# Copyright 2009 Canonical Ltd. This software is licensed under the3# Copyright 2009-2017 Canonical Ltd. This software is licensed under the
4# GNU Affero General Public License version 3 (see the file LICENSE).4# GNU Affero General Public License version 3 (see the file LICENSE).
5#5#
6# Create a new branch of LP called "foo" in $LP_PROJECT_PATH/foo, with all the6# Create a new branch of LP called "foo" in $LP_PROJECT_PATH/foo, with all the
@@ -12,11 +12,6 @@
12 exit 112 exit 1
13fi13fi
1414
15LP_DOWNLOAD_CACHE_PATH=$LP_PROJECT_ROOT/$LP_SOURCEDEPS_DIR/download-cache
16LP_EGGS_PATH=$LP_PROJECT_ROOT/$LP_SOURCEDEPS_DIR/eggs
17LP_DOWNLOAD_CACHE_PATH=$(eval echo ${LP_DOWNLOAD_CACHE_PATH})
18LP_EGGS_PATH=$(eval echo ${LP_EGGS_PATH})
19
20if [ "x$1" == "x" ]; then15if [ "x$1" == "x" ]; then
21 echo "Usage: $0 new-branch-name"16 echo "Usage: $0 new-branch-name"
22 echo "Example: '$0 fixes-bug-54356'"17 echo "Example: '$0 fixes-bug-54356'"
2318
=== modified file 'utilities/rocketfuel-get'
--- utilities/rocketfuel-get 2017-11-18 09:49:07 +0000
+++ utilities/rocketfuel-get 2017-12-19 09:48:36 +0000
@@ -1,6 +1,6 @@
1#! /bin/bash1#! /bin/bash
2#2#
3# Copyright 2009-2011 Canonical Ltd. This software is licensed under the3# Copyright 2009-2017 Canonical Ltd. This software is licensed under the
4# GNU Affero General Public License version 3 (see the file LICENSE).4# GNU Affero General Public License version 3 (see the file LICENSE).
5#5#
6# Update your copy of trunk and the necessary source dependencies, and make6# Update your copy of trunk and the necessary source dependencies, and make
@@ -29,10 +29,8 @@
29fi29fi
3030
31LP_DOWNLOAD_CACHE_PATH="$LP_PROJECT_ROOT/$LP_SOURCEDEPS_DIR/download-cache"31LP_DOWNLOAD_CACHE_PATH="$LP_PROJECT_ROOT/$LP_SOURCEDEPS_DIR/download-cache"
32LP_EGGS_PATH="$LP_PROJECT_ROOT/$LP_SOURCEDEPS_DIR/eggs"
33YUI_PATH="$LP_PROJECT_ROOT/$LP_SOURCEDEPS_DIR/yui"32YUI_PATH="$LP_PROJECT_ROOT/$LP_SOURCEDEPS_DIR/yui"
34LP_DOWNLOAD_CACHE_PATH="$(eval echo ${LP_DOWNLOAD_CACHE_PATH})"33LP_DOWNLOAD_CACHE_PATH="$(eval echo ${LP_DOWNLOAD_CACHE_PATH})"
35LP_EGGS_PATH="$(eval echo ${LP_EGGS_PATH})"
3634
37# Pull launchpad devel from launchpad.35# Pull launchpad devel from launchpad.
38INITIAL_REV=$(bzr revno "$LP_TRUNK_PATH")36INITIAL_REV=$(bzr revno "$LP_TRUNK_PATH")
@@ -40,7 +38,7 @@
40FINAL_REV=$(bzr revno "$LP_TRUNK_PATH")38FINAL_REV=$(bzr revno "$LP_TRUNK_PATH")
4139
42# Make sure our directories are around.40# Make sure our directories are around.
43mkdir -p "$LP_SOURCEDEPS_PATH" "$LP_EGGS_PATH" "$YUI_PATH"41mkdir -p "$LP_SOURCEDEPS_PATH" "$YUI_PATH"
4442
45# Get/update the download cache.43# Get/update the download cache.
46if [ -d "$LP_DOWNLOAD_CACHE_PATH" ]44if [ -d "$LP_DOWNLOAD_CACHE_PATH" ]
4745
=== removed file 'versions.cfg'
--- versions.cfg 2017-12-07 12:05:13 +0000
+++ versions.cfg 1970-01-01 00:00:00 +0000
@@ -1,193 +0,0 @@
1[buildout]
2extends =
3 ztk-versions.cfg
4 zopeapp-versions.cfg
5versions = versions
6
7[versions]
8# Alphabetical, case-insensitive, please! :-)
9
10# lp:~launchpad/ampoule/lp
11# post1 Don't add a process back to the ready set if it received an error
12# such as a timeout.
13ampoule = 0.2.0.post1
14amqp = 1.4.9
15amqplib = 1.0.2
16anyjson = 0.3.3
17argparse = 1.2.1
18auditor = 0.0.3
19auditorclient = 0.0.4
20auditorfixture = 0.0.7
21backports.lzma = 0.0.3
22BeautifulSoup = 3.2.1
23billiard = 3.3.0.20
24bson = 0.3.3
25bzr = 2.6.0.lp.2
26celery = 3.1.18
27Chameleon = 2.11
28cssselect = 0.9.1
29cssutils = 0.9.10
30d2to1 = 0.2.10
31Django = 1.4
32dkimpy = 0.5.4
33# Required by dkimpy
34dnspython = 1.10.0
35elementtree = 1.2.6-20050316
36epydoc = 3.0.1
37extras = 0.0.3
38FeedParser = 4.1
39feedvalidator = 0.0.0DEV-r1049
40fixtures = 0.3.9
41FormEncode = 1.2.4
42grokcore.component = 1.6
43html5browser = 0.0.9
44httmock = 1.2.3
45httplib2 = 0.8
46importlib = 1.0.2
47ipython = 0.13.2
48iso8601 = 0.1.4
49jsautobuild = 0.2
50keyring = 0.6.2
51kombu = 3.0.30
52launchpad-buildd = 136
53launchpadlib = 1.10.5
54lazr.authentication = 0.1.1
55lazr.batchnavigator = 1.2.11
56lazr.config = 2.2.1
57lazr.delegates = 2.0.4
58lazr.enum = 1.1.3
59lazr.jobrunner = 0.13
60lazr.lifecycle = 1.1
61lazr.restful = 0.20.0
62lazr.restfulclient = 0.13.2
63lazr.smtptest = 1.3
64lazr.sshserver = 0.1.3
65lazr.testing = 0.1.1
66lazr.uri = 1.0.3
67libnacl = 1.3.6
68lpjsmin = 0.5
69manuel = 1.7.2
70Markdown = 2.3.1
71martian = 0.11
72meliae = 0.2.0.final.0
73mock = 1.0.1
74mocker = 1.1.1
75oauth = 1.0
76oops = 0.0.13
77oops-amqp = 0.0.8b1
78oops-datedir-repo = 0.0.23
79oops-timeline = 0.0.1
80oops-twisted = 0.0.7
81oops-wsgi = 0.0.8
82ordereddict = 1.1
83oslo.config = 1.1.1
84paramiko = 1.7.7.2
85pbr = 0.5.20
86pgbouncer = 0.0.8
87pip = 1.4
88prettytable = 0.7.2
89psycopg2 = 2.6.1
90pyasn1 = 0.1.6
91pycrypto = 2.6
92Pygments = 1.6
93pygpgme = 0.2
94pyinotify = 0.9.4
95pymacaroons = 0.9.2
96pyOpenSSL = 0.13
97pystache = 0.5.3
98python-dateutil = 1.5
99python-debian = 0.1.23
100python-keystoneclient = 0.3.1
101python-memcached = 1.58
102python-mimeparse = 0.1.4
103# XXX: deryck 2012-08-10
104# See lp:~deryck/python-openid/python-openid-fix1034376 which
105# reapplied a patch from wgrant to get codehosting going again.
106python-openid = 2.2.5-fix1034376
107python-subunit = 0.0.8beta
108python-swiftclient = 1.5.0
109PyYAML = 3.10
110pytz = 2017.2
111rabbitfixture = 0.3.6
112requests = 2.7.0
113requests-toolbelt = 0.6.2
114setproctitle = 1.1.7
115setuptools-git = 1.0
116simplejson = 3.8.2
117SimpleTAL = 4.3
118six = 1.9.0
119soupmatchers = 0.2
120# lp:~launchpad-committers/storm/with-without-datetime
121storm = 0.19.0.99-lpwithnodatetime-r408
122subprocess32 = 3.2.6
123subvertpy = 0.9.1
124testresources = 0.2.7
125testscenarios = 0.4
126testtools = 0.9.30
127timeline = 0.0.3
128# Build of lp:~canonical-launchpad-branches/twisted:lp-backport.
129# p1 Support diffie-hellman-group14-sha1 key exchange in conch.ssh.
130# p2 Add diffie-hellman-group-exchange-sha256 to twisted.conch.ssh.
131# Add support in twisted.conch.ssh for hmac-sha2-256 and hmac-sha2-512.
132Twisted = 13.0.0-p2
133txAMQP = 0.6.2
134txfixtures = 0.1.4
135txlongpoll = 0.2.12
136txlongpollfixture = 0.1.3
137txpkgupload = 0.2
138unittest2 = 0.5.1
139van.testing = 3.0.0
140wadllib = 1.3.2
141# Upgrade from ZTK 1.1.5 to intercept lazr.restfulclient.
142wsgi-intercept = 0.5.1
143wsgiref = 0.1.2
144z3c.pt = 2.2.3
145z3c.ptcompat = 0.5.7
146z3c.recipe.tag = 0.6
147# Also upgrade the zc.buildout version in the Makefile's bin/buildout section.
148zc.buildout = 1.7.1
149zc.zservertracelog = 1.3.2
150ZConfig = 2.9.1dev-20110728
151# Not in ZTK 1.1.5
152zope.app.server = 3.6.0
153# Upgrade from ZTK 1.1.6 for ZCML registration performance.
154zope.component = 3.11.0
155# Upgrade from ZTK 1.1.6 for ZCML registration performance.
156zope.interface = 4.4.3
157# Build of lp:~wallyworld/zope.pagetemplate/fix-isinstance
158# This version adds a small change to the traversal logic so that the
159# optimisation which applies if the object is a dict also works for subclasses
160# of dict. The change has been approved for merge into the official zope code
161# base. This patch is a temporary fix until the next official release.
162zope.pagetemplate = 3.5.0-p1
163# XXX: downgraded to avoid 3.9.2 cookie calculation changes
164zope.session = 3.9.1
165# p1 Build of lp:~mars/zope.testing/3.9.4-p1. Fixes bugs 570380 and 587886.
166# p2 With patch for thread leaks to make them skips, fixes windmill errors
167# with 'new threads' in hudson/ec2 builds.
168# p3 And always tear down layers, because thats the Right Thing To Do.
169# p4 fixes --subunit --list to really just list the tests.
170# p5 Build of lp:~launchpad/zope.testing/3.9.4-p5. Fixes bug #609986.
171# p6 reinstates fix from p4. Build of lp:~launchpad/zope.testing/3.9.4-fork
172# revision 26.
173# p7 was unused
174# p8 redirects stdout and stderr to a black hole device when --subunit is used
175# p9 adds the redirection of __stderr__ to a black hole device
176# p10 changed the test reporting to use test.id() rather than
177# str(test) since only the id is unique.
178# p11 reverts p9.
179# p12 reverts p11, restoring p9.
180# p13 Add a new --require-unique flag to the testrunner. When set,
181# this will cause the testrunner to check all tests IDs to ensure they
182# haven't been loaded before. If it encounters a duplicate, it will
183# raise an error and quit.
184# p14 Adds test data written to stderr and stdout into the subunit output.
185# p15 Fixed internal tests.
186# p16 Adds support for skips in Python 2.7.
187# p17 Fixes skip support for Python 2.6.
188# To build (use Python 2.6) run "python bootstrap.py; ./bin/buildout". Then to
189# build the distribution run "bin/buildout setup . sdist"
190# Make sure you have subunit installed.
191zope.testing = 3.9.4-p17
192# Not in ZTK 1.1.5 (extracted from zope.app.schema)
193zope.vocabularyregistry = 1.0.0
1940
=== removed file 'zopeapp-versions.cfg'
--- zopeapp-versions.cfg 2013-05-09 23:35:44 +0000
+++ zopeapp-versions.cfg 1970-01-01 00:00:00 +0000
@@ -1,40 +0,0 @@
1[versions]
2# ZopeApp
3zc.sourcefactory = 0.7.0
4zope.app.applicationcontrol = 3.5.10
5zope.app.appsetup = 3.15.0
6zope.app.debug = 3.4.1
7zope.app.http = 3.9.0
8zope.app.publication = 3.12.0
9zope.app.wsgi = 3.10.0
10zope.testbrowser = 3.10.4
11
12# Deprecated
13roman = 1.4.0
14wsgi-intercept = 0.4
15zope.app.authentication = 3.9.0
16zope.app.basicskin = 3.5.1
17zope.app.broken = 3.6.0
18zope.app.component = 3.9.3
19zope.app.container = 3.9.2
20zope.app.content = 3.5.1
21zope.app.dependable = 3.5.1
22zope.app.error = 3.5.3
23zope.app.exception = 3.6.3
24zope.app.folder = 3.5.2
25zope.app.form = 4.0.2
26zope.app.generations = 3.7.1
27zope.app.i18n = 3.6.4
28zope.app.locales = 3.6.2
29zope.app.localpermission = 3.7.2
30zope.app.pagetemplate = 3.11.2
31zope.app.principalannotation = 3.7.0
32zope.app.publisher = 3.10.2
33zope.app.renderer = 3.5.1
34zope.app.rotterdam = 3.5.3
35zope.app.schema = 3.5.0
36zope.app.security = 3.7.5
37zope.app.testing = 3.8.1
38zope.app.zcmlfiles = 3.7.1
39zope.app.zopeappgenerations = 3.6.1
40zope.generations = 3.7.1
410
=== removed file 'ztk-versions.cfg'
--- ztk-versions.cfg 2016-06-06 07:58:13 +0000
+++ ztk-versions.cfg 1970-01-01 00:00:00 +0000
@@ -1,112 +0,0 @@
1[versions]
2# ZTK
3zope.annotation = 3.6.0
4zope.applicationcontrol = 3.5.5
5zope.authentication = 3.7.1
6zope.broken = 3.6.0
7zope.browser = 1.3
8zope.browsermenu = 3.9.1
9zope.browserpage = 3.12.2
10zope.browserresource = 3.12.0
11zope.cachedescriptors = 3.5.1
12zope.catalog = 3.8.2
13zope.component = 3.10.0
14zope.componentvocabulary = 1.0.1
15zope.configuration = 3.7.4
16zope.container = 3.12.0
17zope.contentprovider = 3.7.2
18zope.contenttype = 3.5.5
19zope.copy = 3.5.0
20zope.copypastemove = 3.8.0
21zope.datetime = 3.4.1
22zope.deferredimport = 3.5.3
23zope.deprecation = 3.4.1
24zope.dottedname = 3.4.6
25zope.dublincore = 3.8.2
26zope.error = 3.7.4
27zope.event = 3.5.2
28zope.exceptions = 3.6.2
29zope.filerepresentation = 3.6.1
30zope.formlib = 4.0.6
31zope.hookable = 3.4.1
32zope.i18n = 3.7.4
33zope.i18nmessageid = 3.5.3
34zope.index = 3.6.4
35zope.interface = 3.7.0
36zope.intid = 3.7.2
37zope.keyreference = 3.6.4
38zope.lifecycleevent = 3.6.2
39zope.location = 3.9.1
40zope.login = 1.0.0
41zope.mimetype = 1.3.1
42zope.minmax = 1.1.2
43zope.pagetemplate = 3.5.2
44zope.password = 3.6.1
45zope.pluggableauth = 1.2
46zope.principalannotation = 3.6.1
47zope.principalregistry = 3.7.1
48zope.processlifetime = 1.0
49zope.proxy = 3.6.1
50zope.ptresource = 3.9.0
51zope.publisher = 3.12.6
52zope.ramcache = 1.0
53zope.schema = 3.7.1
54zope.security = 3.8.3
55zope.securitypolicy = 3.7.0
56zope.sendmail = 3.7.5
57zope.sequencesort = 3.4.0
58zope.server = 3.8.6
59zope.session = 3.9.5
60zope.site = 3.9.2
61zope.size = 3.4.1
62zope.structuredtext = 3.5.1
63zope.tal = 3.5.2
64zope.tales = 3.5.3
65zope.testing = 3.10.3
66zope.testrunner = 4.0.4
67zope.traversing = 3.14.0
68zope.viewlet = 3.7.2
69
70# Deprecating
71
72# Dependencies
73distribute = 0.6.36
74docutils = 0.7
75Jinja2 = 2.5.5
76mechanize = 0.2.5
77Paste = 1.7.5.1
78PasteDeploy = 1.3.4
79PasteScript = 1.7.5
80py = 1.4.8
81Pygments = 1.4
82python-gettext = 1.0
83python-subunit = 0.0.7
84pytz = 2013b
85RestrictedPython = 3.6.0
86setuptools = 0.6c11
87Sphinx = 1.0.8
88testtools = 0.9.12
89transaction = 1.1.1
90z3c.recipe.sphinxdoc = 0.0.8
91zc.buildout = 1.7.1
92zc.lockfile = 1.0.2
93ZConfig = 2.8.0
94zc.recipe.egg = 1.3.2
95zc.recipe.testrunner = 1.4.0
96zc.resourcelibrary = 1.3.4
97zdaemon = 2.0.7
98ZODB3 = 3.10.5
99zope.mkzeoinstance = 3.9.5
100
101# toolchain
102argparse = 1.1
103coverage = 3.5.2
104lxml = 2.2.8
105mr.developer = 1.25
106nose = 1.1.2
107tl.eggdeps = 0.4
108z3c.checkversions = 0.4.1
109z3c.recipe.compattest = 0.13.1
110z3c.recipe.depgraph = 0.5
111z3c.recipe.scripts = 1.0.1
112zope.kgs = 1.2.0