Skip to content

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

Merged
merged 5 commits into from
Jan 27, 2022
Merged

Conversation

felixdivo
Copy link
Collaborator

Part of #1230.

@felixdivo felixdivo added the QA about improving and maintaining the quality of the library label Jan 27, 2022
@felixdivo felixdivo added this to the 4.0.0 Release milestone Jan 27, 2022
@felixdivo felixdivo self-assigned this Jan 27, 2022
@codecov
Copy link

codecov bot commented Jan 27, 2022

Codecov Report

Merging #1233 (0fd9203) into develop (f1808ed) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@             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
Copy link
Collaborator

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?

Copy link
Collaborator Author

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"
Copy link
Collaborator

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

Copy link
Collaborator Author

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.

@felixdivo
Copy link
Collaborator Author

This PR should also be squashed.

@zariiii9003 zariiii9003 merged commit c7ba84a into develop Jan 27, 2022
@mergify mergify bot deleted the fix-deprecation-entry_points branch January 27, 2022 16:06
@jagauthier jagauthier mentioned this pull request May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QA about improving and maintaining the quality of the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants