[Python-Dev] packaging

Antoine Pitrou solipsis at pitrou.net
Mon Mar 14 23:23:58 CET 2011


On Mon, 14 Mar 2011 18:00:50 -0400
Tarek Ziadé <ziade.tarek at gmail.com> wrote:
> 
> And it's also a good way to prevent any conflict with 3.3 : the
> standalone version for 2.4 to 3.2 is "distutils2", and people won't
> have to deal with the same package being in the stdlib and at PyPI.
> (like json vs simplejson, unittest vs unittest2...)

But doesn't it also mean many setup.py scripts will have very tedious
import sequences, such as:

try:
    from packaging.compiler import FooCompiler
    from packaging.commands import BarCommand
except ImportError:
    try:
        from distutils2.compiler import FooCompiler
        from distutils2.commands import BarCommand
    except ImportError:
        try:
            from setuptools.compiler import FooCompiler
            from setuptools.commands import OtherNameForBarCommand as \
                                            BarCommand
        except ImportError:
            from distutils.compiler import FooCompiler
            from distutils.commands import OtherNameForBarCommand as \
                                           BarCommand

(I'm still remembering the import dances which were necessary to get
cElementTree/ElementTree in the 2.4-2.5 days)

Regards

Antoine.


More information about the Python-Dev mailing list