-
Notifications
You must be signed in to change notification settings - Fork 633
Fix entry_points deprecation #1233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1233 +/- ##
===========================================
+ Coverage 65.88% 65.90% +0.01%
===========================================
Files 86 86
Lines 8884 8886 +2
===========================================
+ Hits 5853 5856 +3
+ Misses 3031 3030 -1 |
|
||
BACKENDS.update( | ||
{interface.name: tuple(interface.value.split(":")) for interface in entries} | ||
) | ||
except ImportError: | ||
from pkg_resources import iter_entry_points |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not for long, see #1234. 😃
entries = entry_points(group="can.interface") | ||
except TypeError: | ||
# Fallback for Python <3.10 | ||
# See https://docs.python.org/3/library/importlib.metadata.html#entry-points, "Compatibility Note" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also use importlib_metadata
from PyPI as fallback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would also be possible, yep.
As it's just so little effort, I thought it's simpler to just handle the fallback here.
This PR should also be squashed. |
Part of #1230.