Merge lp:~allenap/launchpad/packages-for-autoload-bug-443061 into lp:launchpad

Proposed by Gavin Panella
Status: Merged
Approved by: Jonathan Lange
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~allenap/launchpad/packages-for-autoload-bug-443061
Merge into: lp:launchpad
Diff against target: 31 lines
1 file modified
lib/devscripts/ec2test/builtins.py (+13/-1)
To merge this branch: bzr merge lp:~allenap/launchpad/packages-for-autoload-bug-443061
Reviewer Review Type Date Requested Status
Jonathan Lange (community) Approve
Review via email: mp+12867@code.launchpad.net

Commit message

Import devscripts.autoland only as late as possible and show an explanatory message if it fails to load, so that other commands available through utilities/ec2 can still be used.

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

Import autoland as late as possible, and show an explanatory message if it fails.

Revision history for this message
Gavin Panella (allenap) wrote :

Max Bowsher said "The problem with recommending that people install the system package of lazr.uri is that it breaks launchpad dev". I asked him later to elaborate:

<maxb> So the problem is that setuptools installs a *-nspkg.pth file
  which registers the toplevel lazr package with a __path__ pointing
  to the system directory
<maxb> This defeats attempts to add any other lazr.* via PYTHONPATH
<maxb> And then you have a bit of a conundrum. I haven't figured out
  how to solve it, or if it is soluble
<allenap> maxb: Ah, that's grizzly. If it's installed via a deb then
  this won't be a problem, will it? Not that there's a lazr.uri deb
  easily available.
<maxb> Yes, it is a problem, and there's lazr.something debs available
  in karmic, hence me noticing the problem
<maxb> python-lazr-uri | 1.0-0ubuntu1 | karmic | all

I changed the warning message to recommend against any system-wide
installation of these packages, rather than just pointing the finger
at setuptools.

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

Thanks for fixing this, Gavin.

review: Approve
Revision history for this message
Gary Poster (gary) wrote :

I have a branch that makes this warning unnecessary. The necessary eggs are not yet in the download-cache branch, but this is the branch: lp:~gary/launchpad/buildout-py .

This change shouldn't harm anything, but the warning should become unnecessary after my branch lands.

Gary

Revision history for this message
Gavin Panella (allenap) wrote :

On Tue, 06 Oct 2009 18:32:40 -0000
Gary Poster <email address hidden> wrote:

> I have a branch that makes this warning unnecessary. The necessary
> eggs are not yet in the download-cache branch, but this is the
> branch: lp:~gary/launchpad/buildout-py .

Part of the problem is that utilities/ec2 needs to run with Python
2.5+ because of boto. I tried getting it to run with the buildout
managed bin/py but with no luck; boto wanted hashlib and even when I
got buildout to install that too, it expected a different calling
convention for... something else, can't remember what.

I don't think the branch above addresses that, or does it? I feel
like I'm missing some crucial detail :)

Gavin.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/devscripts/ec2test/builtins.py'
2--- lib/devscripts/ec2test/builtins.py 2009-10-04 15:40:46 +0000
3+++ lib/devscripts/ec2test/builtins.py 2009-10-05 13:34:12 +0000
4@@ -18,7 +18,6 @@
5 import socket
6
7 from devscripts import get_launchpad_root
8-from devscripts.autoland import LaunchpadBranchLander, MissingReviewError
9
10 from devscripts.ec2test.credentials import EC2Credentials
11 from devscripts.ec2test.instance import (
12@@ -343,6 +342,19 @@
13 instance_type=DEFAULT_INSTANCE_TYPE, postmortem=False,
14 debug=False, commit_text=None, dry_run=False, testfix=False,
15 print_commit=False, force=False):
16+ try:
17+ from devscripts.autoland import (
18+ LaunchpadBranchLander, MissingReviewError)
19+ except ImportError:
20+ self.outf.write(
21+ "***************************************************\n\n"
22+ "Could not load the autoland module; please ensure\n"
23+ "that launchpadlib and lazr.uri are installed and\n"
24+ "found in sys.path/PYTHONPATH.\n\n"
25+ "Note that these should *not* be installed system-\n"
26+ "wide because this will break the rest of Launchpad.\n\n"
27+ "***************************************************\n")
28+ raise
29 if debug:
30 pdb.set_trace()
31 if print_commit and dry_run: