mirror of
https://github.com/Rushilwiz/brancher.git
synced 2025-04-21 12:30:16 -04:00
57 lines
1.2 KiB
Python
57 lines
1.2 KiB
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import print_function
|
|
|
|
import argparse
|
|
|
|
import pip_chill
|
|
|
|
|
|
def main():
|
|
"""Console script for pip_chill"""
|
|
|
|
parser = argparse.ArgumentParser(
|
|
description="Like `pip freeze`, but more relaxed."
|
|
)
|
|
parser.add_argument(
|
|
"--no-version",
|
|
action="store_true",
|
|
dest="no_version",
|
|
help="omit version numbers.",
|
|
)
|
|
parser.add_argument(
|
|
"-a",
|
|
"--all",
|
|
"--show-all",
|
|
action="store_true",
|
|
dest="show_all",
|
|
help="show all packages.",
|
|
)
|
|
parser.add_argument(
|
|
"-v",
|
|
"--verbose",
|
|
action="store_true",
|
|
dest="verbose",
|
|
help="list commented out dependencies too.",
|
|
)
|
|
args = parser.parse_args()
|
|
|
|
distributions, dependencies = pip_chill.chill(show_all=args.show_all)
|
|
for package in distributions:
|
|
if args.no_version:
|
|
print(package.get_name_without_version())
|
|
else:
|
|
print(package)
|
|
|
|
if args.verbose:
|
|
for package in dependencies:
|
|
if args.no_version:
|
|
print(package.get_name_without_version())
|
|
else:
|
|
print(package)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|