mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-07 03:55:22 +00:00
Merge 1199e135e6b782e3e4247c46bb18fea495d41fb3 into a593d27e3d9fcdecc0fbf385ef43116cccad71ec
This commit is contained in:
commit
128e940ae1
@ -105,6 +105,11 @@ def get_all_imports(
|
|||||||
for root, dirs, files in walk:
|
for root, dirs, files in walk:
|
||||||
dirs[:] = [d for d in dirs if d not in ignore_dirs]
|
dirs[:] = [d for d in dirs if d not in ignore_dirs]
|
||||||
|
|
||||||
|
ipynb_files = [fn for fn in files if os.path.splitext(fn)[1] == ".ipynb"]
|
||||||
|
|
||||||
|
for ipynb_file in ipynb_files:
|
||||||
|
os.system("ipython nbconvert --to script " + str(ipynb_file))
|
||||||
|
|
||||||
candidates.append(os.path.basename(root))
|
candidates.append(os.path.basename(root))
|
||||||
files = [fn for fn in files if os.path.splitext(fn)[1] == ".py"]
|
files = [fn for fn in files if os.path.splitext(fn)[1] == ".py"]
|
||||||
|
|
||||||
@ -130,6 +135,11 @@ def get_all_imports(
|
|||||||
logging.error("Failed on file: %s" % file_name)
|
logging.error("Failed on file: %s" % file_name)
|
||||||
raise exc
|
raise exc
|
||||||
|
|
||||||
|
# Clean up created .py files from .ipynb files
|
||||||
|
|
||||||
|
for ipynb_file in ipynb_files:
|
||||||
|
os.remove(ipynb_file.replace("ipynb", "py"))
|
||||||
|
|
||||||
# Clean up imports
|
# Clean up imports
|
||||||
for name in [n for n in raw_imports if n]:
|
for name in [n for n in raw_imports if n]:
|
||||||
# Sanity check: Name could have been None if the import
|
# Sanity check: Name could have been None if the import
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
wheel==0.23.0
|
wheel==0.23.0
|
||||||
Yarg==0.1.9
|
Yarg==0.1.9
|
||||||
docopt==0.6.2
|
docopt==0.6.2
|
||||||
|
ipython==8.4.0
|
||||||
|
nbconvert==7.0.0
|
12
tests/_data_ignore/requirements.txt
Normal file
12
tests/_data_ignore/requirements.txt
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
asposestorage==1.0.2
|
||||||
|
beautifulsoup4==4.11.1
|
||||||
|
boto==2.49.0
|
||||||
|
docopt==0.6.2
|
||||||
|
Flask==1.1.2
|
||||||
|
ipython==8.4.0
|
||||||
|
nose==1.3.7
|
||||||
|
peewee==3.15.1
|
||||||
|
pyflakes==2.3.1
|
||||||
|
requests==2.28.1
|
||||||
|
SQLAlchemy==1.4.32
|
||||||
|
ujson==5.1.0
|
Loading…
x
Reference in New Issue
Block a user