-
Notifications
You must be signed in to change notification settings - Fork 20
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
Imports with package names different from module names are wrongly reported as missing instead of transitive #827
Comments
Thanks for the report, the issue is not exactly about having itchiodl==2.3.0 and the following Python file: import bs4
import itchiodl ( Then if we run $ deptry .
Scanning 1 file...
foo.py:1:8: DEP001 'bs4' imported but missing from the dependency definitions
Found 1 dependency issue. The issue is that we currently try to guess the Python module names for each package by only taking into account the direct dependencies (defined for instance in In order to handle this case properly, we'd need to be able to apply the reverse logic, i.e. after we parse all imports in the codebase, we guess the Python package from the module names. We'll need to check if it's possible to do easily without breaking the current logic. |
Hi ,
|
Environment
Describe the issue
I have a project which has django-cms in its requirements.txt, and I import those packages depend on django-cms like django-classy-tags, django-formtools... those should be detected as a transitive dependency, but it seems deptry can't recognize those with a - packages's name, so it turns out detected as a missing dependency.
Minimal way to reproduce the issue
import classytags
from formtools.wizard.views import WizardView
import sekizai
from treebeard.mp_tree import MP_Node
from packaging import version
those with - will be detected as DEP001 incorrectly, but without dash's package can be detected as transitive successfully.
The text was updated successfully, but these errors were encountered: