-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow builtins and resolved paths as cli types
The architecture for type conversion in the argparse integration was intended for using pathlib.Path, but had no flexibility even for builtin types like int Here, remove the old `globals()` lookup, which exposed too much internal api. Instead, attempt to lookup simple strings as builtins, and strings with dots as resolved module imports (e.g. `module.submodule.type`). `Path` is kept as an exception, so using `type: Path` will still convert the argument into a path ruamel is now used for serialization, as pyyaml didn't support serialization of specific python classes (e.g. Path) without restricting other classes: it was all or nothing. ruamel is safe by default, and allows specifically opting in to representing different classes Clarify in docs how Path should be used for all paths to avoid relative path issues Resolves #294
- Loading branch information
Showing
15 changed files
with
350 additions
and
109 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.