Skip to content

Commit

Permalink
Fixed too many warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemanspiff2007 committed Sep 21, 2021
1 parent b08b984 commit 7439d47
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/sphinx_exec_code/sphinx_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,21 @@ def builder_ready(app):
# Search for a python package and print a warning if we find none
# since this is the only reason to specify a working dir
for _f in folders:
package_found = False
for __f in _f.iterdir():
if not __f.is_dir():
continue

# log warning if we don't find a python package
for file in __f.iterdir():
if file.name == '__init__.py':
package_found = True
break
else:
log.warning(f'[exec-code] No Python package found in {_f}')
if package_found:
break

if not package_found:
log.warning(f'[exec-code] No Python packages found in {_f}')

setup_code_env(cwd, folders)
return None
Expand Down

0 comments on commit 7439d47

Please sign in to comment.