sarugaku / resolvelib

Resolve abstract dependencies into concrete ones
ISC License
142 stars 31 forks source link

Typing inconsistency: `AbstractProvider.get_preferences` #104

Closed woodruffw closed 2 years ago

woodruffw commented 2 years ago

Here's how AbstractProvider.get_preferences is defined:

    def get_preference(
        self,
        identifier,
        resolutions,
        candidates,
        information,
        backtrack_causes,
    ):

and here's the .pyi definition:

    def get_preference(
        self,
        identifier: KT,
        resolutions: Mapping[KT, CT],
        candidates: Mapping[KT, Iterator[CT]],
        information: Mapping[KT, Iterator[RequirementInformation[RT, CT]]],
    ) -> Preference: ...

Note that the latter is missing backtrack_causes, so any downstream consumers of resolvelib's type hints won't be able to use the signature.

I'm happy to make a small PR fixing this!

notatallshaw commented 2 years ago

Ah, this would be great of you! It's been on my TODO list for a while but I still can't submit PRs for another week.