diff options
| author | Josip Djolonga <devnull@localhost> | 2010-06-06 15:15:07 +0200 |
|---|---|---|
| committer | Josip Djolonga <devnull@localhost> | 2010-06-06 15:15:07 +0200 |
| commit | be2b179bb809dbd1de8c7b0bb1fcb696b3ad2e2e (patch) | |
| tree | a1a974d11be9e70da24d7193a3c517dce0a8dbe7 /src/distutils2/depgraph.py | |
| parent | aa8e9a22124c8756b79251ca9d25df7b9d98b6f2 (diff) | |
| download | disutils2-be2b179bb809dbd1de8c7b0bb1fcb696b3ad2e2e.tar.gz | |
Finishing support for eggs, the test suite is left
Diffstat (limited to 'src/distutils2/depgraph.py')
| -rw-r--r-- | src/distutils2/depgraph.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/distutils2/depgraph.py b/src/distutils2/depgraph.py index 7b05ab2..e138fc2 100644 --- a/src/distutils2/depgraph.py +++ b/src/distutils2/depgraph.py @@ -119,7 +119,7 @@ def generate_graph(dists): provides = dist.metadata['Provides-Dist'] + dist.metadata['Provides'] for p in provides: - comps = p.split(" ", 1) + comps = p.strip().rsplit(" ", 1) name = comps[0] version = None if len(comps) == 2: @@ -137,7 +137,7 @@ def generate_graph(dists): requires = dist.metadata['Requires-Dist'] + dist.metadata['Requires'] for req in requires: predicate = VersionPredicate(req) - comps = req.split(" ", 1) + comps = req.strip().rsplit(" ", 1) name = comps[0] if not name in provided: @@ -175,11 +175,13 @@ def dependent_dists(dists, dist): return dep if __name__ == '__main__': + import sys + sys.path.append('/home/josip/dev/distutils2/src/distutils2/_backport/tests/fake_dists') dists = list(pkgutil.get_distributions(use_egg_info=True)) graph = generate_graph(dists) for dist, reqs in graph.missing.iteritems(): if len(reqs) > 0: print("Missing dependencies for %s: %s" % (dist.name, ", ".join(reqs))) - f = open('output.dot', 'w') - graph.to_dot(f, True) + f = open('/home/josip/Desktop/output.dot', 'w') + graph_to_dot(graph, f, True) |
