Skip to content
Myr

Merge pull request #1221 from jjmaestro/patch-1

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Explicit explanation of the breaking change in 7.0

authored by David Lord · committed by GitHub · parents 98a55ab, 06b8263 · Browse files · 1 file+31 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+31 added−0 removed

  • other:+31 added−0 removed

1 file+31 added−0 removed

modified:docs/upgrading.rst+31 added
4 unmodified lines
5this is not entirely possible. In case we need to break backwards6compatibility this document gives you information about how to upgrade or7handle backwards compatibility properly.89.. _upgrade-to-7.0:1011Upgrading to 7.012----------------1314Commands that take their name from the decorated function now replace15underscores with dashes. For example, the Python function ``run_server``16will get the command name ``run-server`` now. There are a few options17to address this:1819- To continue with the new behavior, pin your dependency to20 ``Click>=7`` and update any documentation to use dashes.21- To keep existing behavior, add an explicit command name with22 underscores, like ``@click.command("run_server")``.23- To try a name with dashes if the name with underscores was not24 found, pass a ``token_normalize_func`` to the context:2526 .. code-block:: python2728 def normalize(name):29 return name.replace("_", "-")3031 @click.group(context_settings={"token_normalize_func": normalize})32 def group():33 ...3435 @group.command()36 def run_server():37 ...383940.. _upgrade-to-3.2:4142Upgrading to 3.243----------------
88 unmodified lines