Beispiel #1
0
 def _callFUT(self, path, metadata_version=None):
     from pkginfo.utils import get_metadata
     if metadata_version is not None:
         return get_metadata(path, metadata_version)
     return get_metadata(path)
Beispiel #2
0
 def _callFUT(self, path, metadata_version=None):
     from pkginfo.utils import get_metadata
     if metadata_version is not None:
         return get_metadata(path, metadata_version)
     return get_metadata(path)
Beispiel #3
0
import os
from glob import glob
from pkginfo.utils import get_metadata
import pkg_resources

def first(generator):
    try:
        return generator.next()
    except StopIteration:
        pass

versions = {}
deps = {}

for x in glob("lib/python2.6/site-packages/*.egg-info"):
    p = get_metadata(x)
    versions[p.name] = p.version

    reqpath = os.path.join(x, "requires.txt")
    if os.path.exists(reqpath):
        r = open(reqpath).read().splitlines()
        deps[p.name] = []
        for line in r:
            if not line:
                continue
            try:
                deps[p.name].append(first(pkg_resources.parse_requirements(line)).project_name)
            except ValueError:
                pass

state = {}