gh-107220: docs: Improve importlib.metadata docs for entry point filtering#109646
Closed
megies wants to merge 1 commit intopython:mainfrom
Closed
gh-107220: docs: Improve importlib.metadata docs for entry point filtering#109646megies wants to merge 1 commit intopython:mainfrom
megies wants to merge 1 commit intopython:mainfrom
Conversation
hugovk
reviewed
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
jaraco
reviewed
Mar 21, 2024
| 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 |
Member
There was a problem hiding this comment.
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.
Author
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
distkwarg inentry_points()is currently unusable as comparison will always returnFalse. 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/