[Distutils] from distutils.core import DistutilsOptionError

Tarek Ziadé ziade.tarek at gmail.com
Wed Feb 24 00:05:01 CET 2010


2010/2/23 P.J. Eby <pje at telecommunity.com>:
> At 05:32 PM 2/23/2010 -0500, Tarek Ziadé wrote:
>>
>> 2/ the work done in 2.7 so far was following the usual deprecation
>> process for relocated
>> APIs or removed APIs, but nothing for misplaced import statements. We
>> did discuss this in the past and said it was fine this way.
>
> Btw, imports from distutils.core *are* API; its docstring describes it as
> "The only module that needs to be imported to use the Distutils".  It's
> supposed to be a one-stop shop for importing common things needed by setup
> scripts, including the errors, Extension, Command, Distribution, etc.

Yes exactly, here's the full docstring:

"""
The only module that needs to be imported to use the Distutils; provides
the 'setup' function (which is to be called from the setup script).  Also
indirectly provides the Distribution and Command classes, although they are
really defined in distutils.dist and distutils.cmd.
"""

And if you look at the code you will see the list of local imports
done on purpose (that I have
kept of course):

  # Mainly import these so setup scripts can "from distutils.core import" them.

So, no exception classes here, which *are* in effect a misplaced
import statement.

Or do you mean that you consider the exception classes located in
Distutils to be a common need
for people that write setup.py scripts ?

I don't think for example that this line that you will find in Distutils 2.6:

   from types import *

Is something we want to keep either. But if the process I've proposed
is accepted then there will
be no more problem.

Regards
Tarek

-- 
Tarek Ziadé | http://ziade.org


More information about the Distutils-SIG mailing list