[Pythonmac-SIG] universal binary installer, take 1

Ivan Vinogradov vinogri at mcmaster.ca
Tue Mar 7 20:30:08 CET 2006


On 7-Mar-06, at 1:54 PM, Ronald Oussoren wrote:
>>> <snip>
>>>>    File "/Library/Frameworks/Python.framework/Versions/2.4//lib/
>>>> python2.4/distutils/command/build_ext.py", line 442, in
>>>> build_extension
>>>>      sources = self.swig_sources(sources, ext)
>>>> TypeError: swig_sources() takes exactly 2 arguments (3 given)
>>>
>>>
>>> I don't use swig myself, but I do no this is not a part of the  
>>> code I
>>> have touched yet.  I seem to recall that setuptools contains a
>>> patch to
>>> workaround a simular bug.
>>
>> This also can be resolved by using Pyrex-0.9.3.1 setup.py install.
>> The package at pythonmac.org is Pyrex-0.9.3 .
>> The bdist_mpkg is scary smooth in resolving that.
>
> I don't understand why this helps. What does pyrex have to do
> with swig?

Uneducated guess: it has probably more to do with distutil's way of  
building extensions.
distutil's build_ext.py seems to only know about swig extensions 
(cursory review, cold medicine).

In this project's setup.py(select pieces):
...
try:
     from Pyrex.Distutils import build_ext
     vector3_source = 'vector3.pyx'
     setup_kw = {'cmdclass' : {'build_ext' : build_ext}}
except ImportError:
     vector3_source = 'vector3.c'
     setup_kw = {}
...
setup(
   ...
     ext_modules = [
         Extension('vector3', [vector3_source,]),
         ],
**setup_kw)

The above should somehow educate distutils on how to build Pyrex  
extensions; probably something has gone out of sync between distutils  
and Pyrex after 0.9.3.
It seems to be a well known bug indeed.





More information about the Pythonmac-SIG mailing list