Return an iterable of Distribution objects for all packages. Pass a ``context`` or pass keyword arguments for constructing a context. :context: A ``DistributionFinder.Context`` object. :return: Iterable of Distribution objects for packages matching the con
(
cls, *, context: DistributionFinder.Context | None = None, **kwargs
)
| 468 | |
| 469 | @classmethod |
| 470 | def discover( |
| 471 | cls, *, context: DistributionFinder.Context | None = None, **kwargs |
| 472 | ) -> Iterable[Distribution]: |
| 473 | """Return an iterable of Distribution objects for all packages. |
| 474 | |
| 475 | Pass a ``context`` or pass keyword arguments for constructing |
| 476 | a context. |
| 477 | |
| 478 | :context: A ``DistributionFinder.Context`` object. |
| 479 | :return: Iterable of Distribution objects for packages matching |
| 480 | the context. |
| 481 | """ |
| 482 | if context and kwargs: |
| 483 | raise ValueError("cannot accept context and kwargs") |
| 484 | context = context or DistributionFinder.Context(**kwargs) |
| 485 | return itertools.chain.from_iterable( |
| 486 | resolver(context) for resolver in cls._discover_resolvers() |
| 487 | ) |
| 488 | |
| 489 | @staticmethod |
| 490 | def _prefer_valid(dists: Iterable[Distribution]) -> Iterable[Distribution]: |
no test coverage detected