Hello all,<br><br>For unittest2 I now have three different distributions. A &quot;version&quot; 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&#39;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&#39;t make it clear what versions of Python it supports, and the PyPI page doesn&#39;t use the trove classifiers (naughty!), but I&#39;m fine with users of the Python 2.3 distribution having to download and install manually.<br>
<br>Unfortunately it *seems* that &quot;pip install unittest2&quot; (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&#39;ve used pip to install unittest2 in the last few days you&#39;ve got the Python 2.3 version. It is feature complete with tests, so that shouldn&#39;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&#39;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&#39;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 &quot;this distribution is for Python 2.4 - 2.7&quot;, or even &quot;any version of Python 2 after 2.4&quot;.<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>