Skip to content

fix: simplify Click flag_value default handling by requiring Click >=8.3.0#854

Closed
LOCKhart07 wants to merge 3 commits intomainfrom
fix/click-flag-value-default
Closed

fix: simplify Click flag_value default handling by requiring Click >=8.3.0#854
LOCKhart07 wants to merge 3 commits intomainfrom
fix/click-flag-value-default

Conversation

@LOCKhart07
Copy link
Member

@LOCKhart07 LOCKhart07 commented Mar 6, 2026

Summary

  • Bumps Click lower bound from >=8.1.0 to >=8.3.0 (upper bound stays <8.4.0). Click 8.3.0 preserves the default parameter as-is when multiple options share a destination with flag_value.
  • Simplifies registry_flag and remote_registry_flag in click_utils.py — removes sorting workaround and just passes default=_default on each option, which Click 8.3.0+ handles correctly.
  • Fixes aea push-all ignoring the registry config set via aea init --remote --ipfs (was always defaulting to local).

Test plan

  • pytest tests/test_cli/test_add/test_click_utils.py — all 19 tests pass (verified with Click 8.3.1)
  • Smoke test: aea init --remote --ipfs then aea push-all uses remote/IPFS registry

🤖 Generated with Claude Code

LOCKhart07 and others added 3 commits March 7, 2026 02:38
…on flags

When multiple Click options share the same destination parameter, Click uses the
flag_value of the outermost (last-applied) decorator as the effective default,
ignoring the default= string. This caused `aea push-all` to always default to
local registry regardless of config set via `aea init --remote --ipfs`.

Sort registry_flag and remote_registry_flag options so the one matching the
configured default is applied last. Use default=None with explicit normalization
for update_package_versions script flags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…8.3.0

Click 8.3.0 preserves the `default` parameter as-is when multiple options
share a destination with `flag_value`, removing the need for sorting or
callback workarounds. Bump lower bound to >=8.3.0 and simplify the
registry_flag and remote_registry_flag decorators accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@DavidMinarsch
Copy link

We cannot be sure of the downstream impact in constraining click - proposing this solution instead: #855

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants