Compatibility shim providing selectable entry points for older implementations
Project description
Compatibility shim to ease adoption of importlib_metadata 3.6. Supplies forward-compatibility of “selectable” entry points even on older versions of importlib_metadata and importlib.metadata, and avoids usage that triggers deprecation warnings.
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 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 affected project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for backports.entry_points_selectable-1.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17a8b44ae700fba548686dd274ddc91c060371565cd63806c20a1d33911746e6 |
|
MD5 | 1b9e52414e61cc24e25e21edac88ca1a |
|
BLAKE2b-256 | fc25dae014b114397a6f60578d7358bf5fcb103f71556e5363a50d7b42e9bc51 |
Hashes for backports.entry_points_selectable-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66f5da003eb4b283c7b60581bc8bb0baf0d810eb3e3068da786d3821b4d5746a |
|
MD5 | c6e404d31a80f324c5b7c7b1a7f75b9c |
|
BLAKE2b-256 | 5a78b3ba5d804ae21e26e6179bbe4e1338deaaba9d20161918f59e20e9d92ea0 |