This builds on #64 to add typing to the CLI args. Let me know if this is taking the refactor too far but I thought it would be satisfying and cool to reuse the typing already specified in the CLI arg configuration for actual type hinting. This way we can be sure that CLI args are actually supported in the code and any args used in the code are included in the CLI args.
I tried to figure out a way to infer the types directly from the argparser without having to re-specify but couldn't figure out a way to do that. The Namespace object provided by argparse just type hints everything as Any and doesn't specify which attributes exist and which don't. There might be better type hinting practices for other argparsers like click but I didn't want to go too far with the refactor since there's already a good bit of change. That's something to potentially improve in the future.
This builds on #64 to add typing to the CLI args. Let me know if this is taking the refactor too far but I thought it would be satisfying and cool to reuse the typing already specified in the CLI arg configuration for actual type hinting. This way we can be sure that CLI args are actually supported in the code and any args used in the code are included in the CLI args.
I tried to figure out a way to infer the types directly from the argparser without having to re-specify but couldn't figure out a way to do that. The
Namespace
object provided by argparse just type hints everything asAny
and doesn't specify which attributes exist and which don't. There might be better type hinting practices for other argparsers like click but I didn't want to go too far with the refactor since there's already a good bit of change. That's something to potentially improve in the future.