-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dependencies: update requirement to
click~=8.0
The entire logic around parameter parsing, including the consuming of the value, optionally prompting and then processing the value has changed. Especially the prompting logic has changed, which now makes the custom logic in our `InteractiveOption` largely unnecessary. It had to be refactored significantly and it now no longer changes the prompt behavior but just overrides certain methods to include the concept of non-interactivity which is not native to `click`. In addition to this major change, there were also various smaller changes. The following adaptations had to be made for compatibility: * Parameter validators now have to return the value, whereas before this was not required. * Custom parameter types need to start with checking for the value to already have the expected return type and then return it. This is necessary because the convert method can be called multiple times: https://click.palletsprojects.com/en/8.0.x/parameters/#implementing-custom-types * The `aiida.cmdline.params.options.contextualdefault.ContextualDefaultOption` has been removed as it was not used in `aiida-core` nor in any plugin that is hosted on Github. * `Parameter.get_default` now takes the `call` argument * Remove explicit parameter name from `version_option`, this is now by default set to just `--version`. * Add explicit `type` for `MultipleValueOption` options in `verdi run`. This is necessary because without it the entire string would be parsed as a single string and not a tuple of strings. * The `ConditionalOption` test `test_prompt_callback` had to be changed. With the old `click`, as soon as wrong input was provided at the prompt and the callback raised, the command would fail. With the new behavior of `click`, the user will be prompted until the callback validates, printing the error message each time. This required the test to be changed to actually pass a valid input at the end through the `user_input` or the test would hang as it was infinitely prompting. * The `Path` parameter removed the `path_type` attribute. It has been more or less been replaced by `name`. * The `click._compat.filename_ui` utility was removed. Note that the lower requirement for `click` is set to `v8.0.3` since in lower patch versions the behavior of prompts for boolean type parameters is different.
- Loading branch information
Showing
34 changed files
with
1,021 additions
and
1,315 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.