fix(pipreqs): More verbose output

This commit is contained in:
Vadim Kravcenko 2015-04-24 08:32:38 +02:00
parent bdd8b66235
commit ecc8db88f5
2 changed files with 6 additions and 0 deletions

View File

@ -33,6 +33,9 @@ Example
:: ::
$ pipreqs /home/project/location $ pipreqs /home/project/location
Looking for imports
Getting latest version of packages information from PyPi
Found third-party imports: flask, requests, sqlalchemy, docopt
Successfuly saved requirements file in: /home/project/location/requirements.txt Successfuly saved requirements file in: /home/project/location/requirements.txt
Why not pip freeze? Why not pip freeze?

View File

@ -77,8 +77,11 @@ def get_imports_info(imports):
return result return result
def init(args): def init(args):
print ("Looking for imports")
imports = get_all_imports(args['<path>']) imports = get_all_imports(args['<path>'])
print ("Getting latest version of packages information from PyPi")
imports_with_info = get_imports_info(imports) imports_with_info = get_imports_info(imports)
print ("Found third-party imports: " + ", ".join(imports))
path = args["--savepath"] if args["--savepath"] else os.path.join(args['<path>'],"requirements.txt") path = args["--savepath"] if args["--savepath"] else os.path.join(args['<path>'],"requirements.txt")
generate_requirements_file(path, imports_with_info) generate_requirements_file(path, imports_with_info)
print ("Successfuly saved requirements file in: " + path) print ("Successfuly saved requirements file in: " + path)