[ python-Bugs-1529871 ] distutils regression related to Distribution.run_command

SourceForge.net noreply at sourceforge.net
Sat Jul 29 00:04:19 CEST 2006


Bugs item #1529871, was opened at 2006-07-27 17:49
Message generated for change (Comment added) made by pje
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1529871&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
>Status: Closed
>Resolution: Fixed
Priority: 6
Submitted By: Collin Winter (collinwinter)
Assigned to: Phillip J. Eby (pje)
Summary: distutils regression related to Distribution.run_command

Initial Comment:
The following used to work in Python 2.4.x but fails
under Python 2.5:

>>> import setuptools
>>> import distutils.core
>>> distutils.core._setup_stop_after = 'config'
>>> 
>>> import setup
>>> setup.dist.run_command('test')

Where setup.dist is an instance of
distutils.core.Distribution (which setuptools replaces
with setuptools.dist.Distribution).

Under Python 2.4.x, this code would execute setuptools'
test command. Under Python 2.5b2 (as of r50855), this
code results in the following exception:

/opt/dev/python/2.5/lib/python2.5/distutils/dist.py:263:
UserWarning: Unknown distribution option: 'test_suite'
  warnings.warn(msg)
Traceback (most recent call last):
  File "test.py", line 8, in <module>
    setup.dist.run_command('test')
  File
"/opt/dev/python/2.5/lib/python2.5/distutils/dist.py",
line 992, in run_command
    cmd_obj = self.get_command_obj(command)
  File
"/opt/dev/python/2.5/lib/python2.5/distutils/dist.py",
line 868, in get_command_obj
    klass = self.get_command_class(command)
  File
"/opt/dev/python/2.5/lib/python2.5/site-packages/setuptools/dist.py",
line 357, in get_command_class
    return _Distribution.get_command_class(self, command)
  File
"/opt/dev/python/2.5/lib/python2.5/distutils/dist.py",
line 851, in get_command_class
    raise DistutilsModuleError("invalid command '%s'" %
command)
distutils.errors.DistutilsModuleError: invalid command
'test'

I'd greatly appreciate it if this regression could be
fixed before Python 2.5 is released.

----------------------------------------------------------------------

>Comment By: Phillip J. Eby (pje)
Date: 2006-07-28 22:04

Message:
Logged In: YES 
user_id=56214

Fixed in r50916 on the trunk.

----------------------------------------------------------------------

Comment By: Phillip J. Eby (pje)
Date: 2006-07-28 04:53

Message:
Logged In: YES 
user_id=56214

Um, why is there a py2.4 egg on your python 2.5 path?

Setuptools configures itself according to the Python version
it is built with, so a 2.4 egg is not going to be correctly
configured for 2.5.  I don't know if this is related to your
problem or not, but I was unable to reproduce your problem
with a setuptools 0.7a1 checkout.  I was only able to
reproduce it with setuptools 0.6.


----------------------------------------------------------------------

Comment By: Collin Winter (collinwinter)
Date: 2006-07-27 22:12

Message:
Logged In: YES 
user_id=1344176

I've tried using setuptools 0.7a1 in conjunction with Python
2.5b2 (r50877), and the problem still exists. setuptools'
extension commands still do not work (tested: rotate, alias,
egg_info, bdist_egg, test), that is, 'python2.5 setup.py
test' still fails with "error: invalid command 'test'".

Also, the code snippet in the bug report does not work. I am
sure Python is picking up setuptools 0.7a1 because the path
/opt/dev/python/2.5/lib/python2.5/site-packages/setuptools-0.7a1dev_r50755-py2.4.egg/setuptools/dist.py
appears in the traceback.

----------------------------------------------------------------------

Comment By: Phillip J. Eby (pje)
Date: 2006-07-27 21:13

Message:
Logged In: YES 
user_id=56214

Problem source confirmed: reverting the PEP 302 breakage of
r46372 (need-for-speed import cache hack) fixes the problem.

setuptools 0.7a1 doesn't show any problems because it uses
2.5's "pkgutil" module if possible, and r46372 patches
pkgutil in a way that masks the problem, at least as far as
setuptools is concerned, for this one specific feature. 
(Other code in setuptools is affected in both 0.6 *and* 0.7,
and will require further workaround code to be written.)



----------------------------------------------------------------------

Comment By: Phillip J. Eby (pje)
Date: 2006-07-27 18:35

Message:
Logged In: YES 
user_id=56214

I can't reproduce this using setuptools 0.7a1 and the Python
2.5 trunk.  Please note that setuptools 0.6 does *not*
support Python 2.5; there were numerous changes needed and
there may still be additional changes needed.  Please try
using setuptools 0.7a1 and let me know what you find out. 
Thanks.


----------------------------------------------------------------------

Comment By: Collin Winter (collinwinter)
Date: 2006-07-27 18:34

Message:
Logged In: YES 
user_id=1344176

Further testing reveals that all of setuptools' extension
commands (tested: egg_info, bdist_egg, test, rotate, alias)
are broken under Python 2.5b2, even when called from the
command line, like so:

$ python2.5 setup.py egg_info

This produces an "error: invalid command: 'egg_info'" message.

----------------------------------------------------------------------

Comment By: Collin Winter (collinwinter)
Date: 2006-07-27 18:18

Message:
Logged In: YES 
user_id=1344176

Forgot to mention: I've tried this with setuptools 0.6a9 and
0.6c1. Python 2.4.x (2.4.1, 2.4.2 and 2.4.3 tested) with
both setuptools version worked fine, where Python 2.5b2
fails with both.

----------------------------------------------------------------------

Comment By: A.M. Kuchling (akuchling)
Date: 2006-07-27 18:03

Message:
Logged In: YES 
user_id=11375

Assigned to Phillip.  I don't see any obviously relevant
changes to distutils/dist.py, but maybe this problems stems
from changes to some other module.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1529871&group_id=5470


More information about the Python-bugs-list mailing list