Skip to content

Commit

Permalink
Prefer imperative voice
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Nov 27, 2023
1 parent dfddd1d commit b15df87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ Compatibility shim to ease adoption of `importlib_metadata 3.6 <https://importli

Use this shim for libraries or applications invoking ``entry_points()`` that run on Python older than 3.10 or where importlib_metadata is older than 3.6. In most cases, this shim is unnecessary and the easiest thing to do is simply require ``importlib_metadata >= 3.6`` on all Pythons (or only those prior to 3.10a7). In some environments, a library may be constrained on which versions of ``importlib_metadata`` can be required, so this library bridges that gap.

To use this shim, add ``backports.entry_points_selectable`` to your project requirements. It will require ``importlib_metadata`` automatically where needed (prior to Python 3.8) but be satisfied by older versions. Projects should still require ``importlib_metadata`` as appropriate for API uses other than for ``entry_points``.
To use this shim, add ``backports.entry_points_selectable`` to the affected project's requirements. It will require ``importlib_metadata`` automatically where needed (prior to Python 3.8) but be satisfied by older versions. Projects should still require ``importlib_metadata`` as appropriate for API uses other than for ``entry_points``.

Then in code, instead of ``from importlib.metadata import entry_points``, use::

from backports.entry_points_selectable import entry_points

And then use the "selectable" features (pass keyword arguments to ``entry_points`` or invoke ``.select()`` on the result).

This backport has a very lenient dependency on `importlib_metadata` for older Pythons and is a single module implementation. If adding a dependency is a concern, this module may be vendored into the downstream project.
This backport has a very lenient dependency on `importlib_metadata` for older Pythons and is a single module implementation. If adding a dependency is a concern, this module may be vendored into the affected project.

0 comments on commit b15df87

Please sign in to comment.