madpah / requirements-parser

A Pip requirements file parser.
https://requirements-parser.readthedocs.io
Apache License 2.0
128 stars 42 forks source link

Type of `Requirement.specs` is incorrect #78

Closed wch closed 7 months ago

wch commented 2 years ago

The type of Requirement.specs is declared to be List[str]: https://github.com/madpah/requirements-parser/blob/1ce923617147dd984c280d56cb1f02fcd3589a7c/requirements/requirement.py#L90

However, the actual type is List[Tuple[str, str]], like [('>', '1.5'), ('<', '1.6')].

The value is assigned here, and the type of the source value is declared as [list[tuple[str, str]]. The # type: ignore isn't needed on that line.

image