[Python-Dev] The Breaking of distutils and PyPI for Python 3000?

Robert Brewer fumanchu at aminus.org
Wed Mar 19 21:34:50 CET 2008


Martin v. Löwis wrote:
> I don't see the need to for PyPI. For packages (or "distributions",
> to avoid confusion with Python packages), I see two options:
> 
> a) provide a single release that supports both 2.x and 3.x.
>     The precise strategy to do so might vary. If one is going
>     for a single source version, have setup.py run 2to3
>     (or perhaps 3to2). For dual-source packages, have setup.py
>     just install the one for the right version; setup.py itself
>     needs to be written so it runs on both versions (which is
>     easy to do).
> b) switch to Python 3 at some point (i.e. burn your bridges).
> 
> You seem to be implying that some projects may release separate
> source distributions. I cannot imagine why somebody would want
> to do that.

That's odd. I can't imagine why anybody would *not* want to do that. Given the number of issues 2to3 can't fix (because it would be too dangerous to guess), I certainly can't imagine a just-in-time porting solution that would work reliably. Making two releases means I can migrate once and only once and be done with it. Making a single release work on 2.x and 3.x means I have to keep all of the details of both Python 2 and 3 in my head all the time as I code? not to mention litter my codebase with "# the following ugly hack lets us work with Python 2 and 3" comments so someone else doesn't undo all my hard work when they run the tests on Python 3 but not 2? No thanks. My brain is too small.


Robert Brewer
fumanchu at aminus.org



More information about the Python-Dev mailing list