altair
altair copied to clipboard
fix(#2675): replace entrypoints with importlib.metadata
As mentioned in #2675, entrypoints is now in maintenance mode. We can replace it with importlib.metadata and remove the extra dependency for python < 3.8.
Ah! Tested locally with 3.10 and 3.6. Missed that the selection interface was added in 3.10. I'll update this to parse the dict from entry_points() instead.
Thanks for the PR @daylinmorgan! Can you synchronize this PR with the latest changes on master? Hopefully @joelostblom can do a review here. A bit of explanation of the suggested changes would help as well.
This has been rebased on master.
PR drops unnecessary (and the now in maintenance mode) entrypoints module for a standard library equivalent where possible and otherwise relies on the backport (python <3.8).
Thanks @daylinmorgan!
Honestly, I'm not very familiar with the entrypoints concept. Reading https://amir.rachum.com/amp/blog/2017/07/28/python-entry-points.html was a fun introduction.
I am interested in approaches where and how this is being used in corporation with Altair. Are you aware of any examples of this usage?
In other words, how to test this?
The entrypoints I'm aware of are in altair_saver and altair_viewer
Thanks! It is out of scope of this PR, but it seems the entry points in these packages also require updating once Altair is going to vegalite 5. The entry points should become "altair.vegalite.v5.renderer" I think.
Again out of scope, but I'm wondering if it already breaks on the main repo of Altair if a specific VL5 spec is parsed through these entry points.
I'm fine with this PR, you also @joelostblom?
Thank you @daylinmorgan!