Skip to content

Commit

Permalink
Add an example of how a custom provider might leverage the Distributi…
Browse files Browse the repository at this point in the history
…onFinder.Context.
  • Loading branch information
jaraco committed Jan 6, 2024
1 parent 8635240 commit a6038c3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions importlib_metadata/__init__.py
Expand Up @@ -667,6 +667,17 @@ class Context:
Each DistributionFinder may expect any parameters
and should attempt to honor the canonical
parameters defined below when appropriate.
This mechanism gives a custom provider a means to
solicit additional details from the caller beyond
"name" and "path" when searching distributions.
For example, imagine a provider that exposes suites
of packages in either a "public" or "private" ``realm``.
A caller may wish to query only for distributions in
a particular realm and could call
``distributions(realm="private")`` to signal to the
custom provider to only include distributions from that
realm.
"""

name = None
Expand Down

0 comments on commit a6038c3

Please sign in to comment.