/usr/bin/license_finder_pip.py is in license-finder-pip 2.1.2-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #!/usr/bin/env python
import json
from pip.req import parse_requirements
from pip.download import PipSession
from pip._vendor import pkg_resources
from pip._vendor.six import print_
requirements = [req.req for req
in parse_requirements('requirements.txt', session=PipSession())]
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))
|