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: Optional[DistributionFinder.Context] = None, **kwargs
)
| 410 | |
| 411 | @classmethod |
| 412 | def discover( |
| 413 | cls, *, context: Optional[DistributionFinder.Context] = None, **kwargs |
| 414 | ) -> Iterable[Distribution]: |
| 415 | """Return an iterable of Distribution objects for all packages. |
| 416 | |
| 417 | Pass a ``context`` or pass keyword arguments for constructing |
| 418 | a context. |
| 419 | |
| 420 | :context: A ``DistributionFinder.Context`` object. |
| 421 | :return: Iterable of Distribution objects for packages matching |
| 422 | the context. |
| 423 | """ |
| 424 | if context and kwargs: |
| 425 | raise ValueError("cannot accept context and kwargs") |
| 426 | context = context or DistributionFinder.Context(**kwargs) |
| 427 | return itertools.chain.from_iterable( |
| 428 | resolver(context) for resolver in cls._discover_resolvers() |
| 429 | ) |
| 430 | |
| 431 | @staticmethod |
| 432 | def at(path: str | os.PathLike[str]) -> Distribution: |
no test coverage detected