[issue14858] 'pysetup create' off-by-one when choosing classification maturity status interactively.

Todd DeLuca report at bugs.python.org
Sat May 19 17:17:24 CEST 2012


New submission from Todd DeLuca <todddeluca at gmail.com>:

Today I installed distutils2 via pip and ran 'pysetup create'.  During the selection of Trove classifiers for Development status I chose '2 - Alpha' but setup.cfg ended up incorrectly indicating that my project is Pre-Alpha.

Here is a "screenshot" of the interactive setup with me choosing '2 - Alpha':

```
Do you want to set Trove classifiers? (y/n): y
            Please select the project status:

            0 - Planning
1 - Pre-Alpha
2 - Alpha
3 - Beta
4 - Production/Stable
5 - Mature
6 - Inactive

            Status: 2
```

Here is the relevant line in setup.cfg:

    classifier = Development Status :: 2 - Pre-Alpha

Here are the relevant Trove classifications from http://pypi.python.org/pypi?%3Aaction=list_classifiers:

``` 
Development Status :: 1 - Planning
Development Status :: 2 - Pre-Alpha
Development Status :: 3 - Alpha
Development Status :: 4 - Beta
Development Status :: 5 - Production/Stable
Development Status :: 6 - Mature
Development Status :: 7 - Inactive
```

Notice above that the numbers assigned to the Trove classifiers are greater (by one) than the numbers displayed in the pysetup script.

The problem is in file distutil2/create.py (http://hg.python.org/distutils2/file/d015f9edccb8/distutils2/create.py) in class MainProgram, method set_maturity_status().  

Changing the following line:


   676             Status''' % '\n'.join('%s - %s' % (i, maturity_name(n))

To the following:


   676             Status''' % '\n'.join('%s - %s' % (i + 1, maturity_name(n))

Should display the numbers correctly and fix the problem.  I tested this fix on my system (using python2.7.3) and it works correctly.

Regards,
Todd

P.S. Apologies for not submitting a "Pull request".

----------
assignee: eric.araujo
components: Distutils2
messages: 161129
nosy: alexis, eric.araujo, tarek, todddeluca
priority: normal
severity: normal
status: open
title: 'pysetup create' off-by-one when choosing classification maturity status interactively.
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14858>
_______________________________________


More information about the Python-bugs-list mailing list