From bcd7183fe3cc6a5e5d072c745c9ed24a03929314 Mon Sep 17 00:00:00 2001 From: Abdullah Qureshi <111448185+arbimaq@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:53:25 +0500 Subject: [PATCH] minor modifications --- edx_repo_tools/unused_dependencies/gather_imports.py | 2 +- edx_repo_tools/unused_dependencies/unused_dependencies.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/edx_repo_tools/unused_dependencies/gather_imports.py b/edx_repo_tools/unused_dependencies/gather_imports.py index 5a258f7a..29f6230d 100644 --- a/edx_repo_tools/unused_dependencies/gather_imports.py +++ b/edx_repo_tools/unused_dependencies/gather_imports.py @@ -71,7 +71,7 @@ def gather_imports( path, imports = set()): files = [f for f in content if isfile(join(path, f))] for file in files: if file.endswith('.py'): - imports.update(manually_parse_imports(join(path, file))) + imports.update(parse_imports(join(path, file))) dirs = {d for d in content if isdir(join(path, d))} for dir in dirs - blacklist: diff --git a/edx_repo_tools/unused_dependencies/unused_dependencies.py b/edx_repo_tools/unused_dependencies/unused_dependencies.py index 19366bb1..8d89784d 100644 --- a/edx_repo_tools/unused_dependencies/unused_dependencies.py +++ b/edx_repo_tools/unused_dependencies/unused_dependencies.py @@ -16,7 +16,8 @@ def unused_dependencies(path): requirements = populate_requirements(join(path, 'requirements')) imports = gather_imports(path) - print(requirements) - print(imports) + # print(requirements) + # print(imports) unused = (requirements - imports) - whitelist - assert len(unused) == 0, "The following packages are unused: {}".format(unused) + print(unused) + # assert len(unused) == 0, "The following packages are unused: {}".format(unused)