New submission from Éric Araujo <mer...@netwok.org>:

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.

----------
assignee: eric.araujo
components: Distutils2
messages: 161289
nosy: alexis, eric.araujo, jkloth, michael.mulich, tarek
priority: normal
severity: normal
stage: needs patch
status: open
title: Rewrite the command line parsers and actions system used in distutils2
type: enhancement
versions: 3rd party, Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14871>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to