This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.araujo
Recipients alexis, eric.araujo, jkloth, michael.mulich, tarek
Date 2012-05-21.19:21:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1337628094.39.0.351535654763.issue14871@psf.upfronthosting.co.za>
In-reply-to
Content
At present distutils2/packaging uses many command line parsers:

- one parser for commands and their options implemented in the dist.Distribution class, inherited from distutils and based on fanncy_getopt;

- another parser for pysetup actions and options implemented in run.Dispatcher, also using fancy_getopt;

- a _parse_args function based on getopt (le gasp!) and used by the functions implementing pysetup actions.

This causes no end of bugs and maintenance issues.  The actions system could also be much improved; one issue is that the option parsing is not automated (unlike for commands) and the loading of actions is not lazy.  See https://groups.google.com/forum/#!topic/the-fellowship-of-the-packaging/pxOZ_j4_4yg for details.

My current inclination is to just use argparse everywhere, with a thin wrapper to preserve the current way to declare commands options, and something similar for actions.  Backporting argparse for 2.5, 2.6 and 3.1 won’t be hard and using it should buy us much.  The key thing is that the various subparsers (e.g. for pysetup, for the run action, for one command) should work together lazily: the pysetup parser should parse its options and stop at the 'run' segment, then pass on to the run action parser, etc.  The goal is to avoid creating all the parsers for actions and commands.
History
Date User Action Args
2012-05-21 19:21:34eric.araujosetrecipients: + eric.araujo, tarek, jkloth, alexis, michael.mulich
2012-05-21 19:21:34eric.araujosetmessageid: <1337628094.39.0.351535654763.issue14871@psf.upfronthosting.co.za>
2012-05-21 19:21:33eric.araujolinkissue14871 messages
2012-05-21 19:21:33eric.araujocreate