Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue15302] Use argparse instead of getopt in test.regrtest

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jul 8, 2012, 10:26 PM

Post #1 of 13 (556 views)
Permalink
[issue15302] Use argparse instead of getopt in test.regrtest

New submission from Chris Jerdonek <chris.jerdonek [at] gmail>:

I think it would be an improvement to switch from using getopt to argparse in test.regrtest. The code would be easier to maintain, it would give us more powerful options going forward, and it would improve the usability of the test command (e.g. nicer command-line help).

----------
components: Tests
keywords: easy
messages: 165064
nosy: cjerdonek
priority: normal
severity: normal
status: open
title: Use argparse instead of getopt in test.regrtest
versions: Python 3.3

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15302>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 8, 2012, 10:28 PM

Post #2 of 13 (550 views)
Permalink
[issue15302] Use argparse instead of getopt in test.regrtest [In reply to]

Chris Jerdonek <chris.jerdonek [at] gmail> added the comment:

It is also in the spirit of dogfooding.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15302>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 9, 2012, 7:10 PM

Post #3 of 13 (547 views)
Permalink
[issue15302] Use argparse instead of getopt in test.regrtest [In reply to]

Ezio Melotti <ezio.melotti [at] gmail> added the comment:

Do you want to propose a patch?
regrtest has no tests, so switching to argparse might cause more harm than good right now.

----------
nosy: +ezio.melotti
stage: -> needs patch
type: -> enhancement

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15302>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 9, 2012, 8:50 PM

Post #4 of 13 (543 views)
Permalink
[issue15302] Use argparse instead of getopt in test.regrtest [In reply to]

Chris Jerdonek <chris.jerdonek [at] gmail> added the comment:

Sure, if someone is open to reviewing it.

The parsing code doesn't seem to be doing anything too fancy right now. I can decouple the parsing code and begin adding tests around parts that may need it more. Increasing coverage will be easier going forward.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15302>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 9, 2012, 11:37 PM

Post #5 of 13 (551 views)
Permalink
[issue15302] Use argparse instead of getopt in test.regrtest [In reply to]

Senthil Kumaran <senthil [at] uthcode> added the comment:

On Mon, Jul 9, 2012 at 8:50 PM, Chris Jerdonek <report [at] bugs> wrote:>
> Sure, if someone is open to reviewing it.

Yes, please go ahead. I can review it and I believe others should be
able to as well. As a first short, I think, it may be a good idea to
just replacing the short opt and long opt handling behavior and not
dwell too much into argparse features (just to ascertain that we are
not going through a new code-path. this I believe, may help assuage
Ezio's concern a bit that regrtest.py lacks test and changes to them
should be carefully done at this point in time in release). Or the
other idea is you may submit the patch and if it is significant, it
may go in early in 3.4

----------
nosy: +orsenthil

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15302>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 9, 2012, 11:45 PM

Post #6 of 13 (541 views)
Permalink
[issue15302] Use argparse instead of getopt in test.regrtest [In reply to]

Chris Jerdonek <chris.jerdonek [at] gmail> added the comment:

Thanks, Senthil. That is my plan. I should be able to have code with tests in no later than a week.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15302>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 10, 2012, 12:36 AM

Post #7 of 13 (542 views)
Permalink
[issue15302] Use argparse instead of getopt in test.regrtest [In reply to]

Chris Jerdonek <chris.jerdonek [at] gmail> added the comment:

By the way, issue 15300 has a related patch that is ready to review today.

Assuming that one is okay, it would make sense to commit first because it overlaps with the changes I'll be doing here.

Issue 15305 is another related issue (also overlapping) that is probably worth discussing.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15302>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 10, 2012, 1:04 PM

Post #8 of 13 (539 views)
Permalink
[issue15302] Use argparse instead of getopt in test.regrtest [In reply to]

R. David Murray <rdmurray [at] bitdance> added the comment:

As mentioned, the first step is to create some tests that can validate the current behavior, so that changes don't break things. This is a non-trivial task. I know from experience with a similar refactoring that even seemingly simple changes can have unexpected consequences, and that getting good functional test coverage (not code-line test coverage) is hard. This is complicated by the fact that regrtest is an over-evolved mess. My ideal is to move appropriate pieces of the functionality into unittest and make regrtest a wrapper around that, but obviously I haven't spent much time actually doing that.

I don't think that regrtest tests need to be run as part of the standard python test run, by the way, though I suppose they could be.

----------
nosy: +r.david.murray

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15302>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 10, 2012, 11:30 PM

Post #9 of 13 (539 views)
Permalink
[issue15302] Use argparse instead of getopt in test.regrtest [In reply to]

Chris Jerdonek <chris.jerdonek [at] gmail> added the comment:

Here is a patch that creates some unit tests for the existing getopt argument parsing code.

In response to the comments, I'm thinking of a less invasive approach that involves wrapping argparse's parse_args() to return getopt-like output (and in particular, to match test expectations).

In this way, we will be able to keep main() mostly unaffected while still being able to use argparse.

----------
keywords: +patch
Added file: http://bugs.python.org/file26349/issue-15302-1.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15302>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 11, 2012, 3:52 AM

Post #10 of 13 (536 views)
Permalink
[issue15302] Use argparse instead of getopt in test.regrtest [In reply to]

Chris Jerdonek <chris.jerdonek [at] gmail> added the comment:

Attached is a first version of a complete patch.

Note that I found three bugs in the current argument parsing code in the course of working on this patch: issue 15324, issue 15325, and issue 15326 (because of various typos in the getopt configuration). All of these should be fixed by the current patch.

----------
Added file: http://bugs.python.org/file26355/issue-15302-2.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15302>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 11, 2012, 6:05 AM

Post #11 of 13 (539 views)
Permalink
[issue15302] Use argparse instead of getopt in test.regrtest [In reply to]

Changes by Brett Cannon <brett [at] python>:


----------
stage: needs patch -> patch review

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15302>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 12, 2012, 12:46 AM

Post #12 of 13 (531 views)
Permalink
[issue15302] Use argparse instead of getopt in test.regrtest [In reply to]

Georg Brandl <georg [at] python> added the comment:

Please leave this for Python 3.4 -- it is not a bugfix.

----------
nosy: +georg.brandl
versions: +Python 3.4 -Python 3.3

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15302>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 13, 2012, 12:00 PM

Post #13 of 13 (526 views)
Permalink
[issue15302] Use argparse instead of getopt in test.regrtest [In reply to]

Changes by Tshepang Lekhonkhobe <tshepang [at] gmail>:


----------
nosy: +tshepang

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15302>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.