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
=== modified file 'lib/devscripts/ec2test/builtins.py'
--- lib/devscripts/ec2test/builtins.py 2009-10-04 15:40:46 +0000
+++ lib/devscripts/ec2test/builtins.py 2009-10-05 13:34:12 +0000
@@ -18,7 +18,6 @@
18import socket18import socket
1919
20from devscripts import get_launchpad_root20from devscripts import get_launchpad_root
21from devscripts.autoland import LaunchpadBranchLander, MissingReviewError
2221
23from devscripts.ec2test.credentials import EC2Credentials22from devscripts.ec2test.credentials import EC2Credentials
24from devscripts.ec2test.instance import (23from devscripts.ec2test.instance import (
@@ -343,6 +342,19 @@
343 instance_type=DEFAULT_INSTANCE_TYPE, postmortem=False,342 instance_type=DEFAULT_INSTANCE_TYPE, postmortem=False,
344 debug=False, commit_text=None, dry_run=False, testfix=False,343 debug=False, commit_text=None, dry_run=False, testfix=False,
345 print_commit=False, force=False):344 print_commit=False, force=False):
345 try:
346 from devscripts.autoland import (
347 LaunchpadBranchLander, MissingReviewError)
348 except ImportError:
349 self.outf.write(
350 "***************************************************\n\n"
351 "Could not load the autoland module; please ensure\n"
352 "that launchpadlib and lazr.uri are installed and\n"
353 "found in sys.path/PYTHONPATH.\n\n"
354 "Note that these should *not* be installed system-\n"
355 "wide because this will break the rest of Launchpad.\n\n"
356 "***************************************************\n")
357 raise
346 if debug:358 if debug:
347 pdb.set_trace()359 pdb.set_trace()
348 if print_commit and dry_run:360 if print_commit and dry_run: