[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-distutils-sig
Subject:    [Distutils] SWIG: two modules, but only one can be installed
From:       lars () ibp ! de (Lars Immisch)
Date:       2005-02-20 23:46:53
Message-ID: 42191354.8030304 () ibp ! de
[Download RAW message or body]

> I have a module here that makes a library available to python using
> SWIG.  The setup.py file looks like this:
> 
> setup(name = 'my',
>       py_modules = ['mymodule','my'],
>       ext_modules = [Extension('_mymodule',
>                                sources = ['mymodule.c',
>                                           'mymodule.i'])]
> )
> 
> Unfortunately, SWIG creates not only "_mymodule" but also
> "mymodule".  However, the above script must be called twice, because
> at the first run, "mymodule" doesn't exist yet.  (This is
> accompanied by error messages, by the way.)

This problem can probably solved with SWIG alone. Do look into the 
%pythoncode directive.

Briefly, off the top of my head:

include all code that you used to have in mymodule.py in a

%pythoncode %{
%}

section in mymodule.i.

- Lars

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic