Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional dependencies marked as missing #68

Closed
fpgmaas opened this issue Sep 9, 2022 · 0 comments · Fixed by #73
Closed

Conditional dependencies marked as missing #68

fpgmaas opened this issue Sep 9, 2022 · 0 comments · Fixed by #73
Labels
bug Something isn't working

Comments

@fpgmaas
Copy link
Owner

fpgmaas commented Sep 9, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant