Sha256: 3c612a1ae5497b9301058711f58bd63f03e3e56b70fa1e6107348239acfb5a0e

Contents?: true

Size: 727 Bytes

Versions: 9

Compression:

Stored size: 727 Bytes

Contents

#!/usr/bin/env python

import json
import sys
from pip.req import parse_requirements
from pip.download import PipSession
from pip._vendor import pkg_resources
from pip._vendor.six import print_

requirements = [pkg_resources.Requirement.parse(str(req.req)) for req
                in parse_requirements(sys.argv[1], session=PipSession()) if req.req != None]

transform = lambda dist: {
        'name': dist.project_name,
        'version': dist.version,
        'location': dist.location,
        'dependencies': list(map(lambda dependency: dependency.project_name, dist.requires())),
        }

packages = [transform(dist) for dist
            in pkg_resources.working_set.resolve(requirements)]

print_(json.dumps(packages))

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
license_finder-5.1.1 bin/license_finder_pip.py
license_finder-5.1.0 bin/license_finder_pip.py
license_finder-5.0.3 bin/license_finder_pip.py
license_finder-5.0.2 bin/license_finder_pip.py
license_finder-5.0.0 bin/license_finder_pip.py
license_finder-4.0.2 bin/license_finder_pip.py
license_finder-4.0.1 bin/license_finder_pip.py
license_finder-3.1.1 bin/license_finder_pip.py
license_finder-3.0.4 bin/license_finder_pip.py