biocore / pyqi

Tools for developing and testing command line interfaces in Python.
Other
9 stars 13 forks source link

optparse vs argparse #248

Open Jorge-C opened 10 years ago

Jorge-C commented 10 years ago

I've read some old discussions where an argparse backend is mentioned, but I wonder why command line parsing is eventually performed by optparse. It's deprecated in Python 2.7 (pyqi's only supported version in master) and in Python 3.2 onwards.

The recommended replacement is argparse. PEP389, from 2009, has information on why optparse was deprecated and argparse introduced, and its advantages have been documented elsewhere. For example, it doesn't need any of the hairy stuff in core/interfaces/optparse/init.py:PyqiOption.

There's no expected time to have it removed from the stdlib. Nonetheless, apart from the better features, error messages, cleaner code... this is too new and shiny to be using deprecated modules!

antgonza commented 10 years ago

+1

jairideout commented 10 years ago

:+1: this definitely needs to happen, especially before we start converting QIIME to use pyqi config files.

We have a milestone for porting to argparse (which doesn't have any issues assigned to it yet). Adding this issue to the milestone.

ElDeveloper commented 10 years ago

... this is too new and shiny to be using deprecated modules!

:+1:

wasade commented 10 years ago

:+1: