fix: Rename, extract checker into a separate script

This commit is contained in:
lxobr 2024-11-19 14:33:08 +01:00
parent 263ecb9149
commit f27dc0c91a
2 changed files with 20 additions and 21 deletions

View file

@ -0,0 +1,20 @@
import argparse
import asyncio
from cognee.tasks.repo_processor.get_local_dependencies import get_local_script_dependencies
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Get local script dependencies.")
# Suggested path: .../cognee/examples/python/simple_example.py
parser.add_argument("script_path", type=str, help="Absolute path to the Python script file")
# Suggested path: .../cognee
parser.add_argument("repo_path", type=str, help="Absolute path to the repository root")
args = parser.parse_args()
dependencies = asyncio.run(get_local_script_dependencies(args.script_path, args.repo_path))
print("Dependencies:")
for dependency in dependencies:
print(dependency)

View file

@ -124,24 +124,3 @@ async def get_local_script_dependencies(script_path: str, repo_path: Optional[st
dependencies = await _extract_dependencies(script_path)
return [path for path in dependencies if path.startswith(str(repo_path))]
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Get local script dependencies.")
# Suggested path: .../cognee/examples/python/simple_example.py
parser.add_argument("script_path", type=str, help="Absolute path to the Python script file")
# Suggested path: .../cognee
parser.add_argument("repo_path", type=str, help="Absolute path to the repository root")
args = parser.parse_args()
script_path = args.script_path
repo_path = args.repo_path
dependencies = asyncio.run(get_local_script_dependencies(script_path, repo_path))
print("Dependencies:")
for dependency in dependencies:
print(dependency)