Automatically write module footers for click autocompletion for specified binaries#4056
Open
Crivella wants to merge 6 commits intoeasybuilders:developfrom
Open
Automatically write module footers for click autocompletion for specified binaries#4056Crivella wants to merge 6 commits intoeasybuilders:developfrom
Crivella wants to merge 6 commits intoeasybuilders:developfrom
Conversation
bbd5fef to
57597bc
Compare
4447313 to
5046076
Compare
…tuple of (name, version, data)
lorisercole
reviewed
Feb 4, 2026
Co-authored-by: Loris Ercole <30901257+lorisercole@users.noreply.github.com>
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.
Currently, writing the module footers to automatically enable/disable
clickautocompletion on module load/unload is fairly cumbersome and can add significant chunks of repeated code to many easyconfigs.See for example:
This PR adds a new configuration
click_autocomplete_binsoption toPythonPackage, to allow passing a list of strings (click script/binaries names) to specify which scripts should have autocompletion enabled.The module footer required for autocompletion will be added both in the case of isolated
PythonPackages or whenPythonPackageis used throughPythonBundleNOTE
I am not running
BINARY_NAME --helpas a sanity check automatically as, even if it is the default forclickthe normal name can be altered (see https://click.palletsprojects.com/en/stable/documentation/#help-parameter-customization)The
_UPPERCASECOMMAND_COMPLETE=bash_source COMMANDinstead should always produce a_aitw_viscosity_completionfunction for the bash completion (since we manually unset this when unloading the module).This will also catch eventual changes in the behavior of click in the future