fpgmaas/deptry

Confusing DEP003 error

Closed this issue · 2 comments

Describe the bug

I'm using urllib3 in my code and importing it and deptry complains about it, but I'm not sure why.

To Reproduce

Run in this project: https://github.com/msys2/msys2-autobuild

$ deptry .
msys2_autobuild/config.py:3:1: DEP003 'urllib3' imported but it is a transitive dependency

Expected behavior

No error, since urllib3 is a direct dependency.

If it was a transitive dependency I wouldn't import it, so I'm a bit confused about the error in general.


I found one unused dep in another project, so thanks for that!

urllib3 does not seem to be a direct dependency, rather it is available because your project depends on requests, which in turn depends on urllib3. Thus it is a transitive dependency, and you should consider adding urllib3 to your list of dependencies explicitly.

Of course if you feel that this is not needed you can ignore this DEP003 error, see here.

Hope this clarifies! Will close this issue for now as I assume this solves your question. If not, let me know

Ah, damn, it was missing from my dependencies! I somehow didn't get that from the message.

thanks!