Skip to content

Instantly share code, notes, and snippets.

@kyrcha
Created July 29, 2022 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyrcha/99e2bbf0222024760e7a12e8cb95aa4a to your computer and use it in GitHub Desktop.
Save kyrcha/99e2bbf0222024760e7a12e8cb95aa4a to your computer and use it in GitHub Desktop.
Finding all local dependencies as a tree for a python file

Using the library importlab and grep on a shell prompt from the project's root folder:

importlab --tree path/to/file.py | grep -E '^\s+[^::]*py$'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment