[Distutils] Problem with distribute and converting tests for python3

Lennart Regebro regebro at gmail.com
Mon Oct 12 19:16:29 CEST 2009

2009/10/12 Michael Whapples <mwhapples at aim.com>:
> In that case I would ask them to download the source distribution and run
> the tests there, they probably will want the source distribution as I may
> need to ask them to apply a patch and test it out (they have the environment
> I didn't foresee/have).

Well, that's one step extra, but fine.

> I question how unit tests in a binary package are like a sort of
> documentation as the user will not be able to see the test source code as it
> will all be in .pyc files.

A binary distribution will include the .py files as well. "Binary" is
different from "source" in that extensions are already compiled. You
don't need to make binary distributions for anything else than
Windows, and then only if you have C-extensions. Modules without
c-extensions are best distributed as a source distribution.

>> The problem is that these files doesn't end up in the binary
>> distribution and hence 2to3 can't be run on them.

> Bad wording on my part, I said compile when I meant convert, so point two
> should be "As distribute will include test/test*.py, why can't distribute
> run 2to3 on these files and so convert my tests and so then be able to run
> tests from the test command". This probably would need distribute to create
> a separate directory (eg. test_3k) and then run tests from the new location
> to achieve this.

No, that wasn't bad wording on your part, I understood perfectly, I
think. The problem is that these files doesn't end up in the binary
distribution and hence 2to3 isn't run on them as the 2to3 conversion
is done in build_py.

Lennart Regebro: Python, Zope, Plone, Grok
+33 661 58 14 64

More information about the Distutils-SIG mailing list