GeezerVison is showing github.com — Fix `package_name` resolution when module differs from distribution name by kdeldycke · Pull Request #3582 · pallets/click
Conversation
kdeldycke
commented
Jun 11, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
There is an issue we glossed over when closing #2331: I analyzed the bug report as requiring a new slot/field to be added to the @version_option decorator. I promptly close the issue as we decided in https://github.com/pallets/click/discussions/3527 to freeze @version_option.
But looking closely #2331 did not asked for a new module_name field. That was my suggestion on how to address the user request.
So reframing it, #2331 is a report that @version_option is producing a RuntimeError for users in some legitimate situations. This breaks the out-of-the-box experience of @version_option.
In fact, the limitation has been pointed out by @davidism a couple of years ago at #1884 (comment):
If someone figures out a way to get the distribution version from the entry point name with importlib.metadata, I'd welcome a PR to improve our detection, but from my experiments with it I was not able to find how to do it. For now, I'll update the changelog.
So this is a PR to implement that fix.
Addresses:
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was
linked to
issues
Jun 11, 2026
This was referenced Jun 11, 2026
|
Just rebased this PR. It is ready to be merged to stable.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
parsing
Parsing, parameters, commands, chaining, context
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.
|