Skip to content

gh-107220: docs: Improve importlib.metadata docs for entry point filtering#109646

Closed
megies wants to merge 1 commit intopython:mainfrom
megies:patch-1
Closed

gh-107220: docs: Improve importlib.metadata docs for entry point filtering#109646
megies wants to merge 1 commit intopython:mainfrom
megies:patch-1

Conversation

@megies
Copy link

@megies megies commented Sep 21, 2023

dist kwarg in entry_points() is currently unusable as comparison will always return False. This needs to be pointed out in docs or users transitioning to this new API will likely fall into this trap. See #107220


📚 Documentation preview 📚: https://cpython-previews--109646.org.readthedocs.build/

@ghost
Copy link

ghost commented Sep 21, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app bedevere-app bot added awaiting review docs Documentation in the Doc dir skip news labels Sep 21, 2023
`dist` kwarg in `entry_points()` is currently unusable as comparison will *always* return `False`. This needs to be pointed out in docs or users transitioning to this new API will likely fall into this trap
@hugovk hugovk changed the title docs: Improve importlib.metadata docs for entry point filtering gh-107220: docs: Improve importlib.metadata docs for entry point filtering Sep 21, 2023
@hugovk hugovk removed the skip issue label Sep 21, 2023
@brettcannon brettcannon removed their request for review September 21, 2023 18:58
The ``entry_points()`` function returns a collection of entry points.
Entry points are represented by ``EntryPoint`` instances;
each ``EntryPoint`` has a ``.name``, ``.group``, and ``.value`` attributes and
each ``EntryPoint`` has ``.name``, ``.dist``, ``.group``, and ``.value`` attributes and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I'd want to document EntryPoint this way. Some EntryPoint objects have a .dist but others do not (see the docstring for Entrypoint.matches). Notice also that EntryPoint._key() (and methods relying on it) do not consider .dist to be essential.

@megies
Copy link
Author

megies commented Mar 21, 2024

Well I mean, it's all good to me, I figured out whats going on, just trying to help others not waste time like I did when trying to filter entry points by distribution.

@megies megies closed this Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants