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

Per rule ignore with hypens are ignored #643

Closed
Zer0x00 opened this issue Mar 25, 2024 · 1 comment · Fixed by #644
Closed

Per rule ignore with hypens are ignored #643

Zer0x00 opened this issue Mar 25, 2024 · 1 comment · Fixed by #644
Labels
bug Something isn't working

Comments

@Zer0x00
Copy link

Zer0x00 commented Mar 25, 2024

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
@Zer0x00 Zer0x00 added the bug Something isn't working label Mar 25, 2024
@mkniewallner
Copy link
Collaborator

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.

@Zer0x00 Zer0x00 closed this as completed Mar 25, 2024
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.

2 participants