Skip to content

Commit

Permalink
Merge pull request #1912 from pallets/version-name-changelog
Browse files Browse the repository at this point in the history
update changelog about version_option
  • Loading branch information
davidism committed May 19, 2021
2 parents c0013d3 + 26c9b92 commit b131f71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ Released 2021-05-11
- Add an optional parameter to ``ProgressBar.update`` to set the
``current_item``. :issue:`1226`, :pr:`1332`
- ``version_option`` uses ``importlib.metadata`` (or the
``importlib_metadata`` backport) instead of ``pkg_resources``.
:issue:`1582`
``importlib_metadata`` backport) instead of ``pkg_resources``. The
version is detected based on the package name, not the entry point
name. The Python package name must match the installed package
name, or be passed with ``package_name=``. :issue:`1582`
- If validation fails for a prompt with ``hide_input=True``, the value
is not shown in the error message. :issue:`1460`
- An ``IntRange`` or ``FloatRange`` option shows the accepted range in
Expand Down
5 changes: 4 additions & 1 deletion src/click/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,10 @@ def version_option(
value for messages.
.. versionchanged:: 8.0
Use :mod:`importlib.metadata` instead of ``pkg_resources``.
Use :mod:`importlib.metadata` instead of ``pkg_resources``. The
version is detected based on the package name, not the entry
point name. The Python package name must match the installed
package name, or be passed with ``package_name=``.
"""
if message is None:
message = _("%(prog)s, version %(version)s")
Expand Down

0 comments on commit b131f71

Please sign in to comment.