File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -336,6 +336,7 @@ def __repr__(self) -> str:
336336
337337
338338class DeprecatedNonAbstract :
339+ # Required until Python 3.14
339340 def __new__ (cls , * args , ** kwargs ):
340341 all_names = {
341342 name for subclass in inspect .getmro (cls ) for name in vars (subclass )
@@ -391,16 +392,18 @@ def from_name(cls, name: str) -> "Distribution":
391392 raise PackageNotFoundError (name )
392393
393394 @classmethod
394- def discover (cls , ** kwargs ) -> Iterable ["Distribution" ]:
395+ def discover (
396+ cls , * , context : Optional ['DistributionFinder.Context' ] = None , ** kwargs
397+ ) -> Iterable ["Distribution" ]:
395398 """Return an iterable of Distribution objects for all packages.
396399
397400 Pass a ``context`` or pass keyword arguments for constructing
398401 a context.
399402
400403 :context: A ``DistributionFinder.Context`` object.
401- :return: Iterable of Distribution objects for all packages.
404+ :return: Iterable of Distribution objects for packages matching
405+ the context.
402406 """
403- context = kwargs .pop ('context' , None )
404407 if context and kwargs :
405408 raise ValueError ("cannot accept context and kwargs" )
406409 context = context or DistributionFinder .Context (** kwargs )
You can’t perform that action at this time.
0 commit comments