Skip to content

Conversation

@alexrashed
Copy link
Member

@alexrashed alexrashed commented Nov 26, 2025

Motivation

With #13398, we explicitly marked the host mode as deprecated using click's native deprecation mechanism introduced in pallets/click#2271.
Unfortunately, I forgot to bump the minimum version of click, and while we now need at least 8.2, in some environments with an older click version already present this can cause the following error:

Traceback (most recent call last):
  File "/home/runner/.local/bin/localstack", line 23, in <module>
    main()
  File "/home/runner/.local/bin/localstack", line 19, in main
    main.main()
  File "/home/runner/.local/lib/python3.12/site-packages/localstack/cli/main.py", line 15, in main
    from .localstack import create_with_plugins
  File "/home/runner/.local/lib/python3.12/site-packages/localstack/cli/localstack.py", line 436, in <module>
    @click.option("--host", is_flag=True, help="Start LocalStack directly on the host", deprecated=True)
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 373, in decorator
    _param_memo(f, cls(param_decls, **attrs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/click/core.py", line 2536, in __init__
    super().__init__(param_decls, type=type, multiple=multiple, **attrs)
TypeError: Parameter.__init__() got an unexpected keyword argument 'deprecated'
Error: Process completed with exit code 1.

Changes

  • Declare that we need click>=8.2.0.
  • No need to update the dependency locks, since they are already on the latest version.

Testing

Unfortunately, we can't really have a pipeline testing LocalStack's CLI with all the different possible dependency versions.
In the future we will revamp the CLI and at least extract it from the repo to make releases easier and disconnected to the runtime.
For now, I verified this fix manually:

cd /tmp
python3 -m venv .venv
source .venv/bin/activate
pip install localstack==4.11.0 click==8.1.2
localstack --help || true
# shows the error
pip install click==8.2.0
localstack --help
# shows the deprecation warning but works just fine

@alexrashed alexrashed added this to the 4.11 milestone Nov 26, 2025
@alexrashed alexrashed added area: cli LocalStack CLI semver: patch Non-breaking changes which can be included in patch releases docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes labels Nov 26, 2025
@silv-io
Copy link
Member

silv-io commented Nov 26, 2025

Good catch, here are the corresponding release notes, confirming that the deprecated: bool kwarg was added in 8.2

https://github.com/pallets/click/releases/tag/8.2.0

@github-actions
Copy link

Test Results - Preflight, Unit

22 669 tests   20 901 ✅  6m 25s ⏱️
     1 suites   1 768 💤
     1 files         0 ❌

Results for commit 199c13f.

Copy link
Member

@silv-io silv-io left a comment

Choose a reason for hiding this comment

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

LGTM!

@alexrashed alexrashed merged commit 01a3da5 into main Nov 26, 2025
42 checks passed
@alexrashed alexrashed deleted the fix-cli-click-dependency branch November 26, 2025 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli LocalStack CLI docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes semver: patch Non-breaking changes which can be included in patch releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants