fpgmaas/deptry

Per rule ignore with hypens are ignored

Closed this issue · 1 comments

Describe the bug

deptry currently fails to ignore dependencies which have a hyphen (-) in it.
This is reliably reproducible either with the CLI and also with a pyproject.toml configuration.

To Reproduce

Add this to your pyproject.toml:

[tool.deptry.per_rule_ignores]
DEP003 = ["mypy-boto3-dynamodb"]

Run deptry . while a file has this dependency imported

Expected behavior

The dependency should be ignored.

System [please complete the following information]:

  • OS: Debian 11 (bullseye)
  • Language Version: Python 3.12
  • Poetry version: uv 0.1.24

The ignore rules for DEP003 should match the Python module name, not the package name. This is unfortunately wrongly reported by deptry.

Using this configuration should work as expected:

[tool.deptry.per_rule_ignores]
DEP003 = ["mypy_boto3_dynamodb"]

#644 should fix the reported violation.