fpgmaas / deptry

Find unused, missing and transitive dependencies in a Python project.

Home Page:https://deptry.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request Summary

smart-programmer opened this issue · comments

Is your feature request related to a problem? Please describe.
Currently, deptry cannot detect if an extra package is needed for a feature that is used in the codebase. This is because extra packages are not directly imported in the codebase. An example is the pydantic package, which provides an EmailStr type that can be used for emails. This feature relies on the email_validator package to validate the email. However, Poetry cannot detect this dependency between pydantic and email_validator if EmailStr is used in the codebase.

Describe the solution you would like
I would like Poetry to be able to detect whether an installed extra package is needed for a feature in the codebase. One possible solution is to introduce a flag, such as --extras, that can be used like this: deptry --extras .. The output of this command would be the list of unused extra packages.

Is this feature within the scope of the project or even possible at all?

Additional context
pydantic using email_validator for EmailStr

WhatsApp Image 2023-07-11 at 2 57 07 PM