fix: simplify Click flag_value default handling by requiring Click >=8.3.0#854
Closed
LOCKhart07 wants to merge 3 commits intomainfrom
Closed
fix: simplify Click flag_value default handling by requiring Click >=8.3.0#854LOCKhart07 wants to merge 3 commits intomainfrom
LOCKhart07 wants to merge 3 commits intomainfrom
Conversation
…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>
|
We cannot be sure of the downstream impact in constraining click - proposing this solution instead: #855 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
>=8.1.0to>=8.3.0(upper bound stays<8.4.0). Click 8.3.0 preserves thedefaultparameter as-is when multiple options share a destination withflag_value.registry_flagandremote_registry_flaginclick_utils.py— removes sorting workaround and just passesdefault=_defaulton each option, which Click 8.3.0+ handles correctly.aea push-allignoring the registry config set viaaea 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)aea init --remote --ipfsthenaea push-alluses remote/IPFS registry🤖 Generated with Claude Code