Commits


Michael A. Smith authored and GitHub committed e8c61ba4f00
AVRO-3162: Use Argparse to Manage Arguments (#1270) Improve the python cli, consisting mainly of scripts/avro and avro.tool, by implementing argparse, and a `__main__.py` module. - argparse handles arity and type exceptions more fluently at invocation time than can easily be done with sys.argv. - argparse handles sub-commands natively, especially in python 3.7 and up. - `__main__.py` dispatch (along with setuptools `entry_points.console_scripts` at install time) allows the cli to be invoked with both `python -m avro` and just `avro` without having an out-of-band `scripts/avro` directory. - Just in case someone is still using scripts/avro, I've kept that around with a deprecation warning. - I added type hints as best I can; however, the avro script has an `eval` call that we might want to get rid of, some day.