# HG changeset patch # User Jeff Hammel # Date 1330379092 28800 # Node ID 4df3e715817df0faa58341380c613583e9c3c538 # Parent 11bc01a089e7a81df6e6fbac93bb04770420f9be now have passing tests again diff -r 11bc01a089e7 -r 4df3e715817d paint/package.py --- a/paint/package.py Mon Feb 27 13:10:18 2012 -0800 +++ b/paint/package.py Mon Feb 27 13:44:52 2012 -0800 @@ -9,6 +9,7 @@ import tarfile import tempfile import urllib2 +import urlparse import utils try: @@ -145,6 +146,7 @@ def dependencies(self): """return the dependencies""" + # get the egg_info directory egg_info = self.egg_info() # read the dependencies @@ -153,4 +155,17 @@ dependencies = [i.strip() for i in file(requires).readlines() if i.strip()] else: dependencies = [] + dependencies = dict([(i, None) for i in dependencies]) + # read the dependency links + dependency_links = os.path.join(egg_info, 'dependency_links.txt') + if os.path.exists(dependency_links): + links = [i.strip() for i in file(dependency_links).readlines() if i.strip()] + for link in links: + # XXX pretty ghetto + assert '#egg=' in link + url, dep = link.split('#egg=', 1) + if dep in dependencies: + dependencies[dep] = link + + return dependencies diff -r 11bc01a089e7 -r 4df3e715817d tests/doctest.txt --- a/tests/doctest.txt Mon Feb 27 13:10:18 2012 -0800 +++ b/tests/doctest.txt Mon Feb 27 13:44:52 2012 -0800 @@ -9,4 +9,6 @@ >>> jetperf = paint.Package('http://k0s.org/mozilla/hg/jetperf/archive/tip.tar.gz') >>> dependencies = jetperf.dependencies() + >>> dependencies == {'mozharness': 'http://hg.mozilla.org/build/mozharness/archive/tip.tar.gz#egg=mozharness', 'talos': 'http://hg.mozilla.org/build/talos/archive/tip.tar.gz#egg=talos'} + True >>> jetperf.cleanup()