Skip to content

Handling Dependencies Used Indirectly via Frameworks #729

Answered by fpgmaas
ben-sandham asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for raising this, it is an interesting point. deptry looks for imports in your codebase to determine which libraries are actually used. In this case, as you correctly notice deptry considers uvicorn as not used since it is not imported.

Scanning the dependency tree would not solve this; If my project has A as a transitive dependency because it is required by B, that does not imply that I should have A also in my list of dependencies. Only when I actively use A should I also list it in my project's dependencies. In your situation the latter is the case, but since for deptry 'actively use' is synonymous to 'import' it fails to pick this up.

In this case, I think the most sensible sol…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ben-sandham
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants