Skip to content

Commit

Permalink
Support indents and spaces in imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Lengyel authored and Ivan Lengyel committed Sep 20, 2020
1 parent 2d814be commit 52003ca
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/dist/
/*.egg-info
tests/
.ipynb_checkpoints/
Empty file modified LICENSE.txt
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified pipreqsnb/__init__.py
100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions pipreqsnb/pipreqsnb.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ def main():
source = ''.join(valid_lines)
imports += get_import_string_from_source(source)

# hack to remove the indents if imports are inside functions
imports = [i.lstrip() for i in imports]

if is_file:
args.savepath = set_requirements_savepath(args)
args.path = temp_path
Expand Down
Empty file modified requirements.txt
100644 → 100755
Empty file.
Empty file modified setup.cfg
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion setup.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='pipreqsnb',
version='0.2.1',
version='0.2.2',
description='Pipreqs with jupyter notebook support',
url='https://github.com/ivanlen/pipreqsnb',
author='Ivan Lengyel',
Expand Down

0 comments on commit 52003ca

Please sign in to comment.