Hello all,<br><br>For unittest2 I now have three different distributions. A "version" that supports Python 2.4 - 2.7, one for Python 2.3 that is developed in a separate branch because it makes the code ugly, and a separate distribution for Python 3.<br>
<br>The reason I'm not using 2to3 with a single codebase is that unittest2 for Python 3 is *basically* just a straight copy of the unittest package from Python 3.2 (with a few fixes to work in 3.0 and a few other changes that are in unittest2 anyway). Having a single distribution with multiple versions in and having setup.py decide at install time would be another approach, but that plays badly with test discovery.<br>
<br>So the challenge is, how do I put all of these up on PyPI and have pip install the right one?<br><br>pip doesn't make it clear what versions of Python it supports, and the PyPI page doesn't use the trove classifiers (naughty!), but I'm fine with users of the Python 2.3 distribution having to download and install manually.<br>
<br>Unfortunately it *seems* that "pip install unittest2" (on Python 2.4 - 2.7) will just install from whichever file was *most recently uploaded* to the PyPI page - even if it is marked as not a source distribution and has Python 2.3 in the name. So, the good news is that if you've used pip to install unittest2 in the last few days you've got the Python 2.3 version. It is feature complete with tests, so that shouldn't actually be a problem.<br>
<br>As far as I can tell the only way I can solve this is to remove the Python 2.3 download from PyPI and host it separately, which is what I've now done. (Download link on the PyPI page if you need it.)<br><br>Similarly I guess there is no way to have a Python 3 distribution under the same project and have pip install the correct distribution under the correct version of Python.<br>
<br>To get round this I have created a separate project: unittest2py3k. It still installs the same *package name*, just has a different project name.<br><br>Now if distutils2 could solve these problems, that would be great. :-) I'm aware that setuptools / distribute allows you to provide (what are effectively binary) distributions for specific Python versions, but I need to support pip too. <br>
<br>It would also be great if there was a way of specifying "this distribution is for Python 2.4 - 2.7", or even "any version of Python 2 after 2.4".<br><br>All the best,<br><br>Michael<br clear="all">
<br>-- <br><a href="http://www.voidspace.org.uk">http://www.voidspace.org.uk</a><br><br><br>