Conditional dependencies marked as missing
fpgmaas opened this issue · 0 comments
fpgmaas commented
Describe the bug
If a conditional dependency like importlib-metadata = { version = "*", python = "<=3.7" }
is not installed, it will be marked as missing:
-----------------------------------------------------
There are dependencies missing from pyproject.toml:
importlib_metadata
Consider adding them to your project's dependencies.
-----------------------------------------------------
This is because there is no way for deptry to link the module to the dependency if it is not installed.
There is a potential solution that should work in 95% of the cases; If a missing module is found AND there are conditional dependencies, do a similarity match between the dependency name and the module name. e.g. we could replace _
with -
and check for equality, or use e.g. the Lehvenstein distance.