fpgmaas/deptry

Optional dependencies not marked as optional

akeeman opened this issue · 2 comments

Describe the bug

Maybe I'm wrong, but as I read it some dependencies should have been marked optional while they're not, when using pep621 (or pdm):

[project.optional-dependencies]
group1 = [
"foobar",
"barfoo",
]
group2 = [
"dep",
]

foobar:

assert not dependencies[4].is_optional

barfoo:

assert not dependencies[5].is_optional

dep:

assert not dependencies[6].is_optional

Well spotted. This is a consequence of lack of standardization within the Python ecosystem/PEP-621. PEP-621 does not specify a way to list development dependencies, and just places everything under optional dependencies. See e.g. here. So for optional dependencies, we use the definition as listed here. It is done by this part of the code. I don't think there is much we can do to improve here, but if you have any ideas feel free to share them!

Ok, I wasn't aware that it was intentional.