Skip to content

Commit

Permalink
Improved logging to reflect environment should be activated (#24)
Browse files Browse the repository at this point in the history
* improved docstrings
  • Loading branch information
Florian Maas authored Sep 4, 2022
1 parent d376a2e commit 28959f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion deptry/import_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

class ImportParser:
"""
Scan a Python file for import statements and return a list of imported modules.
Class to scan Python files or Python code for import statements. Scanning is done by creating the abstract syntax tree
and extracting all nodes that contain import statements.
"""

def __init__(self) -> None:
Expand Down
4 changes: 3 additions & 1 deletion deptry/imports_to_package_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ def convert(self, imported_modules: List[str]) -> List[str]:
elif module in COMMON_PACKAGES_WITHOUT_METADATA.keys():
packages.append(COMMON_PACKAGES_WITHOUT_METADATA[module])
else:
logging.warning(f"Warning: Failed to find corresponding package name for import {module}")
logging.warning(
f"Warning: Failed to find corresponding package name for import {module} in current environment."
)

if len(packages) == 0:
logging.warning(
Expand Down

0 comments on commit 28959f1

Please sign in to comment.