deptry
deptry copied to clipboard
Imports with package names different from module names are wrongly reported as missing instead of transitive
Environment
- deptry version: 0.16.1
- Python version: 3.11
- Operating system (e.g. Ubuntu 22.04, Windows 11): Mac OS 14.0
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
- Have a new project with django-cms in the requirements, and install in a conda environment
- In project import classytags from formtools.wizard.views import WizardView import sekizai from treebeard.mp_tree import MP_Node from packaging import version
- python -m deptry .
those with - will be detected as DEP001 incorrectly, but without dash's package can be detected as transitive successfully.